Skip to main content
AJone.5
Associate II
March 8, 2023
Question

Importing a new .ioc in an existing project

  • March 8, 2023
  • 5 replies
  • 5521 views

We have a project that was working with a demo board with a different micro than our final project uses. We imported into CubeIDE an ioc generated by CubeMX by our hardware engineer. We did a bit of work on the project to include source from a variety of libraries and git submodules and get things just-so.

We now are switching to the final MCU, and he has generated a new .ioc. to fit it. As far as I can tell, we now need to remake our entire project with the new ioc? Is there a way to swap a new IOC into an existing project?

This topic has been closed for replies.

5 replies

Pavel A.
Super User
March 8, 2023

You'll need to carefully merge the code generated from the new IOC to your existing project.

AJone.5
AJone.5Author
Associate II
March 8, 2023

As in, keep ioc A in the project, make a new project for ioc B then generate code from B and swap that code into A?

Pavel A.
Super User
March 8, 2023

Yes, kind of. Generate code from IOC A, then generate code from IOC B, then find the differences and merge them into your real project.

Semer CHERNI
ST Employee
March 9, 2023

Hello @AJone.5​ 

Frist let me thank you for posting.

I want to highlight the import feature in CubeMx which allow you to import configuration to your new IOC file from an old one.

More details are in the CubeMx User Manual UM1718 Rev 40 paragraph 4.10 Import Project window.

The user manual could be found under this link.

BR,

Semer.

AJone.5
AJone.5Author
Associate II
March 9, 2023

Thank you for your response, The CubeMx instuctions do seem useful to create the 'B' ioc file including configuration changes made to the 'A' file that is imported. We will incude that in our workflow for any future MCU changes.

However I am unclear about how the B ioc file can be used in our existing STM32CubeIDE project for A. Can we delete the A ioc in the project and replace it with the B ioc and regenerate code? Other than checking for source that was incorrectly changed, Is it that simple?

Or is it too late, and we need to make a new project using the B ioc?

LCE
Principal II
March 9, 2023

Just make sure that you have a backup.

It's seems to occurr quite often that people kill their own sources with changes in CubeMX or HAL libs.

ChahinezC
Technical Moderator
March 10, 2023

Hello @AJone.5​,

You can check the MCU1 to MCU2 migration option within STM32CubeIDE article, it might help you.

Thank you.

Chahinez.

Pavel A.
Super User
March 11, 2023

> However I am unclear about how the B ioc file can be used in our existing STM32CubeIDE project for A.

Just copy B.ioc to a new directory and generate code there. So nothing is lost.

Then merge. After successful merge you can consider the project "based on" B.ioc.

​(this is why the standalone CubeMX is more flexible than CubeIDE).