Skip to main content
Jim Seymour
Senior
June 27, 2019
Solved

Is there a workaround for importing an existing STMCubeMX .ioc file?

  • June 27, 2019
  • 8 replies
  • 7094 views

According to the "known issues" post, importing an existing .ioc file from STMCubeMX is currently unsupported.

I'm starting a new project and would like to use the IDE for this - but my engineer designed the product using CubeMX.

Is there any kind of workaround for this?

As I see it, my options are:

1) manually recreate his work

2) keep using the "old" tools (CubeMX & Keil compiler)

Not sure which would be "better".

Thanks.

This topic has been closed for replies.
Best answer by Herve PIERROT

you can also open your project with latest CubeMX and regenerate your project for STM32CubeIDE

8 replies

Pavel A.
June 28, 2019

It looks like your engineer is experienced and knows what he does. Perhaps, discuss this together and give him a chance to convince you.

Newer is not always better (unless creating the new tools is your job, of course =)

-- pa

Herve PIERROT
Herve PIERROTBest answer
ST Employee
June 28, 2019

you can also open your project with latest CubeMX and regenerate your project for STM32CubeIDE

Jim Seymour
Senior
June 28, 2019

Ah! Now we're getting somewhere... Are there instructions on how to do this somewhere?

Thanks.

Jim Seymour
Senior
June 28, 2019

Oh. That makes sense. I was flailing around in the "File" section looking for some kind of export...

Thanks!

Herve PIERROT
ST Employee
June 28, 2019

in original message, you said the project was created for Keil with STM32CubeMX. In the project setting in STM32CubeMX, you just need to change the target IDE from Keil to STM32CubeIDE.

Jim Seymour
Senior
July 2, 2019

I have discovered a workaround that seemed to work for me...

Here are the steps I followed:

  1. Create a new STM32 project in the IDE (using the Target Selector to select the proper MCU)
  2. Shut down STM32CubeIDE
  3. Go into the workspace folder and replace the newly-created .ioc file with the .ioc file created by STM32CubeMX
    1. You may need to rename the file to match the new project - and if so, you'll need to edit the .ioc file to change any references to the old project name to the new one.
  4. Restart STM32CubeIDE and double-click on the .ioc file. It now shows all the pin settings from the MX project!

So far, so good!

Dave Nadler
Senior III
July 3, 2019

Thanks Jim, beware that will not work in all cases (didn't work in my case, unfortunately).

Again Thanks,

Best Regards, Dave

Herve PIERROT
ST Employee
July 3, 2019

good to hear your unlock your case and thanks for sharing your solution.

Ayberk Özgür
Associate
November 12, 2019

@Herve PIERROT​ At the time of writing on my platform (Windows 10 with JRE 1.8.0_231 64-bit), the STM32CubeIDE generator in the standalone STM32CubeMX tool (5.4.0) does not generate the `.project` and `.cproject` files, preventing proper project import into STM32CubeIDE (1.1.0). It only generates the `.mxproject` file, which is not sufficient for import. This is a weird shortcoming from my perspective, as the following workaround is possible:

  1. Load the project containing only the `.ioc` file (no `.project`, `.cproject` or `.mxproject`) as a simple Eclipse project into STM32CubeIDE with the "Open Projects from File System" option
  2. Open the `.ioc` file within the IDE, using the MX perspective
  3. Generate code from the MX perspective, this does generate the `.project`, `.cproject` and `.mxproject` files; the project gets the correct natures at this point
  4. In the case of a C++ project, again go to the MX perspective, right click the project and "Convert to C++"
  5. Add missing source folders

@Jim Seymour​ No need to create a new project and replace `.ioc` files.

It's surprising as I would expect these two tools (standalone STM32CubeMX and STM32CubeIDE MX perspective) to use the same STM32CubeIDE generator backend. There are also some discrepancies between the generated HAL sources, pointing to the opposite.

Given this, and also that STM32CubeIDE seems to be sort of the "recommended" IDE by ST nowadays, I'm wondering whether the standalone STM32CubeMX will be phased out.

Alternatively, the below workaround also seems to work:

  1. Open the `.ioc` file with the standalone STM32CubeMX tool
  2. Generate code for SW4STM32 (TrueSTUDIO also works)
  3. From STM32CubeIDE, import the generated project with the dedicated SW4STM32 importer (or TrueSTUDIO importer); no further code generation from the integrated MX perspective should be necessary and the project should get correct natures already
  4. As usual, in the case of a C++ project, go to the MX perspective, right click the project and "Convert to C++"
  5. Add missing source folders

Herve PIERROT
ST Employee
November 12, 2019

sounds like you are facing a current known limitation that for the generation of the STM32CubeIDE files (.project and .cproject),

the name of the .ioc should be the same as the name of the folder that contain this .ioc.

This is the case if you create the project from scratch with STM32CubeMX, it generates both the folder and the .ioc file,

but probably not if you copy/paste your project in a different folder.

Then your case, the files are most probably generated, but in a folder one level above your project, and in a folder having the name of your .ioc file.

A fix should come in one of the coming releases...

Ayberk Özgür
Associate
November 12, 2019

I forgot to mention that the directory and `.ioc` names are exactly the same.

Herve PIERROT
ST Employee
November 29, 2019

we found that sometimes, an unexpected folder could be created that may lock the generation process. Could you please check if you have this folder :

<MX install path>/third_parties_plugins/binaries

If you have this "binaries" folder, then just delete it with all its content.

Robmar
Senior II
November 18, 2022

I just imported an IOC file into a project imported into CubeIDE, seemed to work, but it isn´t updating the files, though no error is reported.

Must be a fix for this by now?