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.