AnsweredAssumed Answered

MAP file and variables declaring order

Question asked by sebasira on May 21, 2013
Latest reply on Jun 26, 2013 by sebasira

Hello to you all!

 

I'm working with TWRK60 and IAR Workbench.

 

I've got a doubt about how the linker arrange variables in memory. The way I'm used to work, if I declare a variable before another one, then the first one is located at a smaller memory address.

 

To my sourprise, I've got the following:

(Note: NVM_DATA is a macro for placing variables in an specific section)

 

NVM_DATA const tPARAM_MOVIL PROG_MOVIL;

NVM_DATA const tPARAM_RADIO PROG_RADIO;

 

and then in the MAP file:

 

PROG_MOVIL       0x0007f810    0xc  Data  Gb  DataNVM.o [1]

PROG_RADIO       0x0007f800   0x10  Data  Gb  DataNVM.o [1]

 

As you can see, I declare PROG_MOVIL before PROG_RADIO, but it's placed after it.

 

Why's that?

 

 

For me this would represent a problem in the future, when updating the firmware via bootloader, because I can't guarantee that nonVolatileData would be where it is suppose to be.

 

 

Outcomes