martin wakely

Initialised Data question, CodeWarrier MobileGT 9.2

Discussion created by martin wakely on Nov 10, 2009
Latest reply on Nov 17, 2009 by CrasyCat



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)






Many Thanks


Martin Wakely