Borton, Nick
2017-07-10 16:08:58 UTC
Hello,
I am attempting some kernel debugging, and I am having issues with OpenOCD halting both cores.
Here is the OpenOCD output:
$ ./bin/openocd -f interface/ftdi/digilent-hs2.cfg -f board/src6021a.cfg
Open On-Chip Debugger 0.10.0+dev-00166-g0e4fbfb (2017-07-05-15:26)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 100 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : clock speed 100 kHz
Info : JTAG tap: fpgasoc.dap tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Info : JTAG tap: fpgasoc.fpga.tap tap/device found: 0x02e050dd (mfg: 0x06e (Altera), part: 0x2e05, ver: 0x0)
Info : fpgasoc.cpu.0: hardware has 6 breakpoints, 4 watchpoints
Info : fpgasoc.cpu.1: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
undefined debug reason 7 - target needs reset
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Info : fpgasoc.cpu.1 rev 1, partnum c09, arch f, variant 4, implementor 41
Info : fpgasoc.cpu.1 cluster 0 core 1 multi core
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x60070093 pc: 0xc011bd48
MMU: enabled, D-Cache: enabled, I-Cache: enabled
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x600e0093 pc: 0xc011bd48
MMU: enabled, D-Cache: enabled, I-Cache: enabled
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Warn : target fpgasoc.cpu.0 is not halted
Error: can't add breakpoint: target running
Here is the gdb which created it:
$ arm-linux-gnueabihf-gdb vmlinux
GNU gdb (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) 7.6.1-2013.10
Copyright (C) 2013 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-build_pc-linux-gnu --target=arm-linux-gnueabihf".
For bug reporting instructions, please see:
<https://bugs.launchpad.net/gcc-linaro>...
Reading symbols from /home /kernelbuild_4.10/vmlinux...(no debugging symbols found)...done.
(gdb) target remote lx-lab2:3333
Remote debugging using lx-lab2:3333
0x00000000 in ?? ()
(gdb) mon halt
fpgasoc.cpu.1 rev 1, partnum c09, arch f, variant 4, implementor 41
fpgasoc.cpu.1 cluster 0 core 1 multi core
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x60070093 pc: 0xc011bd48
MMU: enabled, D-Cache: enabled, I-Cache: enabled
(gdb) mon resume
(gdb) mon halt
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x600e0093 pc: 0xc011bd48
MMU: enabled, D-Cache: enabled, I-Cache: enabled
(gdb) add-symbol-file modules/nvme-core.ko 0xbf000000
add symbol table from file "modules/nvme-core.ko" at
.text_addr = 0xbf000000
(y or n) y
Reading symbols from /home /kernelbuild_4.10/modules/nvme-core.ko...(no debugging symbols found)...done.
(gdb) b nvme_wait_ready
Breakpoint 1 at 0xbf000b78
(gdb) continue
Continuing.
Warning:
Cannot insert breakpoint 1.
Error accessing memory address 0xbf000b78: Unknown error 4294967295.
(gdb)
Here is the target config:
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME fpgasoc
}
# CoreSight Debug Access Port
if { [info exists DAP_TAPID] } {
set _DAP_TAPID $DAP_TAPID
} else {
set _DAP_TAPID 0x4ba00477
}
jtag newtap $_CHIPNAME dap -irlen 4 -ircapture 0x01 -irmask 0x0f \
-expected-id $_DAP_TAPID
# Subsidiary TAP: fpga
if { [info exists FPGA_TAPID] } {
set _FPGA_TAPID $FPGA_TAPID
} else {
set _FPGA_TAPID 0x02e050dd
}
jtag newtap $_CHIPNAME.fpga tap -irlen 10 -ircapture 0x01 -irmask 0x3 -expected-id $_FPGA_TAPID
#
# Cortex-A9 target
#
# GDB target: Cortex-A9, using DAP, configuring only one core
# Base addresses of cores:
# core 0 - 0x80110000
# core 1 - 0x80112000
# Slow speed to be sure it will work
#adapter_khz 1000
set _TARGETNAME1 $_CHIPNAME.cpu.0
set _TARGETNAME2 $_CHIPNAME.cpu.1
# A9 core 0
target create $_TARGETNAME1 cortex_a -chain-position $_CHIPNAME.dap \
-coreid 0 -dbgbase 0x80110000
#$_TARGETNAME1 configure -event reset-start { adapter_khz 1000 }
$_TARGETNAME1 configure -event reset-assert-post "cycv_dbginit $_TARGETNAME1"
$_TARGETNAME1 configure -event gdb-attach { halt }
# A9 core 1
target create $_TARGETNAME2 cortex_a -chain-position $_CHIPNAME.dap \
-coreid 1 -dbgbase 0x80112000
#$_TARGETNAME2 configure -event reset-start { adapter_khz 1000 }
$_TARGETNAME2 configure -event reset-assert-post "cycv_dbginit $_TARGETNAME2"
$_TARGETNAME2 configure -event gdb-attach { halt }
proc cycv_dbginit {target} {
# General Cortex-A8/A9 debug initialisation
cortex_a smp_on
cortex_a dbginit
}
Any advice?
Thanks,
Nick
I am attempting some kernel debugging, and I am having issues with OpenOCD halting both cores.
Here is the OpenOCD output:
$ ./bin/openocd -f interface/ftdi/digilent-hs2.cfg -f board/src6021a.cfg
Open On-Chip Debugger 0.10.0+dev-00166-g0e4fbfb (2017-07-05-15:26)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 100 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Info : clock speed 100 kHz
Info : JTAG tap: fpgasoc.dap tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Info : JTAG tap: fpgasoc.fpga.tap tap/device found: 0x02e050dd (mfg: 0x06e (Altera), part: 0x2e05, ver: 0x0)
Info : fpgasoc.cpu.0: hardware has 6 breakpoints, 4 watchpoints
Info : fpgasoc.cpu.1: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
undefined debug reason 7 - target needs reset
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Register map is not available yet, the target is not fully initialised
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: Target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Info : fpgasoc.cpu.1 rev 1, partnum c09, arch f, variant 4, implementor 41
Info : fpgasoc.cpu.1 cluster 0 core 1 multi core
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x60070093 pc: 0xc011bd48
MMU: enabled, D-Cache: enabled, I-Cache: enabled
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x600e0093 pc: 0xc011bd48
MMU: enabled, D-Cache: enabled, I-Cache: enabled
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Error: cortex_a_mmu: target not halted
Warn : target not halted
Warn : target fpgasoc.cpu.0 is not halted
Error: can't add breakpoint: target running
Here is the gdb which created it:
$ arm-linux-gnueabihf-gdb vmlinux
GNU gdb (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) 7.6.1-2013.10
Copyright (C) 2013 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-build_pc-linux-gnu --target=arm-linux-gnueabihf".
For bug reporting instructions, please see:
<https://bugs.launchpad.net/gcc-linaro>...
Reading symbols from /home /kernelbuild_4.10/vmlinux...(no debugging symbols found)...done.
(gdb) target remote lx-lab2:3333
Remote debugging using lx-lab2:3333
0x00000000 in ?? ()
(gdb) mon halt
fpgasoc.cpu.1 rev 1, partnum c09, arch f, variant 4, implementor 41
fpgasoc.cpu.1 cluster 0 core 1 multi core
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x60070093 pc: 0xc011bd48
MMU: enabled, D-Cache: enabled, I-Cache: enabled
(gdb) mon resume
(gdb) mon halt
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x600e0093 pc: 0xc011bd48
MMU: enabled, D-Cache: enabled, I-Cache: enabled
(gdb) add-symbol-file modules/nvme-core.ko 0xbf000000
add symbol table from file "modules/nvme-core.ko" at
.text_addr = 0xbf000000
(y or n) y
Reading symbols from /home /kernelbuild_4.10/modules/nvme-core.ko...(no debugging symbols found)...done.
(gdb) b nvme_wait_ready
Breakpoint 1 at 0xbf000b78
(gdb) continue
Continuing.
Warning:
Cannot insert breakpoint 1.
Error accessing memory address 0xbf000b78: Unknown error 4294967295.
(gdb)
Here is the target config:
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME fpgasoc
}
# CoreSight Debug Access Port
if { [info exists DAP_TAPID] } {
set _DAP_TAPID $DAP_TAPID
} else {
set _DAP_TAPID 0x4ba00477
}
jtag newtap $_CHIPNAME dap -irlen 4 -ircapture 0x01 -irmask 0x0f \
-expected-id $_DAP_TAPID
# Subsidiary TAP: fpga
if { [info exists FPGA_TAPID] } {
set _FPGA_TAPID $FPGA_TAPID
} else {
set _FPGA_TAPID 0x02e050dd
}
jtag newtap $_CHIPNAME.fpga tap -irlen 10 -ircapture 0x01 -irmask 0x3 -expected-id $_FPGA_TAPID
#
# Cortex-A9 target
#
# GDB target: Cortex-A9, using DAP, configuring only one core
# Base addresses of cores:
# core 0 - 0x80110000
# core 1 - 0x80112000
# Slow speed to be sure it will work
#adapter_khz 1000
set _TARGETNAME1 $_CHIPNAME.cpu.0
set _TARGETNAME2 $_CHIPNAME.cpu.1
# A9 core 0
target create $_TARGETNAME1 cortex_a -chain-position $_CHIPNAME.dap \
-coreid 0 -dbgbase 0x80110000
#$_TARGETNAME1 configure -event reset-start { adapter_khz 1000 }
$_TARGETNAME1 configure -event reset-assert-post "cycv_dbginit $_TARGETNAME1"
$_TARGETNAME1 configure -event gdb-attach { halt }
# A9 core 1
target create $_TARGETNAME2 cortex_a -chain-position $_CHIPNAME.dap \
-coreid 1 -dbgbase 0x80112000
#$_TARGETNAME2 configure -event reset-start { adapter_khz 1000 }
$_TARGETNAME2 configure -event reset-assert-post "cycv_dbginit $_TARGETNAME2"
$_TARGETNAME2 configure -event gdb-attach { halt }
proc cycv_dbginit {target} {
# General Cortex-A8/A9 debug initialisation
cortex_a smp_on
cortex_a dbginit
}
Any advice?
Thanks,
Nick