STM32CubeMX project fails to build after project is re-named and configuration.ioc file changes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-06 5:47 AM - edited ‎2023-12-06 5:50 AM
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
- Windows 11
- STM32WL55 nucleo board
- Using STM32CubeIDE for building
- STM32CubeMX Version 6.10.0
- 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
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.
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)
- Labels:
-
STM32CubeMX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-07 1:37 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-10 12:18 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-05 8:05 AM
Is there any update on this? I have a similar issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-05 8:59 AM
I mean no , because is OK. Renaming IDE Eclipse project dont rename MX ioc and this cant be used after rename .
I use two methods 1. rename only folder 2. when rename project update manualy ioc in editor...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-05 3:53 PM
Hi grway,
Yes I did get it to work back when I had the problem. I just found some notes that I took at the time. Following the taken notes I have just been able create a led blinky project named LEDBlinky in STM32CubeIDE and rename the project to MyLedBlinky, I also changed the .ioc file, built the project and it all seems to work fine so below are the steps that I followed.
- Using file explorer navigate to where your project is located and find the .cproject, .project and LEDBlinky.ioc file
- Using an editor such as Notepad++ open each file and replace the project name globally for example if my project was initially named LEDBlinky do a search and replace all occurrences of this name for example rename to my MyLedBlinky
- Rename your project directory as well to new name for example /path/to/dir/LEDBlinky to /path/to/dir/MyLedBlinky
- Rename the LEDBlinky.ioc to MyLedBlinky.ioc
- Open your .MyLedBlinky.ioc file using STM32CubeMX and make changes to your MyLedBlinky.ioc file as required. (Make sure you don't try and edit file with STM32CubeIDE)
- Save the MyLedBlinky.ioc file and close STM32CubeMX
- Now open the project using STM32CubeIDE by going to main menu and selecting "Open Projects from File System"
- Navigate to the renamed directory and open the project. It should now build.
I hope this helps.
Ola
