How to apply a Device Tree Overlay

I have read the i.MX 95 Verdin EVK Getting Started guide and successfully booted the i.MX 95 Verdin board.
I connected a 4K MIPI camera (os08a20) to the board and would like to display the captured images via HDMI output.
HDMI output has been confirmed to work correctly.

To make the 4K MIPI camera (os08a20) recognized as a device, I want to apply the overlay imx95-19x19-verdin-os08a20.dtbo.I confirmed that the kernel supports overlays using the following command after booting Linux:
zcat /proc/config.gz | grep OVERLAY
⇒ CONFIG_OF_OVERLAY = y

I set the following environment variable in U-Boot, but the overlay was not applied:
setenv fdt_overlays imx95-19x19-verdin-os08a20.dtbo

Please tell me how to correctly apply the device tree overlay.

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Based on the available documentation, I can help you with the correct method for applying device tree overlays on Toradex modules. The approach depends on whether you’re using Torizon OS or a Yocto-based BSP.

For Torizon OS (Recommended Method)

If you’re using Torizon OS, the correct way to apply device tree overlays is through the overlays.txt file, not U-Boot environment variables (1).

Method 1: Using overlays.txt File

  1. Locate the overlays.txt file in the boot partition:

    /sysroot/boot/ostree/torizon-*/dtb/overlays.txt
    

    (1)

  2. Edit the overlays.txt file to include your overlay:

    # sudo sh -c "echo 'fdt_overlays=imx95-19x19-verdin-os08a20.dtbo' > overlays.txt"
    # sync
    

    (1)

  3. Reboot the board:

    # sudo reboot
    

    (1)

Method 2: Using TorizonCore Builder (For Production)

For production deployments, use TorizonCore Builder to apply overlays permanently to your image (1).

For Yocto-based BSP

If you’re using a Yocto-based BSP, you can enable overlays by modifying the overlays.txt file on the boot partition (2):

  1. Edit the overlays.txt file:

    # vi /boot/overlays.txt
    

    (2)

  2. Add your overlay:

    fdt_overlays=imx95-19x19-verdin-os08a20.dtbo
    

    (2)

  3. Synchronize and reboot:

    # sync
    # reboot
    

    (2)

Important Notes

  • Check overlay availability: First, verify that your specific overlay file exists in the overlays directory (1)
  • Recovery option: If an overlay breaks the kernel boot, you can set the U-Boot environment variable skip_fdt_overlays to 1 to bypass overlay loading (1)
  • Multiple overlays: You can specify multiple overlays separated by spaces in the fdt_overlays line (1)

The U-Boot setenv fdt_overlays method you tried is not the standard approach for Toradex modules. The overlays.txt file method is the recommended and supported way to apply device tree overlays.

Best regards, Toradex AI Assistant.

@ToradexAI

Thank you for your support.

I believe I’m using a Yocto-based BSP.
I tried the method you suggested:

  1. Since /boot/overlays.txt did not exist on the device, I created it manually.

  2. I added the following line:
    fdt_overlays=imx95-19x19-verdin-os08a20.dtbo

  3. Then I ran the following commands to sync and reboot:
    # sync
    # reboot

Result:
After Linux booted, I checked whether the overlay was applied using the following command, but nothing was displayed:
#dmesg | grep overlay

To test if overlays work, I tried the following:

  1. I set the DTB file to:
    fdtfile=imx95-19x19-verdin.dtb

  2. I modified /boot/overlays.txt to:
    fdt_overlays=imx95-19x19-verdin-lt8912.dtbo

  3. Then I ran sync and reboot again.

Expected behavior:
HDMI output should work, just like when specifying fdtfile=imx95-19x19-verdin-lt8912.dtb.

Result:
HDMI output did not worked.

Are there any other things I should check or try to make the device tree overlay work properly?

best regards

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

Did you like my answer? :+1: :-1:


Troubleshooting Device Tree Overlay Application

Thank you for the additional details. Let’s troubleshoot your overlay application systematically.

1. Verify Overlay Files Exist

First, check if your overlay files are actually present in the correct location (1):

$ ls /boot/overlays

The overlays should be available as .dtbo files in this directory. If they’re not present, the overlay application will fail silently (1).

2. Check Current Device Tree Information

Use the tdx-info tool to check your current device tree configuration (2):

