2023-03-08 12:58 PM
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?
2023-03-08 01:03 PM
You'll need to carefully merge the code generated from the new IOC to your existing project.
2023-03-08 01:08 PM
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?
2023-03-08 01:23 PM
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.
2023-03-09 12:28 AM
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.
2023-03-09 02:40 AM
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.
2023-03-09 08:29 AM
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?
2023-03-10 01:17 AM
Hello @AJone.5,
You can check the MCU1 to MCU2 migration option within STM32CubeIDE article, it might help you.
Thank you.
Chahinez.
2023-03-10 05:38 PM
> 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).