Fail to integrate a driver in TorizonCore build

Hi all,

I am new to the Torizoncore build environment, so I am facing a few technical challenges.

I am trying to integrate a camera driver into a TorizonCore image. The first issue is that TorizonCore and the driver have a slightly different kernel version, but I wanted try to see if this will work.

So I set up the .yaml file as following:

    local: images/torizon-core-docker-verdin-imx8mp-Tezi_5.6.0+build.13.tar
  # >> Splash screen:
  splash-screen: custom/toradexlinux.png
  # >> Directories overlayed to the base OSTree
     - changes/
    # >> Directories where to look for include files.
      - /home/sam/tcbworkdir/device-trees/dts-arm64/
    # >> Custom device tree source:
    custom: /home/sam/tcbworkdir/device-trees/dts-arm64/imx8mp-verdin-wifi-dahlia.dts
        - device_trees/overlays/display-dpi-lt170410_overlay.dts
    # >> Custom kernel arguments.
      - key1=val1
      - key2=val2
    # >> Modules to build and possibly load automatically.
      - source-dir: linux-toradex/
        autoload: no
# >> The output section defines properties of the output image.
    local: output_directory_CUSTOM

When I run torizoncore-builder build

I get the following 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 83e43d79b825341ca12556a76e56d526816ec60873f2877795b6ed9c7ae2cc68 from local repository…
1129 metadata, 12761 content objects imported; 520.6 MB content written
Unpacked OSTree from Toradex Easy Installer image:
Commit checksum: 83e43d79b825341ca12556a76e56d526816ec60873f2877795b6ed9c7ae2cc68
TorizonCore Version: 5.6.0+build.13

=>> Handling customization section

=> Building module located at 'linux-toradex/'
Error: KERNEL_SRC not found in "linux-toradex/Makefile"

Note that I am cloning the Kernel source as following:

git clone -b toradex_5.4-2.3.x-imx git://

Is there is way to fix this problem? if so, what will it be?

Thanks for your patience

Hi @user123456789 ,

The error message is happening because TorizonCore Builder expects a directory with the Kernel module source files (i.e. .c files) and one Makefile with the KERNEL_SRC environment variable. You referenced a directory which has the Linux Kernel.

So you should pass a directory with the Driver source files (find them in the Kernel and copy them to the referenced folder) and a Makefile similar to the one found in this example: Building External Kernel Modules With Torizon | Toradex Developer Center. You can also try building the Kernel Module in the article to get a better idea of the workflow.

Also, about the yaml file:

  • include-dirs should have this path: device-trees/include;
  • The added overlay path has device_trees instead of device-trees;
  • The overlay that you added is for the Colibri SoMs and it will not be applied to a Verdin iMX8M Plus device tree, so you should remove it;
  • The Kernel arguments are generic examples from our template file and although adding them will not cause any problems, they won’t do anything to your system.

Try doing the above and see if it helps you.

Best regards,
Lucas Akira