2025-09-24 11:41 PM
Dear ST,
This has been reported in other posts before, but I would like to make a clear suggestion.
The problem is that IOC file changes are hard to merge in Git (or in other SCM) with diff tools because:
Therefore I make a suggestion to switch over to a file format that is still human readable, has a hierarchical structure and is source code tools friendly. It would be even better if it is based on some existing widespread format so developers can build their own development tools to parse or create IOC and use it as a SSOT (single source of truth) or as an output from other SSOT system.
Two such standards come to my mind: YAML and JSON.
I wouldn't recommend XML because of tedious end tags and high risk of breaking the syntax with diff tools. Linux (and Zephyr) devicetree would be interesting, but it is a bit hard to imagine how it fits in.
A smooth transition by supporting old and new file types loading and having option to choose save format would be great.
One final idea:
Add (future) support for hardware variants and versions. Sometimes in projects the goal is to have a single firmware that runs on slightly different PCBs and sometimes during the product lifetime PCB changes are made that place stuff to other MCU pins. In that case, in the very early start-up phase firmware must detect hardware variant and version and pick the right configuration. It is not just about file format, but picking the right file format and its structure is important to make it work. (At least some) AUTOSAR Classic MCAL tools have this feature.
2025-09-25 1:04 AM
Hello @mkrk
Thank you very much for your suggestion. However, changing the IOC file format in CubeMX is a complex undertaking that would require substantial engineering effort and resources. STMicroelectronics has invested heavily over many years in developing, maintaining, and supporting the current format, which is deeply integrated into our tools and ecosystem. Transitioning to a new format would involve extensive redevelopment and testing, and could potentially disrupt existing projects and workflows for a large user base.
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.
2025-09-25 8:03 PM
As a small remedy - you can sort the lines before committing. Reordering lines seems to be allowed.
2025-09-26 12:04 AM
> I wouldn't recommend XML because of tedious end tags and high risk of breaking the syntax with diff tools.
What risk?
JW
2025-09-26 5:40 AM
Hello @Ghofrane GSOURI
Thanks for at least thinking along. I know it's not easy to change it after all these years. But software is always evolving. For example you're now on VSCode (I haven't yet tried), which is based a lot on JSON. So maybe one day you take next big step and check what community has to say about these matters.
2025-09-26 5:54 AM
It is from my personal experience that when merging tools projects files in XML format (e.g. Eclipse project file) you need to be extra careful of checking if it is a single tag or has start and end tag and not forgetting the end tag. Indentation helps of course. Depending on the node type there are triple or quadruple amount of symbols < > and / to look after. JSON has double: { } or " ". YAML has one: colon. When 3-way merge tool view is full of conflicts, I have made syntax mistakes with XML. Code editors highlight syntax error, but I haven't seen merge tools do that. XML also has attributes, which can place a lot of data on a single line, which means they need to be manually merged and it increases the chance of getting merge conflict.
2025-09-26 7:24 AM
> 3-way merge
Okay; I understood your comment in the way that diff as such has some fundamental problem with XML.
Three-way merging is never trivial. IMO, dedicated tools could be developed for structured documents, if needed.
Thanks for the explanation, though. I was asking on a general note, I am not interested in Cube and kin. Sorry for the off-topic.
JW