Embedded Studio stops overflowing Arm stacks

Segger has added a way to prevent stack overflows to its Embedded Studio for Arm IDE (integrated development environment).

Embedded Studio stack-overflow-protection

It can be switched on in the compiler without any change to application code.

Limitations are that it is currently available for Thumb-2 architecture cores such as Cortex-M4, Cortex-M7, Cortex-A9, and Cortex-A15. On ARMv7M architectures, it is ready to use with a single project option switch.


With enabled, “the compiler adds a call to a stack limit-check routine wherever necessary, before adjusting the stack pointer”, said the company. If a stack overflow has been prevented, the system can enter a safe state and recover.


It adds ~ 2 – 5% to code size and execution time, claims Segger. It protects the process stack, as well as the stack used for interrupts, and can be used with any RTOS, provided the RTOS updates the stack-limit variable on a context switch.

“For any safety critical application, I consider it essential,” said company founder Rolf Segger. “To the best of my knowledge,  Segger is the only company offering such technology.”

Find more information on this stack overflow prevention product page or on this wiki


Leave a Reply

Your email address will not be published. Required fields are marked *

*