# sudo tdx-info -dt

This will show you the currently enabled device tree and any applied overlays (2).

3. Verify U-Boot Environment Variables

Check your current U-Boot environment to ensure the overlay mechanism is properly configured. You can examine this from Linux:

# fw_printenv | grep overlay
# fw_printenv | grep fdt

4. Enable Overlay Debug Messages

To get more verbose output about overlay loading, you can check the full boot log:

# dmesg | grep -i "overlay\|dtb\|fdt"

Also check for any device tree related messages:

# dmesg | grep -i "device.tree"

5. Alternative Overlay Application Method

If the overlays.txt file method isn’t working, you can try setting the overlay directly in U-Boot environment (1). From Linux, you can modify the U-Boot environment:

# fw_setenv fdt_overlays "imx95-19x19-verdin-lt8912.dtbo"
# reboot

6. Verify Overlay Compatibility

Ensure your overlay is compatible with your current BSP version. Device tree overlays must be written for the correct kernel version, which depends on the BSP you’re using (3).

7. Check for Pre-enabled Overlays

Some overlays might be pre-enabled by default and could conflict with your custom overlay (1). Check if there are any pre-enabled overlays that might be interfering.

8. Manual Overlay Loading Test

You can test if overlay loading works at all by trying to load a known working overlay manually. For SMARC iMX95, you should have access to several pre-built overlays (1).

9. Boot Partition Location

Ensure you’re editing the correct overlays.txt file. The location might vary depending on your setup. Try checking:

# find /boot -name "overlays.txt" -type f
# find /media -name "overlays.txt" -type f

10. Recovery Option

If an overlay breaks the boot process, you can disable overlay loading by setting (4):

# fw_setenv skip_fdt_overlays 1

This will bypass overlay loading entirely, allowing you to boot and fix the configuration.

Expected Behavior

When overlays are successfully applied, you should see messages in the boot log indicating the overlay loading process. The absence of any overlay-related messages in dmesg suggests the overlay loading mechanism isn’t functioning properly.

If none of these steps resolve the issue, there might be a fundamental problem with the overlay loading mechanism in your BSP version, or the overlay files might not be compatible with your specific hardware revision.

Best regards, Toradex AI Assistant.

@ToradexAI

Thank you for your response.

I have checked the points you mentioned:
1. Verify Overlay Files Exist

There is no /boot/overlays directory on the device.
The overlay files are located at:
/run/media/boot-mmcblk0p1/

I created the /boot/overlays directory and copied the .dtbo files from /run/media/boot-mmcblk0p1/, but the overlays were not applied.


2. Check Current Device Tree Information

The tdx-info command is not available.


3. Verify U-Boot Environment Variables

The fw_printenv command is not available.
Here are the current U-Boot environment variables related to the device tree:

fdt_addr=0x93000000  
fdt_addr_r=0x93000000  
fdt_high=0xffffffffffffffff  
fdtcontroladdr=fdee3d60  
fdtfile=imx95-19x19-verdin.dtb

4. Enable Overlay Debug Messages

I tried running the suggested command, but no messages were displayed.


5. Alternative Overlay Application Method

Since fw_setenv is not available, I tried setting the overlay directly in U-Boot:

# setenv fdt_overlays "imx95-19x19-verdin-lt8912.dtbo"  
# saveenv  
# bootd

However, the overlay was still not applied.


9. Boot Partition Location

I ran the following commands:

# find /boot -name "overlays.txt" -type f  
/boot/overlays.txt

# find /media -name "overlays.txt" -type f  
(no results)


If you have any suggestions or additional steps I should try, I would appreciate your guidance.

best regards

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

Did you like my answer? :+1: :-1:


Troubleshooting Overlay Application on Yocto-based BSP

Thank you for the detailed investigation. Based on your findings, I can see that you’re working with a Yocto-based BSP where the overlay files are located in /run/media/boot-mmcblk0p1/ rather than the standard /boot/overlays/ directory.

Key Issues Identified

  1. Overlay files location: Your overlays are in /run/media/boot-mmcblk0p1/ instead of /boot/overlays/
  2. Missing overlay loading mechanism: The standard overlay loading variables may not be properly configured

Correct Overlay Application Method

