Custom image 5.7.2 with overlay

I’m trying to create a new image with following specs:

  • based on 5.7.2
  • custom splash
  • overlay for cap-touch-7inch display (Toradex display)
  • isolated changes
  • own docker bundle
    The last image based on 5.3 and it seems that multiple things are different now.

My main issue is that I’m not able to deploy the correct overlay. I’m referring to this tutorial: TorizonCore Builder Tool - Customizing Torizon OS Images | Toradex Developer Center
As described, I cloned the 2 repositories:
git clone -b toradex_5.15-2.1.x-imx git://git.toradex.com/linux-toradex.git linux
git clone -b toradex_5.15-2.1.x-imx git://git.toradex.com/device-tree-overlays.git device-trees
Then I found the available device trees:
find linux -name “imx8qxp-colibri.dts”
Result:

linux/arch/arm64/boot/dts/freescale/imx8qxp-colibri-aster.dts
linux/arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dts
linux/arch/arm64/boot/dts/freescale/imx8qxp-colibri-iris-v2.dts
linux/arch/arm64/boot/dts/freescale/imx8qxp-colibri-iris.dts

What is the difference between those device trees? Is “iris-v2” the latest one?

Then I could list the available overlays:
*torizoncore-builder dto list --device-tree ./linux/arch/arm64/boot/dts/freescale/imx8qxp-colibri-iris-v2.dts *

Overlays compatible with device tree imx8qxp-colibri-iris-v2.dts:

  • device-trees/overlays/colibri-imx8x_dsihdmi_overlay.dts
  • device-trees/overlays/colibri-imx8x_ov5640_overlay.dts
  • device-trees/overlays/colibri-imx8x_panel-cap-touch-10inch-lvds_overlay.dts
  • device-trees/overlays/colibri-imx8x_panel-cap-touch-7inch_adapter_overlay.dts
  • device-trees/overlays/colibri-imx8x_panel-cap-touch-7inch_overlay.dts
  • device-trees/overlays/colibri-imx8x_panel-res-touch-7inch_overlay.dts
  • device-trees/overlays/colibri-imx8x_spidev_overlay.dts
  • device-trees/overlays/colibri-imx8x_vga-640x480_overlay.dts

Is there a overlay description with more details so I can decide, which one I really need?

I continued with device-trees/overlays/colibri-imx8x_panel-cap-touch-7inch_adapter_overlay.dts:

input:
easy-installer:
local: images/torizon-core-docker-colibri-imx8x-Tezi_5.7.2+build.20.tar
customization:
splash-screen: black.png
filesystem:
- changes22212/
device-tree:
include-dirs:
- tst/linux/include
custom: tst/linux/arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dts
overlays:
add:
- tst/device-trees/overlays/colibri-imx8x_panel-res-touch-7inch_overlay.dts
- tst/device-trees/overlays/colibri-imx8x_panel-res-touch-7inch_overlay.dts
# - device-trees/overlays/colibri-imx8x_parallel-rgb_overlay.dts
#- device-trees/overlays/colibri-imx8x_ad7879_overlay.dts
#- device-trees/overlays/display-lt161010_overlay.dts
output:
easy-installer:
local: UCP-PB-40
name: “Output”
bundle:
dir: bundle/bundle230605

Unfortunately the display is black and the device is not reachable. Very strange is that I had an error with torizoncore-builder build after I cloned the linux-toradex.git but the error was gone after I cloned it with --depth 1.

Selecting custom device-tree ‘tst4/linux/arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dts’
Error: tst4/linux/include/dt-bindings/input/linux-event-codes.h:1.1-3 syntax error
FATAL ERROR: Unable to parse input tree
error: cannot apply tst4/linux/arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dts.

If I open the linux-event-codes.h, the content is:

…/…/uapi/linux/input-event-codes.h

It is also very confusing to me that there are multiple description with different source for the overlays. (on github are 2, 1 of them is depreciated) and the one from the tutorial above is from git.toradex.com.
I tried the approach with torizoncore-builder dt checkout and dto deploy directly on the machine (as described here: Device Tree Overlays on Torizon | Toradex Developer Center) but then I had the following error:

ibri-imx8x_panel-res-touch-7inch_overlay.dts
Downloading image from: https://artifacts.toradex.com/artifactory/torizoncore-oe-prod-frankfurt/dunfell-5.x.y/release/20/colibri-imx8x/torizon/torizon-core-docker/oedeploy/torizon-core-docker-colibri-imx8x-Tezi_5.7.2+build.20.tar

The download may take some time. Please wait…
Download Complete!

