cancel
Showing results for 
Search instead for 
Did you mean: 

Can I share a CubeMX configuration .ioc between two projects (bootloader and app)?

Anguel
Senior

Hi,

I am developing a bootloader and an application for a device. Now I have two separate projects and I configure all pins using CubeMX twice. Each project has ist own .ioc file and it is very much work to synch all pins and other settings between the two projects, also because the CubeMX tool is very slow.

So I wonder if there is an elegant way to share a .ioc config between both projects without breaking things?

Thanks in advance,

Anguel

1 ACCEPTED SOLUTION

Accepted Solutions
Paul1
Lead

I'd try:

  • zip both projects as a safety backup.
  • Create the ioc in one project.
  • Open the ioc in mx, and save it as a different filename (name of second project), close mx,
  • Move the new ioc to desired folder for second project, open ioc file and generate code.
  • Repeat as needed when you modify ioc settings

I have a base ioc file that I use for many boards that share a common circuit that I do this way, then only have to modify the few different pins each time.

Paul

View solution in original post

4 REPLIES 4
Paul1
Lead

I'd try:

  • zip both projects as a safety backup.
  • Create the ioc in one project.
  • Open the ioc in mx, and save it as a different filename (name of second project), close mx,
  • Move the new ioc to desired folder for second project, open ioc file and generate code.
  • Repeat as needed when you modify ioc settings

I have a base ioc file that I use for many boards that share a common circuit that I do this way, then only have to modify the few different pins each time.

Paul

Hi @Community member​ ,

Thank you for the helpful answer! One question: You say open in MX, what do you mean by that? Do you mean somehow through CubeIDE or should I additionally install standalone CubeMX?

Now I also looked into the .ioc files and at first glance there seem to be only two parameters related to the specific project name:

ProjectManager.ProjectFileName=SOME_PROJECT.ioc

ProjectManager.ProjectName=SOME_PROJECT

So maybe changing these to to the other (already existing) project's name and then just copying the .ioc over the .ioc of the other project should also work (could use a batch script here that I run each time I make a change to the original .ioc). Or did I overlook something? What do you think?

Anguel

Paul1
Lead

I use the standalone STM32CubeMX to configure projects (not sure if any difference from MX in STM32CubeIDE).

I haven't tried editing the ioc file directly, I don't change the ioc often so using the MX to open/modify/save works fine for me.

(Careful if editing a generated file, as sometimes things like line ends, file ends, and special characters can be modified by the editor. Not saying don't do it, just saying be careful and test it well. We all have different skills and styles)

Anguel
Senior

Thanks fro the information . Now I use a search and replace command line utility and it seems to work fine. So no need to open the file in CubeMX for converting, only later for generating code for the second project.