I'm working with 52259demomcu and I'm using codewarrior v7.1 SE. When I create the lcf file with the whole 64k RAM area the program doesn't work fine. I think my lcf is according with the address space for this micro, could anyone verify it. The most relevant part of lcf is here:
# Memory ranges
vectorsrom (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
cfmprotrom (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000020
bootcode (RX) : ORIGIN = 0x00000420, LENGTH = 0x00003BE0
#End reserved 16Kb boot area code.
flashcode (RX) : ORIGIN = 0x00004010, LENGTH = 0x0007BFF0
vectorram (RWX) : ORIGIN = 0x20000000, LENGTH = 0x00000400
# userram (RWX) : ORIGIN = 0x20000400, LENGTH = 0x00005A00
userram (RWX) : ORIGIN = 0x20000400, LENGTH = 0x0000FC00
ipsbar (RWX) : ORIGIN = 0x40000000, LENGTH = 0x0
....(here sections are defined).....
___VECTOR_RAM = 0x20000000;
___FLASH = ADDR(.vectorsrom);
___FLASH_SIZE = 0x00080000;
___SRAM = 0x20000400;
# ___SRAM_SIZE = 0x00005A00;
___SRAM_SIZE = 0x0000FC00;
___IPSBAR = ADDR(.ipsbar);
___SP_SIZE = 0x0800;
___HEAP_START = .;
___HEAP_END = ___SRAM + ___SRAM_SIZE - ___SP_SIZE;
___SP_END = ___HEAP_END;
___SP_INIT = ___SP_END + ___SP_SIZE;
___heap_addr = ___HEAP_START;
___heap_size = ___HEAP_END - ___HEAP_START ;
___SP_AFTER_RESET = ___SRAM + ___SRAM_SIZE - 4;
__SP_INIT = ___SP_INIT;
_romp_at = ___ROM_AT + SIZEOF(.data);
.romp : AT(_romp_at)
__S_romp = _romp_at;
The debugger shows variables getting a different value than I set it for them...
When I define a little RAM space the code work fine.
I don't know what is going on, any idea would be grateful.
Thanks in advance.