cancel
Showing results for 
Search instead for 
Did you mean: 

Importing a new .ioc in an existing project

AJone.5
Associate II

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?

8 REPLIES 8
Pavel A.
Evangelist III

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

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?

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

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.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

LCE
Principal

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.

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?

ChahinezC
Lead

Hello @AJone.5​,

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

Thank you.

Chahinez.

Pavel A.
Evangelist III

> 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).