Why ARM Cortex-M RTOS Context Switches Fail and How to Fix Them
Summary A custom RTOS context switch implementation on an ARM Cortex-M (STM32) failed to execute task switching, resulting in a HardFault or system hang. The failure stemmed from incorrect manual stack frame initialization and improper usage of ARM Inline Assembly within a PendSV_Handler. While the logic for swapping pointers was present, the state of the … Read more