Based on the Toradex documentation for Yocto-based BSP, the correct approach is to deploy overlays to the boot partition and enable them in the overlays.txt file (1).

Step 1: Place overlays.txt in the correct location

Since your overlay files are in /run/media/boot-mmcblk0p1/, create the overlays.txt file there:

# echo "fdt_overlays=imx95-19x19-verdin-lt8912.dtbo" > /run/media/boot-mmcblk0p1/overlays.txt
# sync

(1)

Step 2: Verify U-Boot overlay loading variables

The key U-Boot variables for overlay loading are (2):

  • overlays_file: Store overlays text-file’s name (default: “overlays.txt”)
  • overlays_prefix: Store where overlays_file is stored (default: “Overlays/”)
  • skip_fdt_overlays: Set to skip loading device tree overlays

Check these variables in U-Boot:

> printenv overlays_file
> printenv overlays_prefix
> printenv skip_fdt_overlays

(2)

Step 3: Configure U-Boot overlay variables

If the overlay variables are not set correctly, configure them in U-Boot:

> setenv overlays_file overlays.txt
> setenv overlays_prefix ""
> setenv skip_fdt_overlays ""
> saveenv
> reset

(2)

Alternative: Direct U-Boot Configuration

Since you have direct U-Boot access, you can also try setting the overlay loading mechanism manually. The U-Boot environment should include overlay loading in the boot command sequence (2).

Verification Steps

  1. Check if overlays are being loaded during boot: Look for overlay-related messages during the U-Boot phase (not just in Linux dmesg)

  2. Verify overlay file format: Ensure your .dtbo files are properly compiled device tree overlays (1)

  3. Test with a minimal setup: Try with just one known-working overlay first

Boot Partition Considerations

Since your overlays are in /run/media/boot-mmcblk0p1/, this appears to be the actual boot partition. The overlays.txt file should be placed in the same location as your .dtbo files (1).

Recovery Method

If overlays cause boot issues, you can disable them by setting in U-Boot (1):

> setenv skip_fdt_overlays 1
> boot

This will bypass overlay loading entirely, allowing you to boot and fix the configuration.

Next Steps

  1. Place overlays.txt in /run/media/boot-mmcblk0p1/ alongside your .dtbo files
  2. Configure the U-Boot overlay variables as shown above
  3. Monitor the U-Boot output during boot for overlay loading messages
  4. If still not working, check if your BSP version supports the overlay loading mechanism

The absence of fw_printenv and tdx-info suggests you may be using a minimal BSP configuration that might not include all overlay loading features by default.

Best regards, Toradex AI Assistant.

@ToradexAI

Thank you for your support.

I have checked the points you mentioned:
**Step 1 was completed.
**
root@imx95evk:~# less /run/media/boot-mmcblk0p1/overlays.txt
fdt_overlays=imx95-19x19-verdin-lt8912.dtbo

Steps 2 and 3 were completed.

u-boot=> printenv overlays_file
## Error: "overlays_file" not defined
u-boot=> printenv overlays_prefix
## Error: "overlays_prefix" not defined
u-boot=> printenv skip_fdt_overlays
## Error: "skip_fdt_overlays" not defined
u-boot=> setenv overlays_file overlays.txt
u-boot=> setenv overlays_prefix ""
u-boot=> setenv skip_fdt_overlays ""u-boot=> saveenvSaving Environment to MMC... Writing to MMC(0)... OK
u-boot=> reset

However, HDMI output did not work.

root@imx95evk:~# zcat /proc/config.gz | grep OVERLAY
CONFIG_EFI_CUSTOM_SSDT_OVERLAYS=y
CONFIG_OF_OVERLAY=y
# CONFIG_FB_MXC_OVERLAY is not set
CONFIG_OVERLAY_FS=m
# CONFIG_OVERLAY_FS_REDIRECT_DIR is not set
CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=y
# CONFIG_OVERLAY_FS_INDEX is not set
# CONFIG_OVERLAY_FS_XINO_AUTO is not set
# CONFIG_OVERLAY_FS_METACOPY is not set
# CONFIG_OVERLAY_FS_DEBUG is not set

Therefore, I believe the BSP being used supports overlays.

Here is the U-Boot log.
Could this provide any clues for resolving the issue?

