LPC2148 and words on odd addresses.
2006-04-29 by struer_trace
Hey,
I started messing around with an LPC2148 this week, and until now
everything has just been great. The CPU is just amazing compared to
what I have been working with before. I'm porting a project I did for
the HCS12 series of CPU's to this ARM.
But one thing is very different from what I'm used to. This LPC2148
can only access 16bit and 32bits words within even addresses. (As far
as I understand from the manual).
And that has become a problem for me when porting my code. Because I
have a struct like this:
typedef struct {
uint8 ucJBC[3]; // Jump to bootstrap
code
uint8 cOEMid[8]; // OEM ID Name of
the formatting OS
uint16 uiBytesPrSector;
uint8 ucSectorsPrCluster; //
... etc.
}
When I compile this it's not possible to get the correct result from
the uiBytesBeSector because it's placed on a odd address. So my
question is... How do I get the correct result from words aligned odd?
And is it really impossible to make a struct like this? Do I really
have to make all my structs byte even or make it purely by 16 and 32
bit words?
I'm using CrossStudio for ARM 1.5 Evaluation and the MAM is set to mode 2.
Thanks in advance!
Best regards
Jan Thogersen