Verdin IMX8MP + Mallow: torizoncore-builder failed to compile overlay

I’m following the Customize Torizon OS Images guide from toradex. I’ve successfully compiled and deployed a custom torizon OS image to my Dahlia board, and now I’m trying to do the same on my Mallow board, but I’m getting an error from the overlay:

‘device-trees/overlays/verdin-imx8mp_panel-cap-touch-10inch-lvds_overlay.dts:14:10: fatal error: imx8mp-pinfunc.h: No such file or directory’

Is there some extra setup I need to do for the Mallow board, like cloning an additional repo that contains the imx8mp-pinfunc.h?

Here’s my setup that compiled successfully for my Dahlia board:

#tcbuild.yaml
input:
  easy-installer:
    local: torizon-docker-verdin-imx8mp-Tezi_7.4.0+build.28.tar
customization:
  splash-screen: resources/logo.png
  device-tree:
    include-dirs:
      - linux/include
      - device-trees/overlays
    custom: linux/arch/arm64/boot/dts/freescale/imx8mp-verdin-wifi-dahlia.dts
    overlays:
      add:
        - device-trees/overlays/verdin-imx8mp_dsi-to-lvds_panel-cap-touch-10inch-lvds_overlay.dts
output:
  easy-installer:
    local: custom-torizon-docker-verdin-imx8mp-10inchlvds
    name: Torizon OS - DSI 10" Touch DAHLIA
    bundle:
      dir: bundle/

I recreated this for my Mallow board, changing the custom and overlays:

input:
  easy-installer:
    local: torizon-docker-verdin-imx8mp-Tezi_7.4.0+build.28.tar
customization:
  splash-screen: resources/logo.png
  device-tree:
    include-dirs:
      - linux/include
      - device-trees/overlays
    custom: linux/arch/arm64/boot/dts/freescale/imx8mp-verdin-wifi-mallow.dts
    overlays:
      add:
        - device-trees/overlays/verdin-imx8mp_panel-cap-touch-10inch-lvds_overlay.dts
output:
  easy-installer:
    local: custom-torizon-docker-verdin-imx8mp-10inchlvds
    name: Torizon OS - DSI 10" Touch MALLOW
    bundle:
      dir: bundle/

And got the follow errors:

Building image as per configuration file 'tcbuild.yaml'...

=>> Handling input section
Unpacking Toradex Easy Installer image.
Unpacking TorizonCore Toradex Easy Installer image.
Importing OSTree revision 95ec6c36a6b5ec0ee9b2f8038c9ea5eed262087f4e6f42b923225d68d40a8c51 from local repository...
1286 metadata, 9813 content objects imported; 651.1 MB content written                                                                                                                                                                                 
0 metadata, 0 content objects imported; 0 bytes content written                                                                                                                                                                                        
Unpacked OSTree from Toradex Easy Installer image:
  Commit checksum: 95ec6c36a6b5ec0ee9b2f8038c9ea5eed262087f4e6f42b923225d68d40a8c51
  TorizonCore Version: 7.4.0+build.28

=>> Handling customization section

=> Setting splash screen
splash screen merged to initramfs

=> Handling device-tree subsection

=> Selecting custom device-tree 'linux/arch/arm64/boot/dts/freescale/imx8mp-verdin-wifi-mallow.dts'
Compiling Device Tree with DTC 1.6.0...
The device tree was compiled with warnings. To view them, run the command again with debug log level enabled (torizoncore-builder --log-level debug <command>).
Please note that some warnings can come from .dtsi files included in the device tree source e.g. from the SoC vendor.
The warnings don't necessarily indicate a breaking issue with the device tree.
'imx8mp-verdin-wifi-mallow.dts' compiles successfully.
warning: removing currently applied device tree overlays
Device tree imx8mp-verdin-wifi-mallow.dtb successfully applied.

=> Adding device-tree overlay 'device-trees/overlays/verdin-imx8mp_panel-cap-touch-10inch-lvds_overlay.dts'
Compiling Device Tree with DTC 1.6.0...
device-trees/overlays/verdin-imx8mp_panel-cap-touch-10inch-lvds_overlay.dts:14:10: fatal error: imx8mp-pinfunc.h: No such file or directory
   14 | #include "imx8mp-pinfunc.h"
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
Error: device-trees/overlays/verdin-imx8mp_panel-cap-touch-10inch-lvds_overlay.dts:13.85-14.1 syntax error
FATAL ERROR: Unable to parse input tree
error: cannot apply device-trees/overlays/verdin-imx8mp_panel-cap-touch-10inch-lvds_overlay.dts.

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Missing Include Directory for SoC-Specific Header Files

The error you’re encountering is due to missing SoC-specific header files for the i.MX8M Plus. The imx8mp-pinfunc.h file contains pin function definitions specific to the i.MX8M Plus SoC (1).

Solution: Add SoC-Specific Include Directory

You need to add the SoC-specific header file directory to your include-dirs section in your tcbuild.yaml file (2). For i.MX8M Plus modules, you need to include the linux/arch/arm64/boot/dts/freescale/ directory (1).

Update your configuration file as follows:

customization:
  device-tree:
    include-dirs:
      - linux/include
      - device-trees/overlays
      - linux/arch/arm64/boot/dts/freescale/  # Add this line
    custom: linux/arch/arm64/boot/dts/freescale/imx8mp-verdin-wifi-mallow.dts
    overlays:
      add:
        - device-trees/overlays/verdin-imx8mp_panel-cap-touch-10inch-lvds_overlay.dts

Why This Directory is Required

The documentation explains that depending on the header files your device tree overlay includes, you may need to specify directories in the build environment using the include-dirs property (2). This lets TorizonCore Builder locate all dependent files during compilation (2).

For TI-based SoMs, the location is linux/arch/arm64/boot/dts/ti/, while for NXP-based SoMs (like your i.MX8M Plus), it’s linux/arch/arm64/boot/dts/freescale/ (1).

Why It Worked for Dahlia but Not Mallow

Your Dahlia configuration used a DSI-to-LVDS overlay (verdin-imx8mp_dsi-to-lvds_panel-cap-touch-10inch-lvds_overlay.dts) which likely doesn’t require the same SoC-specific pin function definitions. The Mallow overlay (verdin-imx8mp_panel-cap-touch-10inch-lvds_overlay.dts) directly references pin functions that require the imx8mp-pinfunc.h header file.

After adding the freescale directory to your include-dirs, TorizonCore Builder should be able to locate the required header files and compile your overlay successfully.

Best regards, Toradex AI Assistant.


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

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Greetings @JosephG,

Just to confirm the AI response was able to solve your issue correct?

Best Regards,
Jeremias

Yes it was, thank you.