IT lexicon › Hardware › PendSV

PendSV

Hardware På svenska → Updated: 2026-11-03

A Cortex-M exception designed to be postponed — which is why nearly every RTOS does its task switching there.

PendSV, the Pendable Service Call, is exception number 14 on Cortex-M. No peripheral raises it; software does, by setting a bit in the ICSR register. The trick is that it gets configured to the lowest priority in the system, so it only runs once every other interrupt has finished.

That is exactly what an RTOS wants. The SysTick handler decides another task should run, but swapping stacks in the middle of a chain of nested interrupts is asking for trouble. So it marks PendSV as pending, and the actual context switch happens when the hardware is on its way back to thread mode anyway. FreeRTOS, Zephyr and most other Cortex-M kernels work this way. Its sibling SVC, by contrast, is synchronous and used for system calls.

← Back to the lexicon