Unpacking Toradex Easy Installer image.
Copying Toradex Easy Installer image.
Unpacking TorizonCore Toradex Easy Installer image.
Importing OSTree revision 4e728da6263e899d550e1017432b29a5284d492fca64ced0230fcd01cac63075 from local repository…
1134 metadata, 12730 content objects imported; 531.5 MB content written
Unpacked OSTree from Toradex Easy Installer image:
Commit checksum: 4e728da6263e899d550e1017432b29a5284d492fca64ced0230fcd01cac63075
TorizonCore Version: 5.7.2+build.20
‘device-trees’ directory already exists
warning: --force was used, bypassing checking overlays against the device tree.
device-trees/overlays/colibri-imx8x_panel-res-touch-7inch_overlay.dts:9:35: error: no include path in which to search for dt-bindings/gpio/gpio.h
9 | #include <dt-bindings/gpio/gpio.h>
| ^
device-trees/overlays/colibri-imx8x_panel-res-touch-7inch_overlay.dts:10:50: error: no include path in which to search for dt-bindings/interrupt-controller/irq.h
10 | #include <dt-bindings/interrupt-controller/irq.h>
| ^
device-trees/overlays/colibri-imx8x_parallel-rgb_overlay.dtsi:7.13-19.3: Warning (graph_child_address): /fragment@2/overlay: graph node has single child node ‘port@0’, #address-cells/#size-cells are not necessary
error: cannot apply device-trees/overlays/colibri-imx8x_panel-res-touch-7inch_overlay.dts.`

Greetings @syntom,

Let me try and go through your points here one by one.

First of all one issue I see is that I believe you’re using the wrong device tree sources. In your initial post you said:

As described, I cloned the 2 repositories:
git clone -b toradex_5.15-2.1.x-imx git://git.toradex.com/linux-toradex.git linux
git clone -b toradex_5.15-2.1.x-imx git://git.toradex.com/device-tree-overlays.git device-trees

However, you are using a TorizonCore 5.7.2 image. In which case this is incorrect, if you see the note above these git clone instructions they state:

The device trees and overlays workflow is being reviewed. The torizoncore-builder dt checkout command is not available for TorizonCore 6 at the moment, and it may change or be deprecated. For TorizonCore 5, go to the corresponding version docs.

If you check the documentation for TorizonCore 5, then you see that you can simply just use the dt checkout command instead. I imagine at least some of the issues you are experiencing here are due to using mismatched device tree sources for the version of TorizonCore you are on.

What is the difference between those device trees? Is “iris-v2” the latest one?

So the device trees listed correspond to our various carrier boards. Each one being optimized for a different carrier board. For example imx8qxp-colibri-aster.dts is the device tree for the Colibri i.MX8X on our Aster carrier board. The “iris-v2” device tree is for our Iris V2 carrier board and so on. Ideally you want to be using the device tree that matches the carrier board you are using from us.

Is there a overlay description with more details so I can decide, which one I really need?

If you check the contents of the overlay file there should be a comment description at the top that describes roughly what each overlay does. For example the colibri-imx8x_dsihdmi_overlay.dts overlay has a comment within, that says “Enable the dsi to hdmi adapter orderable at Toradex for Colibri iMX8X”. I’m not sure if you’re looking for a more detailed description than that.

Furthermore, if you see our device tree overlay article, there is a section showing what overlays are needed to enable common Toradex-related peripherals: Device Tree Overlays on Torizon | Toradex Developer Center

Again, make sure you reference the correct version of our documentation for whatever version of TorizonCore you are using.

Unfortunately the display is black and the device is not reachable.

As said before I believe this issue is probably due to not using the right version of the device tree sources for TorizonCore 5.

I tried the approach with torizoncore-builder dt checkout and dto deploy directly on the machine (as described here: Device Tree Overlays on Torizon | Toradex Developer Center) but then I had the following error:

Looking at the error message you’re trying to apply the overlay colibri-imx8x_panel-res-touch-7inch_overlay.dts, correct? This overlay only exists in the sources for TorizonCore 6, in TorizonCore 5 there was no overlay file with this name. Probably what happened is that you used the device-trees repo that you git cloned the first time instead of the device-trees repo that comes from dt checkout. Then the sources got all mixed up when trying to compile.

Ok so I recommend just starting from scratch and wiping whatever sources you cloned previously as to not mix things up going forward. Use dt checkout to get your sources, and make sure to reference the documentation meant for TorizonCore 5 only, unless you move to TorizonCore 6, then adjust accordingly.

Best Regards,
Jeremias

Hi @jeremias.tx
Thank you for the answer. In this case the page is not 100% clear that this description is for torizoncore 6 only. But ok. We are using viola carrier board, which device-tree should we use? I see iris, aster and eval.
is there a difference between imx8qxp-colibri, imx8dx-colibri and imx8x-colibri? We are using dual- and quadcore versions. should I create an image for each device type?

With this config I created the last image based on 5.3: There I used imx8qxp-colibri-eval-v3. Was this wrong?

input:
easy-installer:
local: images/torizon-core-docker-colibri-imx8x-Tezi_5.3.0+build.7.tar
customization:
splash-screen: black.png
filesystem:
- changes22212/
device-tree:
include-dirs:
- device-trees/include/
custom: device-trees/dts-arm64/imx8qxp-colibri-eval-v3.dts
overlays:
add:
- device-trees/overlays/colibri-imx8x_parallel-rgb_overlay.dts
- device-trees/overlays/colibri-imx8x_ad7879_overlay.dts
- device-trees/overlays/display-lt161010_overlay.dts
output:
easy-installer:
local: UCP-PB-33
name: “Sh V3-03”
bundle:
dir: bundle/b02

We are using viola carrier board, which device-tree should we use? I see iris, aster and eval.

We do not have a device tree specifically for the viola because hardware wise I believe it’s a subset of the evaluation carrier board. So you want to use the evaluation one in this case

is there a difference between imx8qxp-colibri, imx8dx-colibri and imx8x-colibri? We are using dual- and quadcore versions. should I create an image for each device type?

There is a slight difference in the device trees regarding the differing hardware details between these two variants (i.e. memory, cpus, etc). Ideally you want to be using the matching device tree for the variant of the module.

With this config I created the last image based on 5.3: There I used imx8qxp-colibri-eval-v3. Was this wrong?

On a quick glance, this looks correct, did you have any issues? By the way as a note, you only need to specify a device tree in the custom: field if you actually want to use a different device tree than the default device tree. By default the eval variant of the device tree is used, so if you’re still planning to use the eval device tree then you don’t really need to specify this.

For example if you just want to use the default device tree, but want to apply overlays you could do something like this:

customization:
  device-tree:
    include-dirs:
      - device-trees/include/
    overlays:
      clear: true
      add:
        - samples/dts/sample_overlay.dts

Just a suggestion since it sounds like you just want to use the default device tree correct?

Best Regards,
Jeremias

@jeremias.tx
Yes. Thank you very much, I could solve it and I’m able to build working images based on 5.7.2 now.

Glad I was able to help!

As you described I tried the followin:

device-tree:
# >> Directories where to look for include files.
include-dirs:
- device-trees/include
# >> Custom device tree source:tst/
#custom: device-trees/dts-arm64/imx8qxp-colibri-eval-v3.dts
# >> Device-tree overlays configuration:
overlays:
add:
- device-trees/overlays/colibri-imx8x_parallel-rgb_overlay.dts
- device-trees/overlays/colibri-imx8x_ad7879_overlay.dts
- device-trees/overlays/display-lt161010_overlay.dts

but with error:

Building image as per configuration file ‘tcbuild.yaml’…
=>> Handling input section
Unpacking Toradex Easy Installer image.
Copying Toradex Easy Installer image.
Unpacking TorizonCore Toradex Easy Installer image.
Importing OSTree revision 4e728da6263e899d550e1017432b29a5284d492fca64ced0230fcd01cac63075 from local repository…
1134 metadata, 12730 content objects imported; 531.5 MB content written
Unpacked OSTree from Toradex Easy Installer image:
Commit checksum: 4e728da6263e899d550e1017432b29a5284d492fca64ced0230fcd01cac63075
TorizonCore Version: 5.7.2+build.20
=>> Handling customization section
=> Setting splash screen
splash screen merged to initramfs
=> Handling device-tree subsection
Not testing overlay because base image does not have a device-tree set!
=> Adding device-tree overlay ‘device-trees/overlays/colibri-imx8x_parallel-rgb_overlay.dts’
error: overlay colibri-imx8x_parallel-rgb_overlay.dtbo is already applied.

If I don’t comment the line

custom: device-trees/dts-arm64/imx8qxp-colibri-eval-v3.dts

it works. What does this field ‘custom’ means? Why do I have to define it?

What does this field ‘custom’ means?

This means you want to apply a custom device tree. As in a device tree other than the default device tree.

The reason it works with this line is because when you specify custom:, then the tool will clear all default applied device tree overlays before applying the new overlays you specified. If you look at the error message log you see:

error: overlay colibri-imx8x_parallel-rgb_overlay.dtbo is already applied.

So the error was that you’re trying to apply an overlay that is already applied by default. But as I said when you specify custom: it clears all overlays before applying, which is why this issue doesn’t show up.

Now if you look at the example I gave previously I specified:

clear: true

Which also does the behavior of clearing previously applied overlays before applying the overlays you specified.

Best Regards,
Jeremias

ok I think I missed the clear: true part.
Thank you

Glad to help clarify.