cancel
Showing results for 
Search instead for 
Did you mean: 

OpenSTLinux: git approach to storing cubemx and generated code and device trees

MScor.1
Associate II

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.

  1. 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
  2. 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

 

1 ACCEPTED SOLUTION

Accepted Solutions
ArnaudTiberghien
ST Employee

Hello @MScor.1,

 

If you haven't solved your issue yet, I would suggest you to create a new layer at the same level as meta-st-stm32mp-addons by following:
https://wiki.st.com/stm32mpu/wiki/How_to_create_a_new_open_embedded_layer

Next, you can add your custom machine inside the <custom-layer>/conf/machine/
The envsetup.sh script will search for any machine described in /layers/meta-st and will find yours.

Let me know if this answer meets your requirements.

Best Regards,

 

Arnaud

 

In order 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.

View solution in original post

4 REPLIES 4
ArnaudTiberghien
ST Employee

Hello @MScor.1,

 

If you haven't solved your issue yet, I would suggest you to create a new layer at the same level as meta-st-stm32mp-addons by following:
https://wiki.st.com/stm32mpu/wiki/How_to_create_a_new_open_embedded_layer

Next, you can add your custom machine inside the <custom-layer>/conf/machine/
The envsetup.sh script will search for any machine described in /layers/meta-st and will find yours.

Let me know if this answer meets your requirements.

Best Regards,

 

Arnaud

 

In order 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.

Hello Arnaud,

 

Thank you for the suggestion, I didn't realise the script would look into sibling layers, I will try that and get back to you!

MScor.1
Associate II

It seems to be working (I am running a full clean build now, but it did recognise my custom machine).

Thank you!

Can I suggest that this is somehow added to the wiki documentation (e.g. here)? The current version of the page assumes that you will put your machine in the addons layer, which is not what most people would want, because it doesn't work with revision control.

Small correction: I wrote before that the solution works. It does, unless you create a build from scratch by sourcing meta-st/scripts/envsetup.sh.

If you do that, the layer where your machine is defined will be added to your bblayers.conf instead of meta-st-stm32mp-addons, breaking the build.

Looking at envsetup.sh, it seems that a good workaround is to add meta-st-stm32mp-addons to the #@NEEDED_BSPLAYERS line in the machine conf, like this:

 
#@NEEDED_BSPLAYERS: layers/meta-openembedded/meta-oe layers/meta-openembedded/meta-python layers/meta-st/meta-st-stm32mp-addons