cancel
Showing results for 
Search instead for 
Did you mean: 

Support relative paths in IOC file

Armandas
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
Ghofrane GSOURI
ST Employee

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

View solution in original post

9 REPLIES 9
victagayun
Senior III

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.

Do you use custom templates? If not, then there are no paths in the IOC and no problem.

Pavel A.
Evangelist III

What if you change the paths to relative in the ioc file manually?

I tried the following, but then the file is not generated anymore...

ProjectManager.TemplateDestinationPath=my_project_name
ProjectManager.TemplateSourcePath=..\\tools\\cubemx-templates

lospaul
Associate II

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?

ToddB1
Associate II

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.

@ToddB1 Paths in .cproject are a different issue, not related to .ioc and templates. Please start a new thread.

ToddB1
Associate II

Same root cause. I need STM32CubeMX to have relative paths to solve my problem. Until then I will use the workaround I described.

Ghofrane GSOURI
ST Employee

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