Initialised Data question, CodeWarrier MobileGT 9.2

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Initialised Data question, CodeWarrier MobileGT 9.2

1,646件の閲覧回数
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

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 返信

1,089件の閲覧回数
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 件の賞賛
返信