Description
The SCV instructions is optionally implemented in some of the Cortex-M0+ (synthesis option) consequently the arm_none_eabi_gcc has to target options one including the SVC instruction: -march=armv6s-m and one without it: -march=armv6-m. As far as I can see the makefile uses -march=armv6-m by default thereby causing the fault: "context_switch.s:163: Error: SVC is not permitted on this architecture".
the toolchain configuration provided in the pico-sdk. if you navigate to the file: pico-sdk/cmake/preload/toolchains/pico_arm_gcc.cmake around the line 55 you will find:
set(ARM_GCC_COMMON_FLAGS " -march=armv6-m -mcpu=cortex-m0plus -mthumb")
This is incorrect; The rp2040 implementation of the Cortex-M0+ includes the SVC instruction. This architecture doesn't. You will need to change the line to the following one:
set(ARM_GCC_COMMON_FLAGS " -march=armv6s-m -mcpu=cortex-m0plus -mthumb")