Emanuele Corini

S12Z 32bit struct with bitfields

Discussion created by Emanuele Corini on Sep 7, 2017
Latest reply on Sep 17, 2017 by Emanuele Corini



I'm using S12Z microcontroller on CW 10.6 with these code generation options:

Memory Model: Small

Bit-field gap limit: 255

Bit-filed byte allocation from LSB to MSB: enabled

Bit-filed type size reduction: disabled


This struct:

typedef struct _TestStruct
   unsigned long field1 : 1;
   unsigned long filed2 : 31;
} tTestStruct;


has size of 5bytes in map file. What is the reason?


thanks for your response!