AnsweredAssumed Answered

Initializing global data in S12X flash

Question asked by David Poinsett on Apr 4, 2007
Latest reply on Apr 11, 2007 by David Poinsett
CodeWarrior HCS12X 4.5
S12XDP512
Banked memory model
Minimal start-up

In the following example, TestStr and TestInt get initialized as expected. GlobalFlashTestStr and GlobalFlashTestInt do not get initialized but show allocated space in the map and debugger. What am I missing? How do I init data in the global flash space? Thanks.

Simplified code example://----------------------------------------------------------const char TestStr[] = "Test String";const int TestInt = 1234;#pragma DATA_SEG __GPAGE_SEG USRPGM_FLASHconst char GlobalFlashTestStr[] = "Global Flash Test String";const int GlobalFlashTestInt = 5678;#pragma DATA_SEG DEFAULTvoid main(void) {   for(;;) {}}//----------------------------------------------------------From PRM:SEGMENTS...FLASH_G1 = READ_WRITE 0x780000'G TO 0x78FFFF'G; // PAGE_E0 TO PAGE_E3...ENDPLACEMENT...USRPGM_FLASH INTO FLASH_G1;...ENDENTRIESGlobalFlashTestStrGlobalFlashTestIntTestStrTestIntEND//----------------------------------------------------------

Outcomes