U-Boot SPL 2024.04+g674440bc73e+p0 (Jun 06 2024 - 10:05:34 +0000)
SOC: 0xa1009500
LC: 0x40010
SYS Boot reason: por, origin: -1, errid: -1
SYS shutdown reason: por, origin: -1, errid: -1
DDRMIX is powered UP
Normal Boot
Trying to boot from MMC1
Primary set selected
Load image from MMC/SD 0xddc00
NOTICE:  BL31: v2.10.0  (release):android-14.0.0_2.0.0-rc1-1-g49143a170
NOTICE:  BL31: Built : 10:04:22, May 29 2024


U-Boot 2024.04+g674440bc73e+p0 (Jun 06 2024 - 10:05:34 +0000)

CPU:   i.MX95 rev1.1 at 1800MHz
CPU:   Automotive temperature grade (-40C to 125C) at 46C
LM Boot reason: sw, origin: 2, errid: 1
LM shutdown reason: sw, origin: 2, errid: 1
Model: Toradex i.MX95 19X19 Verdin EVK
DRAM:  15.8 GiB
TCPC:  Vendor ID [0x1fc9], Product ID [0x5110], Addr [I2C6 0x52]
cfg name not match mx95alt:mx95evk, ignore
Core:  271 devices, 31 uclasses, devicetree: separate
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial

BuildInfo:
  - ELE firmware version 0.0.3-25f6a933

switch to partitions #0, OK
mmc0(part 0) is current device
flash target is MMC:0
Net:   WARNING: no MAC address assigned for MAC0
imx_get_mac_from_fuse: fuse read err: 0
eth0: enetc-0 [PRIME]Could not get PHY for emdio-0: addr 2

Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
97421 bytes read in 2 ms (46.5 MiB/s)
MMC: no card present
No EFI system partition
No EFI system partition
Failed to persist EFI variables
No EFI system partition
Failed to persist EFI variables
No EFI system partition
Failed to persist EFI variables
Loading Boot0000 'mmc 0' failed
EFI boot manager: Cannot load any image
MMC: no card present
starting USB...
Bus usb@4c100000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus usb@4c200000: USB EHCI 1.00
scanning bus usb@4c100000 for devices... 1 USB Device(s) found
scanning bus usb@4c200000 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
Running BSP bootcmd ...
switch to partitions #0, OK
mmc0(part 0) is current device
Failed to load 'boot.scr'
35355136 bytes read in 107 ms (315.1 MiB/s)
Booting from mmc ...
97421 bytes read in 2 ms (46.5 MiB/s)
## Flattened Device Tree blob at 93000000
   Booting using the fdt blob at 0x93000000
Working FDT set to 93000000
   Using Device Tree in place at 0000000093000000, end 000000009301ac8c
Working FDT set to 93000000

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

Did you like my answer? :+1: :-1:


Analyzing the U-Boot Log for Overlay Loading Issues

Thank you for providing the detailed U-Boot log. Based on the log analysis and the Toradex documentation, I can identify the key issue preventing your device tree overlay from loading.

Critical Finding: Missing Overlay Loading in U-Boot

The U-Boot log shows that the device tree is loaded normally, but there’s no mention of overlay processing. Looking at the boot sequence:

97421 bytes read in 2 ms (46.5 MiB/s)
## Flattened Device Tree blob at 93000000
   Booting using the fdt blob at 0x93000000
Working FDT set to 93000000
   Using Device Tree in place at 0000000093000000, end 000000009301ac8c
Working FDT set to 93000000

Expected behavior: When overlays are properly configured, you should see additional messages about overlay loading during this phase (1).

Root Cause Analysis

The issue appears to be that your U-Boot configuration doesn’t include the overlay loading mechanism in the boot command sequence. The standard Toradex U-Boot implementation should automatically process the overlays.txt file during boot (1).

Solution: Manual U-Boot Overlay Loading

Since the automatic overlay loading isn’t working, you can try manual overlay loading in U-Boot. Here’s the approach based on the Toradex documentation (1):

Step 1: Load and Apply Overlay Manually in U-Boot

u-boot=> mmc dev 0
u-boot=> fatload mmc 0:1 ${fdt_addr_r} ${fdtfile}
u-boot=> fatload mmc 0:1 0x94000000 imx95-19x19-verdin-lt8912.dtbo
u-boot=> fdt addr ${fdt_addr_r}
u-boot=> fdt resize 0x1000
u-boot=> fdt apply 0x94000000
u-boot=> bootm ${loadaddr} - ${fdt_addr_r}

