Stack Alignment requirement for MPC5777M / S32ds

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Stack Alignment requirement for MPC5777M / S32ds

735 Views
jschloss
Contributor III

Hi,

Is the stack allowed to have 8 byte alignment on the MPC5777M? I see the linker script sets main's stack aligned to 16 bytes, but our OS vendor set the OS thread stacks to 8. It looks like NXP's published FreeRTOS port uses 32 byte alignment.

Using the GNU Compiler Collection (GCC): RS/6000 and PowerPC Options makes it sound like it depends if the program is built in -meabi or -mno-eabi mode, but looking through some build settings I can't see if we are building in full EABI mode.

Are we ok with 8 byte aligned stacks, or is there a reason to go wider?

Labels (1)
Tags (3)
0 Kudos
2 Replies

580 Views
martin_kovar
NXP Employee
NXP Employee

Hello Jacob,

this is really interesting question. According to Power Architecture 32-bit EABI standard, it is required to align stack to 16 bytes.

I have not found anywhere, what is the impact of 8 byte alignment but I had consulted this topic with my colleague who is application engineer for S32 Design Studio and he told me it is very recommended to follow EABI standard especially when it is related to operating system development.   

So, this is what EABI defines, but as I wrote you above, I cannot judge the risk, when you will not follow this standard.

Hope this helps a little bit.

Regards,

Martin

580 Views
jschloss
Contributor III

Thanks, we'll change it to 16 bytes then.

0 Kudos