Hi all,
Need some help regarding how to use gdb with open ocd for remote debugging a program on beaglebone.
Firstly I followed these link to get started with open ocd!!
http://www.mattlmassey.com/2012/04/26/using-openocd-with-the-beaglebone/http://elinux.org/Running_OpenOCD_on_Linux_with_the_Beaglebone And it seems to be worked to get
connect with beaglebone using gdb through open ocd. even able to get connected using telnet!!
following are the steps I'm following>>
1st)
sudo openocd -f board/ti_beaglebone.cfg -c init -c "reset init"
2nd) I can connect to the beaglebone by telnet as
sudo telnet localhost 4444
when I get connected I can halt, resume the cpu and I can see the effect of it on board!!
3rd)I can connect to the beaglebone by gdb as
arm-argo-linux-gnueabi-gdb
4th)On the other side on target beaglebone I'm setting the gdbserver to debug the hello word program as
gdbserver /dev/ttyO0 hello
as I'm not using the ethernet connection for it.
5th)on host side I'm doing this>
i.arm-argo-linux-gnueabi-gdb hello
ii.set sysroot /path/to/copy/of/rootfs
iii.target remote localhost:3333
iv.b main
v.continue
and when I say
continue it says this>>
on host side>>
-------------------------------------------------------------------------------------------------------
Locking debug access failed on first, but succeeded on second try.
Warn : am335x.cpu: ran after reset and before halt ...
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x60000093 pc: 0xc001bc28
MMU: enabled, D-Cache: enabled, I-Cache: enabled
Info : accepting 'telnet' connection from 4444
Info : dropped 'telnet' connection
Info : accepting 'telnet' connection from 4444
force soft breakpoints
Info : accepting 'gdb' connection from 3333
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x60000093 pc: 0xc001bc28
MMU: enabled, D-Cache: enabled, I-Cache: enabled
Warn : acknowledgment received, but no packet pending
Error: Address translation failure
Error: Address translation failure
Error: Address translation failure
Error: Address translation failure
Error: Address translation failure
Error: Address translation failure
Error: DSCR_DTR_RX_FULL, dscr 0x4b0f6043
Error: Timeout waiting for read dcc
>>>>Error: can't add breakpoint: unknown reason<<<<
Error: DSCR_DTR_RX_FULL, dscr 0x4b0f6043
Error: DSCR_DTR_RX_FULL, dscr 0x4b0f6003
Error: DSCR_DTR_RX_FULL, dscr 0x4b0f6043
Error: Timeout waiting for read dcc
Error: DSCR_DTR_RX_FULL, dscr 0x4b0f6043
Error: Timeout waiting for read dcc
Error: DSCR_DTR_RX_FULL, dscr 0x4b0f6043
Error: Timeout waiting for read dcc
Error: DSCR_DTR_RX_FULL, dscr 0x4b0f6043
Error: Timeout waiting for read dcc
Info : dropped 'gdb' connection
---------------------------------------------------------------------------------------
on target beaglebone kernel get crashed!!
=======================================================================================
root@beaglebone:~# [ 698.816451] Unable to handle kernel paging request at virt
ual address 8e68c56c
[ 698.824010] pgd = c0004000
[ 698.826830] [8e68c56c] *pgd=00000000
[ 698.830573] Internal error: Oops: 805 [#1] SMP ARM
[ 698.835567] Modules linked in:
[ 698.838758] CPU: 0 Not tainted (3.8.13-00641-g768bfaf #1)
[ 698.844766] PC is at cpu_v7_dcache_clean_area+0x14/0x2c
[ 698.850220] LR is at default_idle+0x20/0x2c
[ 698.854579] pc : [<c001bc40>] lr : [<c000ebd4>] psr: 60000093
[ 698.854579] sp : c07d5fb0 ip : 00000000 fp : 00000000
[ 698.866539] r10: 00000000 r9 : 413fc082 r8 : 80004059
[ 698.871981] r7 : c0aab280 r6 : c052b228 r5 : c0845c48 r4 : c07d4000
[ 698.878780] r3 : 00000000 r2 : 002de000 r1 : 00000000 r0 : 8e68c56c
[ 698.885595] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment ker
nel
[ 698.893309] Control: 10c5387d Table: 8f5d0019 DAC: 00000015
[ 698.899303] Process swapper/0 (pid: 0, stack limit = 0xc07d4238)
[ 698.905564] Stack: (0xc07d5fb0 to 0xc07d6000)
[ 698.910109] 5fa0: c000ebb4 c000ed70 c07dd
3c8 ffffffff
[ 698.918640] 5fc0: c07bd178 c078f7a4 ffffffff ffffffff c078f228 00000000 00000
000 c07bd178
[ 698.927163] 5fe0: 00000000 10c5387d c07dc4f0 c07bd174 c07e0cac 80008078 00000
000 00000000
[ 698.935721] [<c001bc40>] (cpu_v7_dcache_clean_area+0x14/0x2c) from [<c07bd174
>] (__atags_pointer+0x0/0x4)
[ 698.945702] Code: e1a03823 e203300f e3a02004 e1a02312 (ee070f3a)
[ 698.952070] ---[ end trace f8a12ea9c3f74cfa ]---
[ 698.956888] Kernel panic - not syncing: Attempted to kill the idle task!
========================================================================================
this line>>
[ 698.816451] Unable to handle kernel paging request at virt
ual address 8e68c56c
how to avoid this error??
looking at the line,
>>>>Error: can't add breakpoint: unknown reason<<<<
I changed gdb_breakpoint_override to hard, default set to soft.
by this kernel is not getting crashed but some how few seconds after I say "continue" in gdb
target says connection is disconnected by the remote gdb and this message is shown continuously
in the loop.
and host side says>>>
>>Continuing.
>>couldn't write MPSSE commands to FT2232
>>Polling target failed, GDB will be halted. Polling again in 100ms
well, I'm a newbie.
I hope I'll get some help here.
thanks,
aniket