kgdb kernel debug on iMX8 board over serial

cancel
Showing results for 
Search instead for 
Did you mean: 

kgdb kernel debug on iMX8 board over serial

294 Views
stuartrubin
Contributor III

Has anyone had success running kgdb to debug the kernel on an iMX8 (e.g. imx8-qm-mek) board? Connected via serial port? I'm close, but can't quite get it working. All suggestions welcome. Thank you!

Tags (2)
4 Replies

228 Views
lorenzo_giraudi
Contributor III

Someone from NXP ever tried this?

0 Kudos

248 Views
lorenzo_giraudi
Contributor III

 Hi stuartrubin,

I was going to post the same question!

I followed the instruction shown here: https://elinux.org/images/1/1b/ELC19_Serial_kdb_kgdb.pdf but can make it to work. This is what I get:

  • I can do echo ttyLP0 > /sys/module/kgdboc/parameters/kgdboc and it gets successfully registered (note: ttyLP0 is my console too)
  • when I do echo g > /proc/sysrq-trigger I get messages telling that the kernel dropped into kdb, then I see the kdb prompt but it stops there, when I try to type nothing happens

I have the idea that it may involve the polling functions lpuart32_poll_put_char and  lpuart32_poll_get_char but I do not know how to debug it.

It would be great to know if someone from NXP ever tried it.

BR,

Lorenzo

0 Kudos

279 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello stuartrubin,

There may be a different version of gdb depending on the BSP you are using but this package is part of the open embedded layer so you may be able to import the recipe from an older release of the Open Embedded layers. However, you would need to be careful with the dependencies for the older version as there may be conflicts.

https://www.emcraft.com/som/imx-8m/remote-debugging-with-gdb

 

Regards

 

0 Kudos

274 Views
stuartrubin
Contributor III

Bio_TICFSL thank you for your response. I am able to do a normal application debug with gdb. What I actually need is to debug the kernel and drivers with kgdb (not the user space gdb). Any experience with this?