Skip to main content
Visitor II
August 28, 2025
Solved

CubeMX generated code for VSCode of STM32_WPAN STM32WBA54 get multiple definition error.

  • August 28, 2025
  • 1 reply
  • 322 views

Detail: I use CubeMX to create a CMake project and edit it in VSCode. My target MCU is STM32WBA54KGUx. I configured the STM32_WPAN, then clicked generate code. In VSCode, when I clicked the "build" button (or run task "Cmake: clean rebuild"), the build command returned an error of multiple definition. It turned out, the gcc build command linked two same file named "stm32wbaxx_ResetHandler_GCC.s.obj". Further investigation revealed that the "stm32wbaxx_ResetHandler_GCC.s" file located in /Projects/Common/WPAN/Startup/ is built twice:

[build] [15/89] Building ASM object CMakeFiles/wba54_test.dir/Projects/Common/WPAN/Startup/stm32wbaxx_ResetHandler_GCC.s.obj

[build] [81/89] Building ASM object cmake/stm32cubemx/CMakeFiles/Startup.dir/__/__/Projects/Common/WPAN/Startup/stm32wbaxx_ResetHandler_GCC.s.obj

Temporary Fix: Go to /cmake/stm32cubemx/CMakeLists.txt and comment out the "Startup" in the "# Project static libraries" section (around line 178). But CubeMX will overwrite it anyway when re-generate code, so this is not a real fix.

CubeMX version: 6.15.0

STM32 firmware version: STM32Cube_FW_WBA_V1.7.0

 

 

 

 

Best answer by STTwo-32

Hello @trungng and welcome to the ST Community.

This behavior has been escalated internally (under internal ticket number 216535).

Best Regards.

STTwo-32

1 reply

STTwo-32
STTwo-32Best answer
Technical Moderator
August 29, 2025

Hello @trungng and welcome to the ST Community.

This behavior has been escalated internally (under internal ticket number 216535).

Best Regards.

STTwo-32