Pack struct on 56F8367

I tried to use a union of struct and char array to handle data in RAM and save it to an I2C EEPROM.

On other controllers this was no problem because the compilers put one variable of the struct after the other. The CodeWarrior leaves some addresses blank. Is it possible to configure it the way he didn't leave spaces?

First of all, I would like to apologize for the time that it has taken us to get back to you on this issue.We appreciate your patience and want to let you know that we are doing efforts to improve our response time.

See below some info regarding the structure Alignment.

Hope this will help you.

Problem: Explanation/Clarification on structure alignment.

Description:Question regarding the structure alignment.Se below an example showing the problem.See car2,car3,car4,car5,car6 and car7.The tool reserve an int instead of a char.Is it not possible to align better the structure ?

The specifications for 56800e are such that we cannot modify this behavior in build tools.If you look into Targeting_56800E.pdf at data alignment requirements, one can see "• Structures — word boundaries (not byte boundaries).NOTE A structure containing only bytes still is word aligned.This holds also for unions.This is why you can see one byte padding, besides the char data.

The structure mytest has 2 int and 2 char and take 3 int only.According to the manual is should take 4 int.struct{ int test1; int test2; char test3; char test4; }mytest;

Please note that the specifications are for data alignment and not data size.So, char can be aligned on byte boundary.That is why in second example you see test4 aligned on byte boundary.

Still, if test4 is included in another structure or union, it has tostay on word boundary because of the restrictions for structures.That is why one byte padding will be introduced between test3 and test4.So, yes the entire structure mytest will take 4 ints here: