sysrq function for kgdb on imx53

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

sysrq function for kgdb on imx53

2,666 Views
Deepu
Contributor III

Hi,

      I am trying to use kgdb on imx53loco board.Kgdb was working successfully on imx6sabrelite board.I enabled the same kernel features which i did for imx6 to imx53loco board.I am using linux-kernel-2.6.38 kernel on imx53.Here if I do the sysrq command"echo g > /proc/sysrq-trigger", it is throwing HELP options as "

SysRq : HELP : loglevel(0-9) reBoot Crash

> terminate-all-tasks(E) memory-full-oom-kill(F) kill-all-tasks(I) t

> haw-filesystems(J) saK show-memory-usage(M) nice-all-RT-tasks(N)"

But if I do "echo b > /proc/sysrq-trigger ", it is working properly and the system boots.

can someone solve this issue?..Thanks in advance        

Labels (4)
0 Kudos
6 Replies

1,395 Views
LeviathanSteven
Contributor III

Hi James,

Sorry to bother you.

As I am also working on the imx6sabrelite, would you please help to share what you have done to let kgdb to work on imx6sabrelite board successfully? Would you give the detailed instructions step by step? My software source code base is L3.0.35_4.0.0_130424. Thank you so much in advance.

0 Kudos

1,395 Views
Deepu
Contributor III

Hi Steven,

You have first configure your target kernel as follows

CONFIG_FRAME_POINTER=y

CONFIG_DEBUG_KERNEL=y

CONFIG_KGDB=y

CONFIG_DEBUG_INFO=y

CONFIG_KGDB_SERIAL_CONSOLE=y (here I am using serial port for kgdb)

CONFIG_MAGIC_SYSRQ= y (for sysrq functions).

Now compile kernel with imx6 configuration file.

Boot the target with this compiled kernel.You have to tell tell target which serial port you are going to use for kgdb pupose.In my case I am using the same console port for kgdb also.This settings you can do either through kernel parameters or via sysfs entry

  1. 1) As a kernel parameter

Add the following parameter to bootargs

kgdboc=/dev/ttymxc1,115200 to your arguments.

     2)    If you are using sysfs entry, do like this

echo /dev/ttymxc1,115200 > /sys/module/kgdboc/parameters/kgdboc


Since same serial port is used for both the console and debugging, we use agent proxy. Through agent proxy we get the target console as well as we do the debugging.

Source for compiling agentproxy is available at the following link

https://kernel.googlesource.com/pub/scm/utils/kernel/kgdb/agent-proxy/+/agent-proxy-1.96

After compiling for host pc ,run it as follows

sudo ./agent-proxy 5550^5551 0 /dev/ttyS0,15200

Now you can see target terminal through telnet with this agentproxy support

sudo  telnet localhost 5550

(It is better to use this telnet instead of minicom where only this agent proxy support comes.)

When you want to start debugging, the target system has to enter debug mode from normal mode. We can do that in this way in target

echo g > /proc/sysrq-trigger

Now it will enter debugger mode.

Now from host side run gdb on vmlinux of the arm compiled kernel.

Go to the corresponding kernel source directory and do like this

arm-fsl-linux-gnueabi-gdb ./vmlinux

Now it will show gdb terminal .From there you have to connect to target for kgdb,

$target remote /dev/ttySO

In my case my host serial port is /dev/ttyS0.

Now it will get connected to target. Here after you can use gdb commands to debug the kernel.

You try this way.If any problem comes please post it

0 Kudos

1,395 Views
dharani_r
Contributor I

Hi,

             I am trying to debug the kernel with GDB based on below steps.

Boot arguments:

setenv bootargs console=ttymxc1,115200 kgdbwait kgdboc=ttymxc0,115200 root=/dev/nfs nfsroot=<ServerIP>:/nfs-setup/rfs ip=<Target-IP>::<Gateway-IP>:<Netmask-IP>:iMX6:eth0:off rw rootwait

After board boots, the kernel entering in to GDB to debug the kernel as:

imx-sdma 20ec000.sdma: initialized

Serial: IMX driver

2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 58) is a IMX

21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 59) is a IMX

console [ttymxc1] enabled

When I run the vmlinux from host, I get the below error:

(gdb) target remote /dev/ttyUSB1

Remote debugging using /dev/ttyUSB1

Ignoring packet error, continuing...

warning: unrecognized item "timeout" in "qSupported" response

Ignoring packet error, continuing...

Ignoring packet error, continuing...

Bogus trace status reply from target: timeout

If I use the same UART port for both console and KGDBOC, I could debug the kernel based on below arguments

setenv bootargs console=ttymxc1,115200 kgdbwait kgdboc=ttymxc1,115200 root=/dev/nfs nfsroot=<ServerIP>:/nfs-setup/rfs ip=<Target-IP>::<Gateway-IP>:<Netmask-IP>:iMX6:eth0:off rw rootwait

and

(gdb) target remote /dev/ttyUSB0

Why can't I debug the kernel, when I use one UART for console and another UART for kgdboc?

Regards,

Dharanendiran.R

0 Kudos

1,395 Views
YixingKong
Senior Contributor IV

Dharani

Could you please create another DI since this DI has been closed?

Thanks,

Yixing

0 Kudos

1,395 Views
dharani_r
Contributor I

Any one reply my issue?

0 Kudos

1,395 Views
YixingKong
Senior Contributor IV

Deepu

The kgdb is not freescale hardware related feature. It is pure Linux debug method related. Freescale would not support.

Regards,

Yixing Kong

0 Kudos