Showing results for 
Search instead for 
Did you mean: 

CubeMX, reports, .ioc file format, diff / tooling

Associate III

a) looking at UM1718 Rev 41 (July 2023) "11.4 Generating the report" there should be a button in the "Project Manager" Tab to start a export. I don't remember seeing it before and in "STM32CubeMX - STM32 Device Configuration Tool Version: 6.9.0-RC9 Build: 20230705-1724 (UTC)" in updatetd CubeIDE and "STM32CubeMX Version 6.9.0" separate install, both Windows I don't see the button.

b) is there some Documentation for the ioc format or even better a ioc parser. my impression is that there are numberings in ioc files that depend on editing order -> makes it hard to diff

c1) is there a a diff tool for ioc files?
c2) is there a tool that writes a ioc file in canonical form - would allow diff with standard tools





Ghofrane GSOURI
ST Employee

Hello @_richard 

First let me thank you for posting.

In order to generate a report you need to follow those steps:

-Select File then click on Generate report 





Associate III

I use a custom git diff driver with a simple textconv script for better diffs.

It does the following:

  1. Sort the file using a version sort - for the most part the file is already sorted, but it uses a simple sort (0, 1, 10, 11, ..., 19, 2, 20) that results in the order of the Mcu.IPX and MCU.PinX entries changing when one gets added.
  2. Remove the number from the Mcu.IPX and MCU.PinX entries so they don't all change when you turn on a new pin/module.
  3. Put each comma separated IPParameters\GPIOParameters\RequestParameters value on its own line and sort them
  4. Put each comma separated ProjectManager.functionlistsort value on its own line

Note that the output is no longer a valid IOC file. It's for generating diffs only.

User .gitconfig: 

[diff "cubemx"]
textconv =

Repo .gitattributes:

*.ioc diff=cubemx

sort --version-sort $1 | gawk '
/^Mcu\.IP[0-9]+=/ { sub(/^Mcu\.IP[0-9]+=/, "Mcu.IP="); print; next }
/^Mcu\.Pin[0-9]+=/ { sub(/^Mcu\.Pin[0-9]+=/, "Mcu.Pin="); print; next }
/\.(IP|Request|GPIO)Parameters=/ {
eq = index($0, "=");
print substr($0, 1, eq);
split(substr($0, eq + 1), values, ",");
for (i in values) print "\t" values[i];
next }
/^ProjectManager\.functionlistsort=/ {
eq = index($0, "=");
print substr($0, 1, eq);
split(substr($0, eq + 1), values, ",");
for (i in values) print "\t" values[i];
next; }
{ print }


this looks really interesting, i will try it for linux environment.
for windows environment this probably needs some additional installs. 

Hi Ghofrane,

thanks for the hint. i can confirm that for cubemx 6.9.1 the menu entry exists.

that menu entry is not accesible in cubeide as far as i see -> reports only from cubemx.

anyway that should be 

- either documented correctly in the manual

- or reverted back to the documented state where the report should be accesible also from cubeide with intgrated cubemx 

i will have a look how good the reports are usable for comparing configurations

do you have an idea how these report can be generated in a scripted way?


Associate II

This is very helpful for git diffs.

I was wandering if there is any info about the format of a .ioc file with some list of parameter names.
It would be useful to build up a 3 way diff/merge tool.
The reason is to migrate projects to different MCUs even if they are not in the compatibility list of MX tool.
Or maybe Is the wrong place to ask or start a new topic