Initialised Data question, CodeWarrier MobileGT 9.2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Initialised Data question, CodeWarrier MobileGT 9.2

1,652 Views
martinw
Contributor III

Hi,

 

We are using CodeWarrier MobileGT 9.2 on an MPC5123.

 

We are loading our application at startup from an SD card (bootloader is in flash).

 

Part of the system requirement is that we must be able to checksum any area of the .text section at the request of an external application.  The external application will compare the checksum result with one it calculates from it's own copy of our application.

 

The problem we have is that initialised variables are not specifically initialised by copying a block of data from the RO section to the RW sections.

 

This means that initialised variables are effectively part of the .text section and have to be checksummed but of course they are changed during normal progam operation.

 

Can anyone suggest a way of producing a table of initialisation data which is part of .text, so that .sdata does not then have to be part of the checksummed area?

 

An example:

 

                                      //This will be defined in .data

int GlobalCount = 0x100;

 

 

                                      //This modifies GlobalCount - so checksum will fail

void  DecGlobalCount(void)

{

     while (GlobalCount > 0)

     {

           GlobalCount--;

     }

}

 

Many Thanks

 

Martin Wakely

Labels (1)
0 Kudos
Reply
1 Reply

1,095 Views
CrasyCat
Specialist III

Hello

 

In order to get initialization value copied from ROM to RAM at startup you need to define a ROM image for your application.

 

Please go to www.freescale.com and search for FAQ-27787.

This will explain you how to create the ROM image.

 

I hope that helps.

 

CrasyCat

0 Kudos
Reply