2022-08-03 09:49 PM
I fully appreciate that CubeMX is geared towards hobbyists and demo projects.
But let's imagine for a second that someone is trying to use this software professionally.
I have created a template to generate some custom code with CubeMX and it works as expected. However, in the IOC file my settings are stored as shown below:
ProjectManager.TemplateDestinationPath=C\:\\path\\to\\my\\project\\cubemx\\my_project_name
ProjectManager.TemplateSourcePath=C\:\\path\\to\\my\\project\\tools\\cubemx-templates
Now imagine someone else is working on this project. Maybe they have checked out the code to a different directory, or maybe they are using Linux. The IOC file is broken for them. If they fix it on their side and commit it, it will be broken for me.
Please add support for setting these paths relative to the IOC file itself, so that multiple people can work on the project.
By the way, I tried editing the file manually and setting a relative path, but then the file is no longer generated.
I am using CubeMX version 6.6.1
Solved! Go to Solution.
2023-08-03 02:17 AM
Hello @Armandas
First let me thank you for posting.
Your suggestion is raised to dev team for review.
Internal ticket number: 158696(This is an internal tracking number and is not accessible or usable by customers).
I will keep you posted with updates.
Thx
Ghofrane
2022-08-03 10:34 PM
I am using Win10, it seems to work for me.
I generally upload the ioc file which is located at the root folder name in my workspace and the Core\Src files (keeping the folder structure) to github (assuming I did not edit Core\Inc files to be uploaded).
When I use another win10 machine, I download the project folder and save it to my workspace.
I import specifying the ioc.
From there I just flash it to the MCU.
2022-08-03 10:37 PM
Do you use custom templates? If not, then there are no paths in the IOC and no problem.
2022-08-04 03:49 AM
What if you change the paths to relative in the ioc file manually?
2022-08-04 04:02 PM
I tried the following, but then the file is not generated anymore...
ProjectManager.TemplateDestinationPath=my_project_name
ProjectManager.TemplateSourcePath=..\\tools\\cubemx-templates
2023-03-23 07:52 AM
We are facing the same problem and tried the same steps to solve it - without success.
This is really a pain in a distributed project with people checking out the projects in their workspace. It makes the template feature nearly unusable.
Has anybody found a solution in the meanwhile?
2023-08-01 06:40 AM
I'm having the same issue. I haven't been able to resolve this for the MX tool, but in the generated IDE project it's possible to hand modify the .cproject file to use relative paths. This way my IDE project will build with the correct files. Unfortunately, any time I modify my IOC project in the STM32CubeMX, I have to repeat this process.
It would be very helpful if ST modified this application to allow relative paths, similar to setting the $project_loc in the IDE.
2023-08-01 06:51 AM
@ToddB1 Paths in .cproject are a different issue, not related to .ioc and templates. Please start a new thread.
2023-08-01 07:52 AM
Same root cause. I need STM32CubeMX to have relative paths to solve my problem. Until then I will use the workaround I described.
2023-08-03 02:17 AM
Hello @Armandas
First let me thank you for posting.
Your suggestion is raised to dev team for review.
Internal ticket number: 158696(This is an internal tracking number and is not accessible or usable by customers).
I will keep you posted with updates.
Thx
Ghofrane