2023-03-15 01:59 AM
My goal is to have a build system that I can either use locally to program/debug but also would work for CI integration.
I am fairly new to ST environment but to me it seems something is going wrong with makefile generation.
I am faced with the following assembler error though: "selected processor does not support `cpsid i' in Thumb mode".
This happens in the following situations:
So it seems seems that either the makefile is not correct or gnu does not support this chip yet?
for completeness the gcc call (made by makefile) that throws the error:
C:\arm-gnu\12.2-rel1\bin/arm-none-eabi-gcc -c -mthumb -DUSE_HAL_DRIVER -DSTM32C031xx -ICore/Inc -IC:/Users/HansW/STM32Cube/Repository/STM32Cube_FW_C0_V1.0.1/Drivers/STM32C0xx_HAL_Driver/Inc -IC:/Users/HansW/STM32Cube/Repository/STM32Cube_FW_C0_V1.0.1/Drivers/STM32C0xx_HAL_Driver/Inc/Legacy -IC:/Users/HansW/STM32Cube/Repository/STM32Cube_FW_C0_V1.0.1/Drivers/CMSIS/Device/ST/STM32C0xx/Include -IC:/Users/HansW/STM32Cube/Repository/STM32Cube_FW_C0_V1.0.1/Drivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/main.d" -Wa,-a,-ad,-alms=build/main.lst Core/Src/main.c -o build/main.o
2023-03-15 02:31 AM
For CI integration you could very well use the CubeIDE in "headless" mode and save all the self-inflicted wounds.
Please check the command line from Cube-generated eclipse project, make sure that all relevant options are present in your makefile. Looks like some -m option is missing.
If the problem persists, use one or ARM or (STM32) toolchains available from CubeIDE toolchain manager, these support STM32C0 for sure. Recently ST also released a command line toolset.
2023-03-15 02:59 AM
Generally you do not want to use a vendor IDE as CI tool; make and the arm-gnu tools should be enough.
If a flag is missing that still means that CubeMX is not generating a correct Makefile which is a bug.
I will switch back to CubeIDE project for now anyhow but do not have the time (right now, anymore) to deep dive into the eclipse calls, that has to come later.
2023-03-15 03:10 AM
-mcpu=cortex-m0plus
> CubeMX is not generating a correct Makefile which is a bug
Yes, this was already reported IIRC.
2023-03-15 04:16 AM
Thank you, I did not know that.
I changed MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
to MCU = -mcpu=cortex-m0plus
in the Makefile and that did the trick.
FYI: building with arm-gnu\12.2-rel1 throws the following 4 errors:
closer.c:(.text._close_r+0xc): warning: _close is not implemented and will always fail
lseekr.c:(.text._lseek_r+0x10): warning: _lseek is not implemented and will always fail
readr.c:(.text._read_r+0x10): warning: _read is not implemented and will always fail
writer.c:(.text._write_r+0x10): warning: _write is not implemented and will always fail
using the st32cube plugin version works fine, so I will go with that one for now.
Thank you for the help and hope CubeMX gets fixed soon and gnu gets support for the above 4 issues as well.