Michael Predko

How do you align "const char" arrays to the start of a word (32 bit) address?

Discussion created by Michael Predko on Sep 21, 2010
Latest reply on Oct 6, 2010 by Juraj Vanco

Hey folks,

 

I'm looking for the (EWL?) directive which will align a const char array (or some other data type) on a 32 bit boundary so that I can update it using the ColdFire Flash Module (CFM). 

 

ie:

 

const char TestFlags[] = {Byte0, Byte1, Byte2, Byte3, Byte4};

const char TestData[] = {Byte0, Byte1, Byte2, Byte3, Byte4};

 

In this case, I would like both "TestFlags" and "TestData" (which are both 5 bytes long) and any subsequent const char arrays to have their first four bytes located in a 32 bit word (so, the first address of TestData would be 8 bytes different from the first address of TestFlags). 

 

Is there another data type would work better or if there is some better way to specify the placement of the data blocks?  I would like to avoid using MQX's "FlashX" (I'll write my own driver) as it seems to have too much overhead. 

 

Ideally, I would like to place this data AFTER the linked code but have it included in the build so that:

a) If there is a mistake in my software, I don't start trashing application or MQX code

b) I can dynamically add to the blocks, if required. 

 

Thanx,

 

myke

Outcomes