Dear all,
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
MEMORY {
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;
WRITEW(___ROM_AT);
WRITEW(ADDR(.data));
WRITEW(SIZEOF(.data));
WRITEW(0);
WRITEW(0);
WRITEW(0);
}
The debugger shows variables getting a different value than I set it for them...
解決済! 解決策の投稿を見る。
Hi
Heap and stack space seems like out of memory space when you increase the RAM space. Try this:
___SP_END = .;
___SP_INIT = ___SP_END + ___stack_size;
___HEAP_START = ___SP_INIT;
___heap_addr = ___HEAP_START;
#FSL: rest of RAM used for HEAP
___HEAP_END = ___SRAM_ADD + ___SRAM_SIZE - 4;
___HEAP_SIZE = ___HEAP_END - ___HEAP_START;
. = ALIGN (0x4);
Hope this helps
Hi
Heap and stack space seems like out of memory space when you increase the RAM space. Try this:
___SP_END = .;
___SP_INIT = ___SP_END + ___stack_size;
___HEAP_START = ___SP_INIT;
___heap_addr = ___HEAP_START;
#FSL: rest of RAM used for HEAP
___HEAP_END = ___SRAM_ADD + ___SRAM_SIZE - 4;
___HEAP_SIZE = ___HEAP_END - ___HEAP_START;
. = ALIGN (0x4);
Hope this helps
Hi Paolo,
Your are right I did the modifications and It works.
Anyway could you say me where I can find more information about how manage this stuff (stack, heap ....) inside the lcf file.
Thank you.
Try this:
C:\Program Files\Freescale\CodeWarrior for ColdFire V7.1\Help\PDF\Targeting_ColdFire.pdf
Heap and stack spaces will vary depending the number of available memories: SDRAM, SRAM, internal SRAM, etc, so your imaginations on how to use it is the limit :-D
This doc will show the basic commands, but as many LCFs you can see, the more you can learn
Good luck