Hello!
What I have to do to put const chars into flash memory?
I use KDS like below with j-link from Segger (Picture1).
Picture1:


For example
static const unsigned char en_menu_1_0[15]="Put into flash";
Picture2:

map file (Picture3):


When I read from this array in run
i= en_menu_1_0[2];
Picture4:

On the Picture4 the value i=0x74 (ASCII == ‘t’) so this is correct. In this situation debbuger show correct value.
But why:
1. The debugger shows strange value like in picture2 above, where is initialization of const unsigned char array? const unsigned char en_menu_1_0[15]="Put into flash"?
2. Why address of static const unsigned char en_menu_1_0 is …. 0x00000000 (picture2)?
...................................................................................................................................................
Maybe I describe what I want to do....
I want to prepare menu strings that I want to put to the flash memory.
Then make array of pointers to the array of chars….
Something like this below for atmel.
But how can I do this in Kinetis (KL46Z256)?
In 8051 there is “code”
In atmel ther is “PROGMEM”
What I have to do in Kinetis KL46?
example from atmel:
const char MenuItem1[] PROGMEM = "Mirek";
const char MenuItem2[] PROGMEM = "Tomek";
const char MenuItem3[] PROGMEM = "Atnel";
const char * const MenuItemPointers[] PROGMEM = {
MenuItem1,
MenuItem2,
MenuItem3
};
int main( void ) {
lcd_init();
uint8_t i;
while(1) {
for(i=0; i<3; i++)
lcd_str_P( (char*)pgm_read_word( &MenuItemPointers[i] ) );
}
}
...............................................................................................................................................
I will be very gratefull for any help and sugestion.
Best Regards
Piotr