How to debug Linux Kernel module in imx8dx


I’m trying to debug the kernel module of imx_rpmsg_tty which we are using to communicate between LINUX OS and our embedded m4 FreeRTOS code.

I’m struggling to bring the module in a debugging session using VSCode IDE, it will be much appreciated if you help through. And I mean from the moment of enabling gdb / kgdb on imx8dx to connecting the host gdb and enabling it in vscode.

Colibri iMX8DX 1GB V1.0D
Col Evaluation V3.2B
TorizonCore (2022-04-09 | 5.6.0+build.13)

Hey @pkg_su ,

In order to help would you mind clarifying a bit more regarding:

What process did you use to deployed the kernel module to the target board?
Have you verified this kernel module on the device?
Are you specifically looking to debug based on the workflow not working?

Here is a previous article regarding the kernel module in question with a solution.

And a related developer guide.


I know that I can use the TorizonCore builder with specifying in the tcbuild.yaml file the modules to be loaded, but I didn’t do that, as I am not trying to just load the kernel, as well I can load the module in either two cases by re-building the torizoncore kernel or just modprobe the module in. In my case, I loaded the module by modprobe but I don’t know if this is the right way to get from the debugger the required information neither I know how to set my kgdb and connect it to the vscode IDE.

I would like to have the same concept as this link, but not in Visual Studio.
Debugging Linux Kernel with Visual Studio + VirtualBox – Sysprogs Tutorials

yes, I did, and I am using it to transfer messages between the CPUs using rpmsg_lite as the module I am using is the imx_rpmsg_tty.

Not exactly, I am trying to figure things out on how I can receive the data between the CPUs as our system is a bit complicated since we are trying to transfer our protocol packets between the CPUs in RTE, and it would be much appreciated if there is a way to see how the kernel is managing the data before sending it to the bus.


Thanks for all the information. I can do a bit more research if this is possible via vscode.
Currently I know the primary suggested way of debugging the linux kernel(and bootloader) is via a serial port. This may be a faster solution if its possible for you to step up. Here is the developer guide on it.

And on the cortex-m side is our recommend Cortex-M debugging extension.

Would the former method suit your needs for debugging the Linux side kernel?

  • Eric

Hello @pkg_su ,

Could you solve your issue with the info supplied by @eric.tx ?

Do you need more assistance on our side?

Best regards,