cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX project fails to build after project is re-named and configuration.ioc file changes

ola
Associate III

Hi @STTwo-32

Apologies to anyone that would have seen this topic elsewhere on the ST community forum. I was advice to create a new topic.

The first time I reported this bug I thought it was a red herring as I did not know how reproduce the bug at will so I recommended that the query was closed only to discover that the problem persisted.

Some additional information on the platform I am running

  1. Windows 11
  2. STM32WL55 nucleo board
  3. Using STM32CubeIDE for building
  4. STM32CubeMX Version 6.10.0
  5. STM32CubeIDE Version 1.14.0

So just to recap the reported bug here for your convenience.

If I create a project based on the SubGHz_Phy_Per project generated by the Example Selector using STM32CubeMX. A project is created which builds fine and can be programmed and even debugged.

See image below

ola_0-1701869197592.png

 

In the project explorer pane highlighted in blue you can see the default data structure that STM32CubeMX generated when the Example Selector option was used by default.

When the project is generated. I can edit the source files and build the project successfully.

The problem however arises when I renamed the project, which I want to be able to do in order to make the project name more relevant for our project. 

I can successfully rename the project by right clicking on the Project Name in the project explorer window and then rename. And after the renaming process I am still able to edit source files, build and debug without any issues.

The only issue now is that, any subsequent changes to the configuration file after renaming the project breaks the project. For example using the image above if I change the RCC configuration highlighted in blue, meaning change High Speed Clock(HSE) option from TCXO to Disable and immediately back to TXCO and save the configuration. After the project is regenerated then I get the following.

ola_1-1701869197594.png

 

In the Project Explorer two additional folders are added to the top level tree structure namely Core and SubGHz_Phy. There are other folders that are generated in the Middleware and the Utilities folder which is not in the initial generated project.

When I was previously trying to reproduce the problem I was not changing the project name which was why I could not reproduce the bug however when I first discovered the bug I had already changed the project name. 

Below are logs showing the issue.

 

 

C://devl/MyProj/Drivers/STM32WLxx_HAL_Driver/Src/stm32wlxx_hal_pwr_ex.c:632: multiple definition of `HAL_PWREx_EnableFlashPowerDown'; ./Drivers/STM32WLxx_HAL_Driver/Src/stm32wlxx_hal_pwr_ex.o:C:/devl/MyProj/STM32CubeIDE/Debug/../Drivers/STM32WLxx_HAL_Driver/Src/stm32wlxx_hal_pwr_ex.c:632: first defined here
C:/ST/STM32CubeIDE_1.14.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Drivers/STM32WLxx_HAL_Driver/stm32wlxx_hal_pwr_ex.o: in function `HAL_PWREx_DisableFlashPowerDown':
C:/ST/STM32CubeIDE_1.14.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Utilities/timer/stm32_timer.o: in function `UTIL_TIMER_Start':
C:/devl/MyProj/STM32CubeIDE/Debug/../Utilities/timer/stm32_timer.c:150: multiple definition of `UTIL_TIMER_Start'; ./Utilities/stm32_timer.o:C://devl/MyProj/Utilities/timer/stm32_timer.c:150: first defined here
C:/ST/STM32CubeIDE_1.14.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Utilities/timer/stm32_timer.o: in function `UTIL_TIMER_StartWithPeriod':
C:/devl/MyProj/STM32CubeIDE/Debug/../Utilities/timer/stm32_timer.c:203: multiple definition of `UTIL_TIMER_StartWithPeriod'; ./Utilities/stm32_timer.o:C://devl/MyProj/Utilities/timer/stm32_timer.c:203: first defined here
C:/ST/STM32CubeIDE_1.14.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Utilities/timer/stm32_timer.o: in function `UTIL_TIMER_SetPeriod':
C:/devl/MyProj/STM32CubeIDE/Debug/../Utilities/timer/stm32_timer.c:289: multiple definition of `UTIL_TIMER_SetPeriod'; ./Utilities/stm32_timer.o:C://devl/MyProj/Utilities/timer/stm32_timer.c:289: first defined here
C:/ST/STM32CubeIDE_1.14.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Utilities/timer/stm32_timer.o: in function `UTIL_TIMER_IRQ_Handler':
C:/devl/MyProj/STM32CubeIDE/Debug/../Utilities/timer/stm32_timer.c:366: multiple definition of `UTIL_TIMER_IRQ_Handler'; ./Utilities/stm32_timer.o:C://devl/MyProj/Utilities/timer/stm32_timer.c:366: first defined here
C:/ST/STM32CubeIDE_1.14.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Utilities/trace/adv_trace/stm32_adv_trace.o: in function `UTIL_ADV_TRACE_Init':

/* Code trauncated for 20000 limit *

C:/devl/MyProj/STM32CubeIDE/Debug/../Utilities/trace/adv_trace/stm32_adv_trace.c:394: multiple definition of `UTIL_ADV_TRACE_COND_Send'; ./Utilities/stm32_adv_trace.o:C://devl/MyProj/Utilities/trace/adv_trace/stm32_adv_trace.c:394: first defined here
C:/ST/STM32CubeIDE_1.14.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Utilities/trace/adv_trace/stm32_adv_trace.o: in function `UTIL_ADV_TRACE_Send':
C:/devl/MyProj/STM32CubeIDE/Debug/../Utilities/trace/adv_trace/stm32_adv_trace.c:449: multiple definition of `UTIL_ADV_TRACE_Send'; ./Utilities/stm32_adv_trace.o:C://devl/MyProj/Utilities/trace/adv_trace/stm32_adv_trace.c:449: first defined here
C:/ST/STM32CubeIDE_1.14.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld.exe: ./Utilities/trace/adv_trace/stm32_adv_trace.o: in function `UTIL_ADV_TRACE_FSend':
C:/devl/MyProj/STM32CubeIDE/Debug/../Utilities/trace/adv_trace/stm32_adv_trace.c:296: multiple definition of `UTIL_ADV_TRACE_FSend'; ./Utilities/stm32_adv_trace.o:C://devl/MyProj/Utilities/trace/adv_trace/stm32_adv_trace.c:296: first defined here
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:80: MyProj.elf] Error 1
"make -j20 all" terminated with exit code 2. Build might be incomplete.

10:13:19 Build Failed. 601 errors, 0 warnings. (took 3s.174ms)

 

2 REPLIES 2
STTwo-32
ST Employee

Hello @ola 

Please make sure to configure the include paths and check the path of the .o files . Maybe that object files were not in the include folder list. Also, i suggest you To set the builder option to "internal builder" and use -L to specify your (add) library paths. Otherwise, please share your .ioc file so we can reproduce the issue.

Best Regards.

STTwo-32 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello STTwo-32,

I am not sure what you mean by i suggest you to set the builder option to internal builder can you please elaborate more. I can not find where to do this. In terms of the include paths, this should not have changed. All I do is rename the project so everything should remain the same. I am not creating or using any libraries files so I can not see why I would need to specify path lib file path using -L option.

I have attached both the *.ioc file and the .cproject file.