Skip to main content

IAR Embedded Workbench for Arm 9.70.x

‑‑align_sp_on_irq

In this section:
Syntax

‑‑align_sp_on_irq

Description

Use this option to align the stack pointer (SP) on entry to __irq declared functions. In 64-bit mode, this option has no effect.

This is especially useful for nested interrupts, where the interrupted code uses the same SP as the interrupt handler. This means that the stack might only have 4-byte alignment, instead of the 8-byte alignment required by AEABI (and some instructions generated by the compiler for some cores).

See also

__irq.

Caution

To set this option, use Project>Options>C/C++ Compiler>Extra Options.