Debugging with Torizon kernel/tools


I have Colibri IMX8DX and I use the linux image torizon-core-docker-colibri-imx8x-Tezi_6.5.0+build.8.tar with torizoncore-builder .

I have difficulties to setup a ICS43434 microphone connected through I2S (SAI peripheral of the IMX). See other question here.

As I don’t get any help for that I would need to get into details (i.e. the source code) to understand what happens of don’t happens.

  1. How can I run a debug version of Linux, i.e. a version which have the config flag CONFIG_DYNAMIC_DEBUG ?
  2. Can I recompile the kernel after adding my own debug message?
  3. Do you have a version of devmem I can use so that I can check register values for the SAI peripheral? Or any other tool to read physical addresses under Linux user space.

Thank you,

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:

Hello Greg,

To address your debugging needs for the Colibri iMX8DX using TorizonCore, let’s tackle your questions one by one:

  1. Running a Debug Version of Linux with CONFIG_DYNAMIC_DEBUG:
    To run a debug version of Linux that includes the CONFIG_DYNAMIC_DEBUG configuration, you would need to recompile the kernel with this option enabled. This involves modifying the kernel configuration before the build process. The TorizonCore Builder tool can be used to customize the kernel, including enabling specific config flags like CONFIG_DYNAMIC_DEBUG. You would start by cloning the Toradex kernel source, modifying the configuration to enable CONFIG_DYNAMIC_DEBUG, and then using TorizonCore Builder to integrate your custom kernel into the TorizonCore image.

  2. Recompiling the Kernel with Custom Debug Messages:
    Yes, you can recompile the kernel after adding your own debug messages. This process involves adding your debug code to the kernel source, configuring the kernel build environment to include your changes, and then compiling the kernel. Afterward, use TorizonCore Builder to integrate your custom kernel into the TorizonCore image. This approach allows you to insert specific debug messages or modify the kernel behavior for in-depth analysis.

  3. Using devmem or Other Tools for Register Values:
    The devmem tool allows you to access physical memory addresses from user space, which can be useful for checking register values of peripherals like the SAI. While devmem is not included by default in TorizonCore, you can easily add it to your system. One approach is to use a Debian container within Torizon that has devmem installed. Alternatively, you can compile devmem from source and include it in your custom TorizonCore image using TorizonCore Builder. This tool is part of the busybox package, so including busybox in your image or container would provide access to devmem.

For tasks involving kernel modification or adding specific tools like devmem, the general workflow involves:

  • Modifying or configuring the kernel source as needed.
  • Using TorizonCore Builder to integrate these changes into a custom TorizonCore image.
  • Deploying the custom image to your device for testing and debugging.

This approach ensures that you have a tailored environment suited to your debugging and development requirements.

Best regards,
Toradex AI Assistant

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

Building External Kernel Modules With Torizon | Toradex Developer Center.

Greetings @masterfoo,

If you want a custom version of Torizon OS with various debugging tools and such enabled, the most practical method is to probably build it with Yocto: Build Torizon OS from Source With Yocto Project/OpenEmbedded | Toradex Developer Center

In this way you can patch the kernel, or add whatever debugging tools you want.

Best Regards,

1 Like