TL;DR: is there an "ST approved" method to put have a custom machine's CubeMX project AND generated code under source control?
I am trying to do something similar to OP's goal in this post, which didn't receive a full response, I think.
I have also gone through the "create your own machine" guide and I managed to generate a custom machine, except a couple of snags (e.g. CubeMX 6.12 adds a CA7/ element to the generated device tree path, which the guide seems to ignore, I guess it's out of date?).
Now, this work needs to go to source control somehow, and the guide doesn't provide any guidance on how to do that.
- One option would be to fork meta-st-stm32mp-addons, point your manifest to your fork and store your work there. This has a minor drawback (the need to keep your fork up-to-date with the official meta-st-stm32mp-addons), but also it seems to be explicitly discouraged by the meta-st-stm32mp-addons repo, since it puts the mx folder in .gitignore
- Another option, which would be more "yocto-like" is to have a separate layer that overlays on top of meta-st-stm32mp-addons. Your manifest would always point to the original, ST-provided meta-st-stm32mp-addons, and also point to your own "meta-custom-machine" layer. I am not sure how to go about that, though, because I am not sure about the assumptions that envseup.sh (and more generally, the build system) makes about where machines are defined, where devicetrees are found, etc etc