Loading...
 
Skip to main content

System Workbench for STM32


Is SW4STM32 Little or Big Endian?

France

Hi Ben,

By default ARM is little-endian, whatever the compiler you use (its not the compiler who decides: its the MCU that works by default as little-endian but may be manually programmed to behave as big-endian for data).

In your example p8data raw value is the same as p32data, and it points to the first byte of a 32-bit value, which is the LSB in little-endian mode.

Regarding pointer arithmetic, its done in units of the size of the pointed-to items (that's standard C semantics) so p8data+1 effectively increments the pointer raw value by 1 while p32data+1 increments it by 4 bytes.

Bernard (Ac6)