Hello Johan,
You initially had some problems with overlapping or segments with incorrect range. These needed to be first corrected, before making the changes required to place the RAM based code. These corrections are shown in red, within the following PRM. I have also re-sequenced some ot the lines for clarity, but should not affect PRM operation.
/* Linker parameter file for the GB60 */NAMESENDSECTIONS /* all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */ Z_RAM = READ_WRITE 0x0080 TO 0x00FF; RAM = READ_WRITE 0x0100 TO 0x0B7F; //0x107F; Adjust to allow for SSTACK SSTACK = READ_WRITE 0x0B80 TO 0x107F; // Explicit stack section now defined. ROM2 = READ_ONLY 0x1080 TO 0x13EF; //0x17FF; Previous overlap with NVRAM FLASH_TO_RAM = READ_ONLY 0x13F0 TO 0x13FF RELOCATE TO 0x0B80; // RAM based code. NVRAM = NO_INIT 0x1400 TO 0x17FF; //0x1800; /* 802.15.4 MAC NVRAM AREA */ ROM = READ_ONLY 0x182C TO 0xFAFF; //0xFEFF; Previous overlap with vector areaENDPLACEMENT /* all predefined and user segments are placed into the SECTIONS defined above. */ _DATA_ZEROPAGE, MY_ZEROPAGE INTO Z_RAM; DEFAULT_RAM INTO RAM; DEFAULT_ROM INTO ROM/*, ROM2*/; /* in case you want to use ROM2 here as well, add option -OnB=b to the compiler. */ DOT4MAC_NVRAM INTO NVRAM; FLASH_ROUTINE INTO FLASH_TO_RAM; ENDSTACKTOP 0x107F//STACKSIZE 0x500 VECTOR 0 _Startup /* reset vector: default entry point for a C/C++ application. */
The additional and modified items, for flash programming purposes, are shown in blue. The intent is to place the code that is eventually relocated RAM (bottom of stack position) at the FLASH_TO_RAM location. A stack segment SSEG is also explicitly defined so that the bottom of stack position is known. Consequently, STACKTOP (rather than STACKSIZE) has been defined. The size of the stack should remain at 0x500 bytes.
When modifying a PRM, make sure that the various sections that are defined do not overlap each other.
Regards,
Mac