We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have a struct containing several word8, word16 and word32. Writing a full 32-bits value causes mis-writing to the previous 32-bits value. 2 bytes go to the correct place, and 2 bytes to the previous. Having 8 or 16 bits entities in the same struct works fine and they align correctly. I don't use __packed. Some times I don't see the overwritten data, when I assume it's written to padded cells. We have 16 bits external ram for this. Little endian. Keil tool, ARM compiler.
Øyvind Teig home.no.net/.../work.html
The strange things is that a static 32 bits variable also residing in external ram, not inside the struct, indeed writes and reads flawlessly! The bytes/word8 and word16 in the struct are fine, but not the word32 values inside the struct. I have two boards, they both behave the same.