The latest release of SEGGER’s Embedded Studio for ARM comes with STOP technology, designed by SEGGER to reliably prevent stack overflows. With STOP enabled, the compiler adds a call to a stack limit-check routine wherever necessary, before adjusting the stack pointer.
The STOP option for the highly optimizing SEGGER Compiler can be easily switched on, without any change to application code. This way, all stack overflows are prevented. If a stack overflow has been prevented, the system can enter a safe state and recover.
STOP has a surprisingly low impact on size and speed: It adds only about 2 – 5% to code size and execution time, which typically does not significantly impact the system’s performance.
A stack overflow can cause all kinds of failures in an embedded system, from hard-to-detect, seemingly random miscomputations to severe malfunctions or even crashes.
STOP simply works, protecting all stacks in the system.
It protects the process stack, as well as the “main” stack used for interrupts.
It can be used with any RTOS, provided the RTOS updates the stack-limit variable on a context switch.
The technology is currently available for Thumb-2 architectures such as Cortex-M4, Cortex-M7, Cortex-A9, and Cortex-A15.
On ARMv7M architectures, STOP is ready to use in Embedded Studio with a single project option switch.