PlatformIO building errors when compiling port.c


I’m trying to use PlatformIO with a STM32F723ZG and FreeRTOS.

When compiling port.c I get these errors:

/tmp/ccN7NtDU.s:330: Error: selected processor does not support vstmdbeq r0!,{s16-s31}' in Thumb mode /tmp/ccN7NtDU.s:332: Error: instruction not allowed in IT block -- stmdb r0!,{r4-r11,r14}’
/tmp/ccN7NtDU.s:352: Error: selected processor does not support vldmiaeq r0!,{s16-s31}' in Thumb mode /tmp/ccN7NtDU.s:354: Error: instruction not allowed in IT block -- msr psp,r0’
*** [.pio/build/env_nucleo_h723zg/src/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.o] Error 1

It seems that the MCU is not properly defined…
However I’m using -DSTM32H723xx in the build_flags of PlatformIO.ini.

Any help?

This my PlatformIO.ini file.

default_envs = env_nucleo_h723zg

check_tool = cppcheck
check_flags =
cppcheck: --std=c11 --inline-suppr --inconclusive -j4 --addon=…/…/scripts/misra/misra.json

platform = ststm32
board = nucleo_h723zg
framework = stm32cube
src_filter = +<*> -<.git/> - -
build_flags =
-I include
-I src
-I src/Core/Inc
-I src/Drivers/CMSIS/Include/
-I src/Drivers/CMSIS/Device/ST/STM32H7xx/Include/
-I src/Drivers/STM32H7xx_HAL_Driver/Inc/
-I src/Middlewares/Third_Party/FreeRTOS/Source/include/
-I src/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/
-I src/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/r0p1/
-I src/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/
upload_protocol = stlink
debug_tool = stlink
debug_init_break = tbreak main

Which compiler are you using? It should be present in your full logs.

It should be GCC for ARM.
At least I see

  • toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)

Then probably you are not passing flags to enable FPU. As mentioned in this post, you probably need to pass these flags - -mfpu=fpv4-sp-d16", "-mfloat-abi=hard.


Looks like you are trying to build floating point instructions but telling the compiler there is no floating point unit. Check your GCC command line matches the part you are targetting.

But still I have this:
/home/wsone/.platformio/packages/toolchain-gccarmnoneeabi/bin/…/lib/gcc/arm-none-eabi/7.2.1/…/…/…/…/arm-none-eabi/bin/ld: error: .pio/build/env_nucleo_h723zg/FrameworkHALDriver/Src/stm32h7xx_hal.o uses VFP register arguments, .pio/build/env_nucleo_h723zg/firmware.elf does not

Are the “VFP register arguments” still related with the Floating Point?
I’m trying to get rid of FrameworkHALDriver and use the HAL drivers provided by STM32CudeIDE but so far no success…

Now I have changed from
-mfloat-abi=hard to -mfloat-abi=softfp

and now it compiles. But is this correct? thanks.

Linking .pio/build/env_nucleo_h723zg/firmware.elf
Checking size .pio/build/env_nucleo_h723zg/firmware.elf
Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
RAM: [= ] 5.0% (used 22320 bytes from 442368 bytes)
Flash: [ ] 2.5% (used 25752 bytes from 1048576 bytes)
Building .pio/build/env_nucleo_h723zg/firmware.bin
[SUCCESS] Took 11.67 seconds =========================================================

I typed incorrectly - softfp is good.

Another bug bites the dust… :slight_smile: