Skip to main content
_richard
Associate III
July 24, 2023
Question

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

  • July 24, 2023
  • 2 replies
  • 4272 views

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

 

 

 

 

This topic has been closed for replies.

2 replies

Ghofrane GSOURI
Technical Moderator
July 24, 2023

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 

GhofraneGSOURI_0-1690209929307.png

Thx

Ghofrane

 

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.
_richard
_richardAuthor
Associate III
August 13, 2023

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?

 

bb1
Explorer
July 25, 2023

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 = git_textconv_cubemx.sh

Repo .gitattributes:

*.ioc diff=cubemx

 git_textconv_cubemx.sh:

#!/bin/bash 
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, ",");
asort(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 }
'

 

_richard
_richardAuthor
Associate III
August 13, 2023

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