The code of app is freertos , the chip has a bootloader, The chip run on Cortex M0

When trigger the PendSV exception, the context switches with Cortex-M0 is wrong.  but the program without the bootloader, the app can run ok.

More questions in this forum