Step 2: Verify Overlay File Existence

First, confirm your overlay file exists:

u-boot=> mmc dev 0
u-boot=> fatls mmc 0:1

Look for imx95-19x19-verdin-lt8912.dtbo in the file list.

Alternative: Check Boot Command Configuration

Your U-Boot might need the boot command to be modified to include overlay processing. The standard Toradex boot sequence should include overlay loading (1).

Check Current Boot Command

u-boot=> printenv bootcmd

Expected Boot Command Structure

The boot command should include overlay processing steps. If it doesn’t, this explains why overlays aren’t being applied.

Troubleshooting Recovery Method

If you need to bypass overlay loading entirely for troubleshooting (1):

u-boot=> setenv skip_fdt_overlays 1
u-boot=> boot

This will boot without any overlays, allowing you to verify the base system works.

Key Observations from Your Setup

  1. Kernel overlay support confirmed: Your CONFIG_OF_OVERLAY=y confirms kernel support
  2. U-Boot variables set correctly: Your overlay variables are now configured
  3. Files in correct location: overlays.txt is in /run/media/boot-mmcblk0p1/
  4. Missing automatic loading: U-Boot isn’t processing overlays automatically

Next Steps

  1. Try the manual overlay loading method in U-Boot
  2. Check if your U-Boot version includes overlay loading support
  3. Verify the overlay file format is correct for your BSP version (1)
  4. Consider that your specific BSP build might not include the automatic overlay loading feature

The absence of overlay loading messages in the U-Boot log strongly suggests that either:

  • The overlay loading feature isn’t compiled into your U-Boot version
  • The boot command sequence doesn’t include overlay processing steps
  • There’s a configuration issue preventing overlay detection

Best regards, Toradex AI Assistant.

@ToradexAI **

Thank you for your support.**

I have checked the points you mentioned:

Step 1: Load and Apply Overlay Manually in U-Boot

After executing the following command, the boot process started, but a kernel panic occurred.

u-boot=> mmc dev 0
switch to partitions #0, OK
mmc0(part 0) is current device
u-boot=> fatload mmc 0:1 ${fdt_addr_r} ${fdtfile}
97421 bytes read in 2 ms (46.5 MiB/s)
u-boot=> fatload mmc 0:1 0x94000000 imx95-19x19-verdin-lt8912.dtbo
2982 bytes read in 2 ms (1.4 MiB/s)
u-boot=> fdt addr ${fdt_addr_r}
Working FDT set to 93000000
u-boot=> fdt resize 0x1000
u-boot=> fdt apply 0x94000000
u-boot=> bootm ${loadaddr} - ${fdt_addr_r}
Wrong Image Type for bootm command
ERROR -91: can't get kernel image!
u-boot=> fatload mmc 0:1 ${loadaddr} Image
35355136 bytes read in 107 ms (315.1 MiB/s)
u-boot=> booti ${loadaddr} - ${fdt_addr_r}
## Flattened Device Tree blob at 93000000
   Booting using the fdt blob at 0x93000000
Working FDT set to 93000000
   Using Device Tree in place at 0000000093000000, end 000000009301bfff
Working FDT set to 93000000

Starting kernel ...

then a kernel panic occurred.


U-Boot Version
U-Boot 2024.04+g674440bc73e+p0 (Jun 06 2024 - 10:05:34 +0000)
Therefore, U-Boot should support device tree overlays.

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

Did you like my answer? :+1: :-1:


Kernel Panic Analysis and Overlay Compatibility Issues

Thank you for providing the detailed test results. The kernel panic after applying the overlay suggests there are compatibility issues between your overlay and the BSP version you’re using.

Root Cause: Overlay Compatibility Issue

The kernel panic indicates that the imx95-19x19-verdin-lt8912.dtbo overlay is not compatible with your current BSP version. This is a common issue when overlays are designed for different kernel versions (1).

Key Compatibility Factors

Based on the Toradex documentation, device tree overlays must be written for the correct kernel version, which depends on the BSP you’re using (2). The overlay repository branch must match the kernel branch for which you are building the overlay (3).

Troubleshooting Steps

