I develop a forked version of Gnuk project (GNUK - Debian Wiki) and after upgrading to PlatformIO 6 I stumbled upon build errors (“unrecognized option -x”) for assembly files. I use Windows 10.
By searching, I found this issue (Cannot use assembly files in MCS51 platform due to core issue · Issue #3917 · platformio/platformio-core · GitHub) and renamed .s
files to .S
in my platformio.ini
. This problem went away with platform ststm32 up to 15.3.0. I understood that it was a bug and .s
files should be passed directly to assembler whereas .S
files should be passed to it through gcc. Previously, they all went through gcc.
On platform ststm32@15.4.0, the following error is given:
ChibiOS_2.0.8\os\ports\GCC\ARMCMx\crt0.S:70: Error: selected processor does not support requested special purpose register -- `msr PSP,r0'
ChibiOS_2.0.8\os\ports\GCC\ARMCMx\crt0.S:122: Error: selected processor does not support requested special purpose register -- `msr CONTROL,r0'
Build command for ststm32@15.3.0:
arm-none-eabi-gcc -x assembler-with-cpp -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DF_CPU=72000000L -DPLATFORMIO=60002 -DSTM32F1 -DSTM32F103xB -DARDUINO_BLUEPILL_F103C8 -DCORTEX_USE_BASEPRI=TRUE -DKEYGEN_SUPPORT -Isrc -I.pio\libdeps\STM32F103_12Mhz\tiny-AES-c -Ipolarssl-0.14.0\include -IChibiOS_2.0.8\os\hal\include -IChibiOS_2.0.8\os\hal\platforms\STM32 -IChibiOS_2.0.8\os\ports\GCC\ARMCMx -IChibiOS_2.0.8\os\ports\GCC\ARMCMx\STM32F10x -IChibiOS_2.0.8\os\ports\GCC\ARMCMx\cmsis -IChibiOS_2.0.8\os\kernel\include -Iboards\common
-IChibiOS_2.0.8\os\various -Iclrc632 -Iboards\STM32F103_12Mhz -c -o .pio\build\STM32F103_12Mhz\ChibiOS_2.0.8\os\ports\GCC\ARMCMx\STM32F10x\vectors.o ChibiOS_2.0.8\os\ports\GCC\ARMCMx\crt0.S
Build command for ststm32@15.4.0:
arm-none-eabi-gcc -x assembler-with-cpp -DF_CPU=72000000L -DPLATFORMIO=60002 -DSTM32F1 -DSTM32F103xB -DARDUINO_BLUEPILL_F103C8 -DCORTEX_USE_BASEPRI=TRUE -DKEYGEN_SUPPORT -Isrc -I.pio\libdeps\STM32F103_12Mhz\tiny-AES-c -Ipolarssl-0.14.0\include -IChibiOS_2.0.8\os\hal\include -IChibiOS_2.0.8\os\hal\platforms\STM32 -IChibiOS_2.0.8\os\ports\GCC\ARMCMx -IChibiOS_2.0.8\os\ports\GCC\ARMCMx\STM32F10x -IChibiOS_2.0.8\os\ports\GCC\ARMCMx\cmsis -IChibiOS_2.0.8\os\kernel\include -Iboards\common -IChibiOS_2.0.8\os\various -Iclrc632 -Iboards\STM32F103_12Mhz -c -o .pio\build\STM32F103_12Mhz\ChibiOS_2.0.8\os\ports\GCC\ARMCMx\crt0.o ChibiOS_2.0.8\os\ports\GCC\ARMCMx\crt0.S