Hi, I had a very similar problem when interfacing the MCF5407 to a usb device. The trick is to pack the structure as follows:
#pragma pack(1) // pack all structures to 1 byte
typedef struct {
uint8 data1;
uint8 data2;
uint8 data3;
} data_struct1;
typedef struct {
data_struct1 data1;
uint32 data2;
uint8 data3;
uint32 data4;
} data_struct2;
// total size of data_struct1 is 3
// total size of data_struct2 is 12
// without the pragmas I think there would be 1 pad byte before data2.
// there would also be 3 pad bytes before the data4 member.
#pragma pack (0) // default packing
I hope this helps
Neil Martin