Step 1: Verify Overlay Source Branch

Check which branch your overlay comes from. The device tree overlays repository branch must match your kernel version (3):

# Check your kernel version
uname -r

Step 2: Compile Overlay for Your BSP Version

You may need to rebuild the overlay for your specific BSP version. The compilation process requires matching the kernel version (3):

$ export STAGING_KERNEL_DIR=/path/to/your/kernel
$ make

(3)

Step 3: Test with a Simpler Overlay First

Before using the HDMI overlay, try testing with a simpler overlay to verify the loading mechanism works. For example, try an SPIDEV overlay if available for your platform (4).

Step 4: Check Overlay Syntax and Compatibility

Ensure your overlay follows the correct syntax for your BSP version. The basic syntax includes (1):

/dts-v1/;
/plugin/;

/ {
    compatible = "toradex,verdin-am62";
};

(1)

Alternative Approach: Use Pre-built Overlays

Instead of manually applying overlays, try using pre-built overlays that are known to work with your BSP version. Check if your system has pre-built overlays available (4):

$ ls /run/media/boot-mmcblk0p1/*.dtbo

Recovery and Debugging

Boot Without Overlays

To recover from the kernel panic, boot without overlays (2):

u-boot=> setenv skip_fdt_overlays 1
u-boot=> boot

Check Overlay Loading Mechanism

Your U-Boot version (2024.04) should support overlays, but the automatic loading mechanism might not be properly configured in your BSP build. The standard Toradex implementation should process overlays automatically (2).

Important Considerations

  1. BSP Version Matching: Overlays are BSP-version specific and may not work across different versions (2)
  2. Overlay Repository Branch: The device tree overlays repository branch must match your kernel version (3)
  3. Compilation Environment: Overlays need to be compiled with the correct toolchain and kernel headers (3)

Recommended Next Steps

  1. Identify your exact BSP version and kernel branch
  2. Obtain or compile the overlay specifically for your BSP version
  3. Test with a minimal overlay first to verify the loading mechanism
  4. Consider using TorizonCore Builder for a more reliable overlay deployment method if you can switch to Torizon OS

The kernel panic suggests that while the overlay loading mechanism works, the specific overlay you’re trying to use is incompatible with your current BSP configuration.

Best regards, Toradex AI Assistant.

@ToradexAI

Overlay is now working with the following steps:

1.After Linux boots, create a new DTB using the following command:

fdtoverlay -i base.dtb -o result.dtb overlay1.dtbo overlay2.dtbo

2.Specify the DTB in U-Boot:

setenv fdtfile result.dtb
saveenv
boot

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

Did you like my answer? :+1: :-1:


Excellent Solution! Alternative Overlay Application Method

Congratulations on getting your device tree overlay working! Your solution using fdtoverlay is indeed a valid approach for applying device tree overlays on Toradex systems.

Your Working Method

Your approach demonstrates an alternative method for applying overlays that bypasses the automatic U-Boot overlay loading mechanism:

  1. Runtime overlay compilation: Using fdtoverlay to merge the base device tree with your overlay(s) (1)
  2. Custom DTB deployment: Specifying the merged DTB file in U-Boot environment variables (2)

How This Relates to Standard Toradex Methods

Your solution works around the automatic overlay loading issues you encountered. While the standard Toradex approach uses the overlays.txt file for automatic overlay application during boot (2), your method provides more direct control over the overlay application process.

Benefits of Your Approach

  • Direct control: You can manually verify overlay application before boot
  • Debugging friendly: Easier to troubleshoot overlay conflicts by testing combinations manually
  • BSP compatibility: Works regardless of whether your specific BSP build includes automatic overlay loading features

Considerations for Production Use

For production deployments, you might want to consider:

  1. Automation: Script the fdtoverlay process for consistent deployment (3)
  2. Version management: Ensure overlay compatibility when updating BSP versions (4)
  3. Integration: Consider integrating this process into your build system for reproducible results (3)

Alternative for Future Reference

If you later switch to Torizon OS or need the automatic overlay loading feature, the TorizonCore Builder provides a more integrated approach for overlay deployment (1).

Your solution demonstrates the flexibility of device tree overlays and provides a reliable workaround when automatic loading mechanisms aren’t functioning as expected.

Best regards, Toradex AI Assistant.