AnsweredAssumed Answered

Memory alignment of STM32

Question asked by K. Suppakit on Feb 21, 2014
Latest reply on Feb 21, 2014 by Clive One
Hi, every one.

I create this structure. Then I try to find size of this structure. But it seem wrong.

typedef struct {
    uint8_t  a;
    uint8_t  b;
    uint16_t c;
    uint16_t d;
    uint8_t  e;
} test;

sizeof (test) = 8

Normally, it should be 7. Why is 8?
I try to check about the memory alignment in ldscript.
That is 32 bits =>   ". = ALIGN(4);".

How can I get the actual size of this structure?

Thank you