Skip to main content
Bs.1
Associate III
April 23, 2021
Question

Memory alignment(structure Padding)

  • April 23, 2021
  • 1 reply
  • 1456 views

Hi,

I am using STM32CubeIDE 1.6.0.

In my program for EEPROM read/write I have use structure but its takes too much size because of padding.

I tried with #pragma Pack, __attribute__((packed)), even by rearranging the structure member.

but there is no size reduction of structure .

Anyone having the solution to reduce this size??or any setting for compiler?

Any help will be highly appreciated..

Thanks in advance

This topic has been closed for replies.

1 reply

Radosław
Associate II
April 23, 2021

Seems you are using this incorrectly. this must work.