Cortex r4

Optimize the stack setup in R4.