cancel
Showing results for 
Search instead for 
Did you mean: 

Why does the content of the "ioc" file change so dramatically when project is loaded on another computer?

Sid Price
Senior

I am working on a project with a client, we use git for revision control and we have a private, shared, online repository for the project. When the client pulls the latest project, opens the "ioc" file in CubeMX, and regenerates the project, he sees the "ioc" file has many changes.

Examination of his file and the original shows that the actual data looks to be the same in both files, however, the order in which the data appears is very different. On the most recent pull and generate he reported over 300 "changes" in the file.

Why is this happening and how can we avoid it? Seeing the project file marked as changing so much may be benign, however, especially for the client it is disturbing.

Sid

1 ACCEPTED SOLUTION

Accepted Solutions
Sid Price
Senior

I have discovered that my client had opened the CubeMX project using STM32CubeIDE and generated the code from there. Since the project should be generated for a Makefile and STM32CubeIDE only generates a "native" project, I believe this was the root cause of the issues. Even when the client opened the project in STM32CubeMX and generated the project, they did not notice that STM32CubeIDE had changed to output project type.

This issue can be closed, and thank you for your help and patience.

Regards,

Sid

View solution in original post

4 REPLIES 4
Peter BENSCH
ST Employee

The IOC file structure is usually only be used by STM32CubeMX (stand-alone one and integrated one in STM32CubeIDE), which is also visible in the first line of its content:

#MicroXplorer Configuration settings - do not modify

For comparison purposes, however you might sort its content alphabetically, e.g on Windows using sort xyz.ioc >xyz_sorted.ioc.

Best regards,

/Peter

In order 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.
Sid Price
Senior

Thank you for the prompt reply.

  1. I understand the usage and applicability of the file, that was not the question.
  2. Why does CubeMX rewrite the file in a different order?
  3. I am not comparing it by hand or editing it, this situation arises when the projects are under Source Code Management (SCM), in this case Git. The SCM shows hundreds of changes on a file when in reality the data content has not been changed, it is simply totally re-ordered.
  4. Finally, as as happened with this project, when a pull request is made and the content of the "ioc" file is apparently so different, the SCM tool is unable to resolve automatically merge the "new" and "old" files and then the user must manually merge two files whose data content is the same. One cannot assume that the new file does not have real changes and discard it.

This to me appears to be either a poor design choice, or a bug in the "ioc" file handling in CubeMX.

Regards,

Sid

Peter BENSCH
ST Employee

After double-checking on even very old IOC files we found that the IOC file already is alphabetically sorted.

Please let us know, which tools of which version is creating another order of the IOC.

Regards,

/Peter

In order 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.
Sid Price
Senior

I have discovered that my client had opened the CubeMX project using STM32CubeIDE and generated the code from there. Since the project should be generated for a Makefile and STM32CubeIDE only generates a "native" project, I believe this was the root cause of the issues. Even when the client opened the project in STM32CubeMX and generated the project, they did not notice that STM32CubeIDE had changed to output project type.

This issue can be closed, and thank you for your help and patience.

Regards,

Sid