2025-04-22 7:50 AM
I've got a project that has the following files in the tree view:
All is well if I clean and build, but if I open the .ioc and "Generate Code", the tree changes to:
and the project then fails to build due to a duplicate system_stm32g0xx.c file.
Why is this getting added and how do I stop it?
I am using STM32CubeIDE V1.18.1.
Solved! Go to Solution.
2025-04-23 4:18 AM
I have created a new workspace and recreated the project from the .ioc file, and it looks like everything is back to normal.
I guess that means something in the workspace's metadata was not valid?
2025-04-22 7:55 AM
Hello @CTapp.1
First let me thank you for posting.
Could you please provide your IOC.
I 'will be waiting for your feedback.
THX
Ghofrane
2025-04-22 7:59 AM
2025-04-22 8:35 AM
Hello @CTapp.1
I used your IOC to generate the code multiple times and each time the build finished without any errors or warnings, and your project architecture did not change.
Let's try to close STM32CubeIDE and STM32CubeMX and go under C:\Users\XXXXXX then delete .stm32cubeide and .stm32cubemx.
THX
Ghofrane
2025-04-22 9:07 AM
Thanks - I've tried that, but the results are the same.
2025-04-22 9:32 AM
I've just uninstalled and reinstalled CubeIDE (V.1.18.1), but that has also made no difference.
2025-04-23 12:15 AM
2025-04-23 12:51 AM - edited 2025-04-23 12:53 AM
The code is generated as expected when using the standalone MX 6.14.1 - the second system_stm32g0xx.c is not generated in the templates folder, and the code builds successfully.
Does this mean there is an issue with the integrated MX in IDE V1.18.1?
Edited to add:
When using the internal MX, an mx.scratch file is left in the project after code generation.
2025-04-23 2:35 AM
Hello @CTapp.1
Even with the integrated MX in IDE V1.18.1, everything is working correctly. After multiple generation of the code, the build finished with success. There were no changes in the structure of your project and no duplicate files.
It could be an issue related to your environment.
THX
Ghofrane
2025-04-23 2:38 AM
Ok, but how do I find out where the problem is so that I can fix it?