AnsweredAssumed Answered

Openocd GDB issue on early kernel debugging

Question asked by john-s-84 on Dec 5, 2017
Latest reply on Mar 7, 2018 by Aaronwu

I am trying to early debug the linux kernel like OpenOCD GDB usage issues . But I cannot resume/continue uboot. After target remote :3333 uboot hangs. (ADSP-sc573-Ezkit)

 

What I have done on serial console:

- Stop u-boot before kernel booting

U-Boot 2015.01 ADI-1.2.0-gb7ee129-dirty (Jul 20 2017 - 12:09:45)

 

CPU:   ADSP ADSP-SC573-0.0 (Detected Rev: 1.1) (spi flash boot)
VCO: 450 MHz, Cclk0: 450 MHz, Sclk0: 112.500 MHz, Sclk1: 112.500 MHz, DCLK: 225z
OCLK: 150 MHz
I2C:   ready
DRAM:  224 MiB
MMC:   GRIFFIN SDH: 0
SF: Detected W25Q128BV with page size 256 Bytes, erase size 4 KiB, total 16 MiB
In:    serial
Out:   serial
Err:   serial
other init                                                                      
Net:   dwmac.3100c000                                                           
Hit any key to stop autoboot:  0                                                
sc #

 

Openocd:

-Starting openocd as follows

Open On-Chip Debugger (Analog Devices CCES 2.3.0 OpenOCD 0.9.0-gb1bed08) 0.9.0
Licensed under GNU GPL v2
Report bugs to <processor.tools.support@analog.com>
adapter speed: 1000 kHz
trst_only separate trst_push_pull
adspsc57x_init
Info : ICE-2000 firmware version is 1.0.2
Info : ICE-2000 voltage 3.3V
Info : clock speed 1000 kHz
Info : JTAG tap: adspsc573.adjc tap/device found: 0x0280f0cb (mfg: 0x065, part: 0x280f, ver: 0x0)
Info : JTAG tap: adspsc573.dap enabled
Info : adspsc573.dap: hardware has 3 breakpoints, 2 watchpoints
Info : adspsc573.dap: but you can only set 1 watchpoint
Info : accepting 'gdb' connection on tcp/3333
Info : JTAG tap: adspsc573.adjc tap/device found: 0x0280f0cb (mfg: 0x065, part: 0x280f, ver: 0x0)
Info : JTAG tap: adspsc573.dap enabled
Info : adspsc573.dap: hardware has 3 breakpoints, 2 watchpoints
Info : adspsc573.dap: but you can only set 1 watchpoint
Boot Mode 1
start system reset ...
system reset asserted
background polling: off
TAP: adspsc573.dap (enabled)
target state: running
Info : ttbcr 0ttbr0 0ttbr1 0
Info : adspsc573.dap rev 1, partnum c05, arch f, variant 0, implementor 41
Info : number of cache level 1
Info : adspsc573.dap cluster 0 core 0 mono core
target state: halted
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0x800001f3 pc: 0x0000504c
MMU: disabled, D-Cache: disabled, I-Cache: disabled
system reset done
REG_RCU0_STAT 0x00002124
HWRST : 0 (0x00)
SSRST : 1 (0x01) SSRST
SWRST : 0 (0x00)
RSTOUT : 1 (0x01) RSTOUT
BMODE : 1 (0x01)
TESTMODE : 0 (0x00)
STESTMODE : 1 (0x01) STESTMODE
OTPLOCK : 0 (0x00)
STESTROUTINE : 0 (0x00)
ADDRERR : 0 (0x00)
LWERR : 0 (0x00)
RSTOUTERR : 0 (0x00)
REG_RCU0_MSG 0x00460600
BOOTERROR : 0 (0x000)
C0IDLE : 0 (0x00)
C1IDLE : 1 (0x01) Core 1 is IDLE
C2IDLE : 1 (0x01) Core 2 is IDLE
C0TASK : 0 (0x00)
C1TASK : 0 (0x00)
C2TASK : 0 (0x00)
C0L1INIT : 0 (0x00)
C1L1INIT : 1 (0x01) Core 1 L1 initialized
C2L1INIT : 1 (0x01) Core 2 L1 initialized
L2INIT : 1 (0x01) L2 initialized
HALTONAPP : 0 (0x00)
HALTONINIT : 0 (0x00)
HALTONCALL : 0 (0x00)
HALTONERR : 0 (0x00)
CALLAPP : 0 (0x00)
CALLINIT : 0 (0x00)
CALLBACK : 0 (0x00)
CALLERR : 0 (0x00)
target state: halted
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0x800001f3 pc: 0x0000504c
MMU: disabled, D-Cache: disabled, I-Cache: disabled
mmu disabled
semihosting is enabled

 

GDB:

- Connect, try to continue uboot, but uboot hangs. (I have not set any breakpoints here.)

> arm-none-eabi-gdb vmlinux
GNU gdb (GDB) 7.8.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/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-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from vmlinux...done.
(gdb) target remote :3333
Remote debugging using :3333
0x0000504c in ?? ()
(gdb) c
Continuing.

Outcomes