This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Linker placing code beyond space limit. 21 bytes of code, 2KB space

int main()
{
  for(;;)
  {
    P1_6 = 0;
    P1_6 = 1;
  }
}

Tried LX51 link with: (SMALL / SMALL)

TO "Clock"
REGFILE (.\Clock.ORC)
RESERVE (C:0x0800-C:0x7FFF)

Result:

Build target 'Target 1'
compiling main.c...
linking...
Program Size: data=9.0 xdata=0 const=0 code=21
creating hex file from "Clock"...
"Clock" - 0 Error(s), 0 Warning(s).
HEX output:
:030000000280007B
:10800000787FE4F6D8FD75810702800CC296D2967F
:0280100080FAF4
:00000001FF

Target device: AT89LP214. Has 2KB of code space, which ends at 0x07FF.
Everything I try sticks the code at 0x0800 or higher.

I'm going to be sad if I have to link code manually every time I compile.

I've tried not reserving any code space at all; linker sticks it at 0x0800.
I've tried setting the target device to AT89LP214 and letting keil figure things out. Sticks it at 0x0800 with the LX51 linker, doesn't compile with BL51.
I've tried changing memory models, code rom size models, same result. 0x0800 with LX51, doesn't compile with BL51. Tried checking and unchecking "Use On-Chip ROM (0x0-0x7FF)".

Using uVision V4.60.6.10, Toolchain PK51 9.51, C51 v9.51, A51 V8.02b, BL51 6.22, LX51 V4.64.0.0

Parents
  • You sir, are correct! It is an evaluation copy, and that would cause the problems I am experiencing.

    However, while Keil "worked" for my University studies when I was targeting a 16K device, the sheer number of headaches I endured while doing so (substandard UI due to lack of usability testing, combined with suboptimal code generation), makes me far less than willing to pay for a full version of Keil.

    I will be looking elsewhere for an IDE. Even paid ones. Just not Keil's.

    Thanks for figuring out my problem though. I do appreciate it; I was getting frustrated.

Reply
  • You sir, are correct! It is an evaluation copy, and that would cause the problems I am experiencing.

    However, while Keil "worked" for my University studies when I was targeting a 16K device, the sheer number of headaches I endured while doing so (substandard UI due to lack of usability testing, combined with suboptimal code generation), makes me far less than willing to pay for a full version of Keil.

    I will be looking elsewhere for an IDE. Even paid ones. Just not Keil's.

    Thanks for figuring out my problem though. I do appreciate it; I was getting frustrated.

Children