I would like to add my own DTS(I) file(s) and use them in my Torizon build. I see that the DTB list is in KERNEL_DEVICETREE, in meta-toradex-nxp/conf/machine/apalis-imx8.conf. I don’t think overriding/apending to machine file is possible, so I added my own dts/dtsi files and DTB to KERNEL_DEVICETREE in my own linux-toradex_%.bbappend. It all seems to build okay - I can see the DTB files build from my dts files in the kernel build directory. My question now is how do I configure/force the build to use those files? Currently it seems to be using the Apalis Evaluation Board files (freescale/imx8qm-apalis-v1.1-eval.dtb). I can only see those files mentioned also in the machine file, in TORADEX_PRODUCT_IDS, but even when I change TORADEX_PRODUCT_IDS to my files the output image still uses the Evaluation Board files. In U-BOOT env also: ‘fdt_board=eval; fdtfile=imx8qm-apalis-v1.1-eval.dtb;’.
Thanks for posting on the community. Before we go further I’d like to ask you a question. Is there a reason for you to build the TorizonCore image using Yocto?
TorizonCore has the possibility to use the TorizonCore Builder and it’s able to deal with device tree compilation and selection as you can find here: TorizonCore Builder Tool - Commands Manual | Toradex Developer Center. We conceived TorizonCore Builder so that users wouldn’t need to go through Yocto for most of the needed tasks to create and maintain a custom image.
Hello @gclaudino.tx . I need a minimalistic image without containers and which is still fairly customized. Using Yocto image seems to be the most convenient solution.
The ‘hello-world examples’ document looks okay and I’m doing thing the same way. The only problem is that the last step in ‘Customize the Kernel’ doesn’t work/apply to Apalis IMX8.
If I adjust the ‘sed’ command from:
sed -i 's/#define FDT_FILE.*/#define FDT_FILE "my-custom-devicetree-file.dtb"/' ${S}/include/configs/colibri_imx6.h
to
sed -i 's/#define FDT_FILE.*/#define FDT_FILE "my-custom-devicetree-file.dtb"/' ${S}/include/configs/apalis-imx8.h
it’ll do nothing, because there is no FDT_FILE in apalis-imx8.h. There is no FDT_FILE in any of the Apalis IMX8-related files. Also there are no references to the current DTB file (imx8qm-apalis-v1.1-eval.dtb), so I have no idea where to look.
I’ll check this new substitution tomorrow. Meanwhile I have another question. In U-Boot console when I set some variable using setenv and the do saveenv the changed seem to disappear the next boot. How to make them persistent?
The variant variable is dependent on the module version. For instance, if you use a V1.1 module it will show V1.1 there. This is one variable that you wouldn’t be able to change. This is also needed as even though you may have more than one version of a single module, some components may vary between the versions and therefore, maintaining more than one device tree for all the devices to work would be necessary.
Please tell us if your test with the fdt_board change on Yocto worked