Showing results for 
Search instead for 
Did you mean: 

Building Error from imported STM32CubeMX project

Jannis Wollert
Posted on May 21, 2018 at 14:34

Hey Folks, i got the following problem: I made a project with STM32CubeMX and imported it into ST4STM32/OpenSTM32. There i converted it via right-click to a c++ project. I specified the model in stm32l4xx.h, changed _Error_Handler(




); to _Error_Handler((char *)




); in main.c and renamed it to main.cpp to get rid of the few errors. When i build debug for the project everythings fine and i get no errors but when i try to build the release i get the following error: (my board is the Nucleo L432KC)

And thanks for your help!

Building target: robot_firmware.elf

Invoking: MCU G++ Linker

arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -specs=nosys.specs -specs=nano.specs -T'../STM32L432KCUx_FLASH.ld' -Wl, -Wl,--gc-sections -fno-exceptions -fno-rtti  -specs=nosys.specs -specs=nano.specs -o 'robot_firmware.elf' @'objects.list'   -lm

arm-none-eabi-g++: fatal error: c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.15.0.201708311556/tools/compiler/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/nosys.specs: attempt to rename spec 'link_gcc_c_sequence' to already defined spec 'nosys_link_gcc_c_sequence'

compilation terminated.

makefile:50: recipe for target 'robot_firmware.elf' failed

make: *** [robot_firmware.elf] Error 1

make: Target 'all' not remade because of errors.

#build-error #nucleo #eclipse #nucleo-l432kc
Jannis Wollert
Posted on May 21, 2018 at 17:45

Alright I found a solution.

If you experience the same error then try this:

Right click on project folder -> Properties -> C/C++ Build - Settings -> on the right: MCU G++ Linker - Miscellaneous -> remove -specs=nosys.specs -specs=nano.specs from the Linker flags

now everything works fine, no errors and program runs.