TI中文支持网
TI专业的中文技术问题搜集分享网站

davinci linux kernel 2.6.32 不支持网口调试内核

请问专家:

我用的是DM368的平台,DVSDK中linux kernel的版本是2.6.32

参照文章:

processors.wiki.ti.com/…/Debugging_on_DaVinci_using_kgdb

配置内核,发现 Method of KGDB communication 下没有 Ethernet调试方法。请问如何在这个linux版本上支持。

注:用串口调试,开发机能够连接kgdb,continue后,板子无linux启动打印,无法控制,不知道什么原因。所以想用网口调试看看。

谢谢了先。

Tomas Yang:

针对串口调试问题,看了一些资料,由于我们的开发板上只有一个串口,所以只能用kgdboc的方式,

kernel启动参数添加:kgdbwait kgdboc=ttyS0,115200

在目标机上boot linux后,显示:

Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled                        

serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A                    

console [ttyS0] enabled                                                        

serial8250 serial8250.0: unable to register port at index 1 (IO0 MEM1c20400 IRQ4

1): -28                                                                                                                

kgdb: Registered I/O driver kgdboc.                                            

kgdb: Waiting for connection from remote gdb…

在host端执行gdb,kgdb连接成功,如下所示:

root@yangxp:/usr/local/dm368/dvsdk/psp/linux-2.6.32.17-psp03.01.01.39# /root/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gdb ./vmlinux

GNU gdb (Sourcery G++ Lite 2009q1-203) 6.8.50.20081022-cvs

Copyright (C) 2008 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <gnu.org/…/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.  Type "show copying"

and "show warranty" for details.

This GDB was configured as "–host=i686-pc-linux-gnu –target=arm-none-linux-gnueabi".

For bug reporting instructions, please see:

<support.codesourcery.com/…/>…

(gdb) set remotebaud 115200

(gdb) target remote /dev/ttyS0

Remote debugging using /dev/ttyS0

kgdb_breakpoint () at kernel/kgdb.c:1723

1723atomic_set(&kgdb_setting_breakpoint, 0);

输入continue后,串口console没有linux启动的打印,gdb程序也无法控制,强行按ctrl-c后退出,发现串口console打印都出来了。linux启动正常,可以输入。

网上说是串口被kdgb占用,目标板的串口console就没有输出,那么,这种情况下,如何更好的调试?

目标板linux起来后,输入echo g > /proc/sysrq-trigger,进入kgdb调试模式。然后host端重新运行gdb程序重新连接,

设置断点,continue后,结果如下:

(gdb) b do_sigaction

Breakpoint 1 at 0xc00520ec: file kernel/signal.c, line 2391.

(gdb) c

The program is not being run.

(gdb) target remote /dev/ttyS0

Remote debugging using /dev/ttyS0

Ignoring packet error, continuing…

Reply contains invalid hex digit 116

(gdb) c

Continuing.

Breakpoint 1, do_sigaction (sig=28, act=0xc1f85f84, oact=0xc1f85f70)

   at kernel/signal.c:2391

2391struct task_struct *t = current;

(gdb) bt

#0  do_sigaction (sig=28, act=0xc1f85f84, oact=0xc1f85f70)

   at kernel/signal.c:2391

#1  0xc0052318 in sys_rt_sigaction (sig=28, act=0xc1f85f84, oact=0xbedaf6a0,

   sigsetsize=0) at kernel/signal.c:2582

#2  0xc002dfa0 in kuser_cmpxchg_fixup ()

#3  0xc002dfa0 in kuser_cmpxchg_fixup ()

Backtrace stopped: previous frame identical to this frame (corrupt stack?)

(gdb) n

0xc00520f0 in get_current ()

   at /usr/local/dm368/dvsdk/psp/linux-2.6.32.17-psp03.01.01.39/arch/arm/include/asm/current.h:10

10return current_thread_info()->task;

(gdb) n

Warning:

Cannot insert breakpoint 1.

Error accessing memory address 0xc00520ec: Unknown error 4294967295.

不能调试了。网上查了这个错误,说是CONFIG_DEBUG_RODATA宏要禁用,我的禁用的,况且可以设置断点,到底是什么原因???kdgb就这么不好用吗?请高手指点一下。谢谢!!

Tomas Yang:

回复 Tomas Yang:

还有就是调试的速度非常慢。。。。。????

zhaofeng wang1:

您好!请问一下,我用的也是DM368平台,该内核版本没有相应的kgdb的内核补丁,我找了个linux-2.6.13-kgdb-2.3.tar补丁打上,用的是串口调试,结果报出如下错误:

Remote debugging using /dev/ttyS0warning: unrecognized item "qSupported" in "qSupported" responseMalformed response to offset query, qOffsets请问您遇到过么?或者如果正常串口调试的话,我还有什么没做的呢?

谢谢~~ 

赞(0)
未经允许不得转载:TI中文支持网 » davinci linux kernel 2.6.32 不支持网口调试内核
分享到: 更多 (0)