cancel
Showing results for 
Search instead for 
Did you mean: 

CubeIDE issue with Github and inability to change controller type

Rob Ashworth
Senior

The inability to change the microcontroller in CubeIDE is causing me some real problems.

This was my scenario:

Needed to change the controller from a H5 family to U5.

Couldn't see a way of changing this CubeIDE, so had to start a new project.

This then meant I had to push this to gihub and break all of the dependancies and loosing all traceability/H5 versions.

Does anyone else have experience of this or if there is a sensible workaround?  I'll admit my. Github knowledge isn't but I could't see a way other than starting again, but the obvious solution is the ST make it possible to change the controller type within the project.

5 REPLIES 5
CsBe
Associate III

The workaround ist to edit all project files (and ioc file) with text editor (replace mcu type) and regenerate the project.

Or create a new empty project with CubeMX and import the settings from the old ioc file, then copy all user files and code.

I have done it few times... and it worked fine.

The ioc files are hard to merge using version control. Even with the same MCU type.
The best way I found was to create a new STM32CubeMX project, do a side by side comparison of the source files and ioc files using a difftool such as DiffMerge or WinMerge and then edit the STM32CubeMX project until the source files and ioc are most similar. One thing that is annoying is that the order in which you initialize the peripherals can affect numbering in the ioc file. You can reorder the initialization order. I recommend against editing the ioc file by hand.

The .cproject file is even harder to merge. I would not even try that. Just repeat the modifications you made to the build settings to the new project.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

Thanks, I have done that a couple of times too with usual success.  Next time I have to do it I will see if I can write down the procedure!

I had forgotten about the .ioc file...Because I have created the project in CubeIDE not CubeMX, I have made this a little harder to sort out.  I will try a dummy project later to see how it works out, but probably do all of the MCU reference changes with simple search and replace, and then create the .ioc file separate and copy over.

 

Obviously this would be a lot easier if ST had the ability to modify the MCU type when the .ioc file is open.

Pavel A.
Evangelist III

 break all of the dependancies and loosing all traceability/H5

While it's true that .ioc files are not friendly to version control and cannot be diffed/merged easily, you can create a branch of your existing project. In the new branch you will replace the .ioc and then you will merge or cherrypick changes made in one branch to another.