Solved
Create empty project -> Does not compile
- September 27, 2024
- 1 reply
- 2121 views
I installed VS Code and the STM32 extension. Compiling a project imported from STM32CUBEMX works.
But creating an empty project from VS Code (target is: stm32g474retx) gives me this error when building:
[main] Building folder: D:/Projects/tmp/firmware2/build/debug
[build] Starting build
[proc] Executing command: C:\ST\STM32CubeCLT_1.16.0\CMake\bin\cmake.EXE --build D:/Projects/tmp/firmware2/build/debug --
[build] [1/1] Linking C executable firmware2.elf
[build] FAILED: firmware2.elf
[build] C:\Windows\system32\cmd.exe /C "cd . && C:\ST\STM32CubeCLT_1.16.0\GNU-tools-for-STM32\bin\arm-none-eabi-gcc.exe -fdata-sections -ffunction-sections -Wl,--gc-sections -g -TD:/Projects/tmp/firmware2/stm32g474retx_FLASH.ld -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -Wl,-Map=firmware2.map -u _printf_float --specs=nosys.specs -Wl,--start-group -lc -lm -lstdc++ -lsupc++ -Wl,--end-group -Wl,-z,max-page-size=8 -Wl,--print-memory-usage CMakeFiles/firmware2.dir/Src/main.c.obj CMakeFiles/firmware2.dir/Src/syscall.c.obj CMakeFiles/firmware2.dir/Src/sysmem.c.obj CMakeFiles/firmware2.dir/Startup/startup_stm32g474retx.s.obj -o firmware2.elf -LD:/Projects/tmp/firmware2/firmware2 && C:\Windows\system32\cmd.exe /C "cd /D D:\Projects\tmp\firmware2\build\debug && arm-none-eabi-size D:/Projects/tmp/firmware2/build/debug/firmware2.elf && arm-none-eabi-objcopy -O ihex D:/Projects/tmp/firmware2/build/debug/firmware2.elf firmware2.hex && arm-none-eabi-objcopy -O binary D:/Projects/tmp/firmware2/build/debug/firmware2.elf firmware2.bin""
[build] C:/ST/STM32CubeCLT_1.16.0/GNU-tools-for-STM32/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe:D:/Projects/tmp/firmware2/stm32g474retx_FLASH.ld:173: nonconstant expression for fill value
[build] collect2.exe: error: ld returned 1 exit status
[build] ninja: build stopped: subcommand failed.
[proc] The command: C:\ST\STM32CubeCLT_1.16.0\CMake\bin\cmake.EXE --build D:/Projects/tmp/firmware2/build/debug -- exited with code: 1
[driver] Build completed: 00:00:00.203
[build] Build finished with exit code 1
