2024-09-26 09:08 PM
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:
Solved! Go to Solution.
2024-09-27 08:26 PM - edited 2024-09-27 08:27 PM
I created an empty project in STM32CubeIDE and compared the files from VS Code. There is a difference in the stm32g474retx_FLASH.ld file, a missing word in the VS Code version, at line 170: FLASH.
I copied this line into the VS Code and now the code does compile.
The output from each build is different thou, STM32 outputs:
text data bss dec hex filename
732 0 1568 2300 8fc firmware.elf
And VS Code outputs:
[build] text data bss dec hex filename
[build] 936 4 1972 2912 b60 D:/Projects/tmp/firmware-vscode/build/debug/firmware2.elf
Despite having the same source code and in debug. There might be some different settings somewhere but I guess this is not too important, something to look at another day.
2024-09-27 08:26 PM - edited 2024-09-27 08:27 PM
I created an empty project in STM32CubeIDE and compared the files from VS Code. There is a difference in the stm32g474retx_FLASH.ld file, a missing word in the VS Code version, at line 170: FLASH.
I copied this line into the VS Code and now the code does compile.
The output from each build is different thou, STM32 outputs:
text data bss dec hex filename
732 0 1568 2300 8fc firmware.elf
And VS Code outputs:
[build] text data bss dec hex filename
[build] 936 4 1972 2912 b60 D:/Projects/tmp/firmware-vscode/build/debug/firmware2.elf
Despite having the same source code and in debug. There might be some different settings somewhere but I guess this is not too important, something to look at another day.
2024-11-05 05:45 AM
Thanks, you probably saved me a day or two of head scratching!