Build works in STM32Cube IDE fails in VSCode with STM32 plugin
Hi All,
I have a design that works in STM32CubeIDE but fails when building it with VScode+STM32 plug-in. The strange thing is that the design is working except for the UART TX DMA.
To narrow down the issue I created a small design with just the UART TX DMA function. I build the design in STM32CubeIDE and all was OK. I then took the STM32CubeIDE ioc file and created a new (cmake) design for VScode. I copied all the Core/Driver files and startup_stm32h743xx.s to the VSCode project and again the UART TX DMA was not working.
To make sure the above procedure worked I created the same design/procedure but used interrupts instead of DMA and in both STM32CubeIDE and VScode the code worked as expected.
The source files/drivers/startup/etc are all the same but the produced elf/map/hex files are different. Both STM32CubeIDE and VScode uses the same gcc version 12.3.1 and it looks like most of the gcc flags are the same:
VScode:
H:\ST\STM32CubeCLT_1.15.1\GNU-tools-for-STM32\bin\arm-none-eabi-gcc.exe -DDEBUG -DSTM32H743xx -DUSE_HAL_DRIVER -IH:/test/STM32/testnode/blink/cmake/stm32cubemx/../../Core/Inc -IH:/test/STM32/testnode/blink/cmake/stm32cubemx/../../Drivers/STM32H7xx_HAL_Driver/Inc -IH:/test/STM32/testnode/blink/cmake/stm32cubemx/../../Drivers/STM32H7xx_HAL_Driver/Inc/Legacy -IH:/test/STM32/testnode/blink/cmake/stm32cubemx/../../Drivers/CMSIS/Device/ST/STM32H7xx/Include -IH:/test/STM32/testnode/blink/cmake/stm32cubemx/../../Drivers/CMSIS/Include -mcpu=cortex-m7 -mfpu=fpv5-d16 -mfloat-abi=hard -Wall -Wextra -Wpedantic -fdata-sections -ffunction-sections -O0 -g3 -mcpu=cortex-m7 -mfpu=fpv5-d16 -mfloat-abi=hard -Wall -Wextra -Wpedantic -fdata-sections -ffunction-sections -O0 -g3 -g -std=gnu11 -MD -MT CMakeFiles/blink.dir/Core/Src/main.c.obj -MF CMakeFiles\blink.dir\Core\Src\main.c.obj.d -o CMakeFiles/blink.dir/Core/Src/main.c.obj -c H:/test/STM32/testnode/blink/Core/Src/main.c
STM32CubeIDE:
arm-none-eabi-gcc "../Core/Src/main.c" -mcpu=cortex-m7 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32H743xx -c -I../Core/Inc -I../Drivers/STM32H7xx_HAL_Driver/Inc -I../Drivers/STM32H7xx_HAL_Driver/Inc/Legacy -I../Drivers/CMSIS/Device/ST/STM32H7xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/main.d" -MT"Core/Src/main.o" --specs=nano.specs -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb -o "Core/Src/main.o"
Before I start digging deeper, does anybody have an idea what can make the same code fails in VScode but not in STM32CubeIDE?
Thanks,
Hans.
