How to add an in-tree-module to my Torizon yocto build

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

To successfully add an in-tree kernel module to your Torizon Yocto build, you need to ensure that the module is properly configured, compiled, and included in the final image. Here are some steps to help you troubleshoot and resolve the issue:

  1. Verify Kernel Configuration: Make sure your bbappend file is correctly modifying the kernel configuration. The line echo "CONFIG_TOUCHSCREEN_HYCON_HY46XX=m" >> ${WORKDIR}/defconfig should enable the module as a loadable module (m). After running bitbake, check the .config file in the build directory to confirm that this configuration is present.

  2. Check Compilation: Ensure the module is being compiled by inspecting the build logs for any errors related to the module. The module should be compiled into a .ko file, which is the format for loadable kernel modules.

  3. Include Module in Image: If the module is compiled but not included in the image, you may need to explicitly add it to the image. You can do this by adding the module to the IMAGE_INSTALL variable in your image recipe or local.conf like this:

    IMAGE_INSTALL_append = " hycon-hy46xx"
    

    This ensures the module is included in the final image.

  4. Rebuild the Image: After making these changes, rebuild your image using bitbake to ensure the module is included.

  5. Verify on Target: Once the image is deployed to your device, verify that the module is available by using the modprobe command to load it and lsmod to check if it is loaded.

By following these steps, you should be able to successfully add and verify the in-tree kernel module in your Torizon Yocto build.

Best regards,
Toradex AI Assistant.

Please, also check if these links can help you solve your problem:

https://community.nxp.com/t5/i-MX-Processors/Add-Kernel-Modules-in-the-core-image-minimal/m-p/768004

Help to integrate a custom kernel into a Torizon Core Image.