Hi All:
I use Keil uVision3.I setup BL51 Locate: code range:0x80-0x3EFF Xdata range:0x3E00-0x3FFF,0xE000-0xE1FF
I want to compile a .c file like this:
BYTE xdata array1[2]; BYTE xdata UsbBuffer[512];
but I get some Error Message: *** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: XDATA SEGMENT: ?XD?BULKEXT LENGTH: 0202H
If I remove array[2] and compile,It will be OK. I don't know why BL51 not Locate array[2] to another memory block(0x3E00-0x3FFF)?
If I use _at_ keyword will OK. xdata range:0x3F00-0x3FFF, 0xE000-0xE1FF code like this:
BYTE xdata UsbBuffer[512]; BYTE xdata array[2] _at_ 0x3F00;
memory map: TYPE BASE LENGTH RELOCATION SEGMENT NAME XDATA 3F00H 0002H ABSOLUTE XDATA E000H 0200H UNIT ?XD?BULKEXT
but...why BL51 can't locate array[2] to another memory block(0x3E00-0x3FFF) by itself?
but...why BL51 can't locate array[2] to another memory block(0x3E00-0x3FFF) by itself? it can't because there are some loval variables there already.
I GUESS the linker does absolutes first, thus when using _at_ you force the locals to the other region. switching to small will probably fix the problem