2003-12-21 07:05 PM
2003-12-19 01:35 AM
I use ST72F521 that his stack allocation is in 100-1FF.
When I try to define in project.prm SECTION as follow: SECTIONS MY_ZRAM = NO_INIT 0x80 TO 0xFF ; MY_RAM = READ_WRITE 0x200 TO 0x87F; MY_STACK = READ_WRITE 0x100 TO 0x1FF; MY_ROM = READ_ONLY 0x1000 TO 0xFFDF; END There are many link errors as: LEX allocated in segment _ZEROPAGE is not allocated according to the segment _R_Z allocated in segment _ZEROPAGE is not allocated according to the segment and so on.. In ST72F521 datasheet the memory map is as has defined above, so Why there are many compiler (mertrowerks) errors? The real problem is: that the compiler allocates variables in the stack area for example: busXmit 1F6 1F ( 19) DEFAULT_RAM and when I do memcpy to that buffer the run-time system is crashed and reset is occurred. How do I avoid the compiler to allocate variables in STACK area? atz2003-12-19 04:08 AM
Could you show us the rest of your prm file, also what memory model are you using ?
Regards sjo2003-12-20 09:40 AM
2003-12-21 05:21 PM
Hello,
The problem you are facing ''LEX allocated in segment _ZEROPAGE is not allocated according to the segment '' is because you have placed _ZEROPAGE in MY_RAM (0x200 to 0x87F) memory which is not short addressable but variables like _LEX, _REX, _R_Z assume short addressable memory. This problem can be solved by placing ZEROPAGE in MY_ZRAM _ZEROPAGE,_OVERLAP INTO MY_ZRAM; Hope this helps Could you provide some more details about the ''Run time crash'' you are referring Regards, PraveenG2003-12-21 07:05 PM