How to customize a STM32CubeIDE code generator for my board?
It's been quite a while since I started to work on various MCUs with STM32CubeIDE.
As it was quite magical at the start, now I roughly understand how a project is configured, especially what files are needed for what, where are they located, how they are compiled, linked and downloaded to the device.
What I don't know and I'm very curious about almost from the start is: how the IDE knows how to configure the files in the project, what include directories does it need, how to perform actual code generation by setting macros depending on the settings made in IOC file.
I'm interested in it because of it just fails miserably very, very often. The parts that commonly fail are:
- link generation (links are not generated properly on configuration change)
- Include directories update (I change FreeRTOS CMSIS from V2 to V1, the include paths are still set to V2)
- Copying necessary firmware / middleware files (rarely I had to get them from GitHub and add manually).
When this happens, I got a special gift of `mx.scratch` file, a XML where I see what should I change manually in order for the project to work. Roughly.
Also, generated projects often have invalid paths (or links) to IOC file, debug configurations, external loaders and so on.
I learned to fix all those issues and it takes less and less time for me to do so, but well, the next time I change something in IOC or generate a new project - I repeat the same fixes over and over again. I wonder if I can get my hands on some configuration scripts to actually fix the issues permanently. Like to make my own modified code generation template that applies changes not only correctly, but let's say, even differently, I would gladly customize it to change the include directory order, change the directory structure and so on.
Where is this information located? Is it all in IOC file, or is it also somewhere else?