Hi !
I’m trying to debug some bare metal code running on imx7 with a colibri evaluation board, using a Bus Blaster v4.1a probe and openocd (freshly cloned from Public Git Hosting - openocd.git/summary 3737dd69e73816d186ba418d7b833462a8041079). We are running on the first cortex A7 and we don’t use the secondary A7 or the M4.
They do not provide an “out of the box” configuration for imx7 colibri combo, but there is a configuration for nxp imx7 sabre that I tried to use. The configuration seems “ok” as openocd doesn’t display any errors on connexion:
$ sudo build/bin/openocd -f tcl/interface/ftdi/dp_busblasg -f tcl/board/nxp_imx7sabre.cfg
Open On-Chip Debugger 0.10.0+dev-00403-g3737dd6 (2018-04-23-09:42)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : If you need SWD support, flash KT-Link buffer from https://github.com/bharrisau/busblaster
and use dp_busblaster_kt-link.cfg instead
adapter speed: 1000 kHz
trst_and_srst separate srst_gates_jtag trst_push_pull srst_push_pull connect_deassert_srst
adapter_nsrst_delay: 100
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : JTAG tap: imx7.cpu tap/device found: 0x5ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x5)
Info : imx7.cpu_a7.0: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
Info : Listening on port 3334 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Info : imx7.cpu_a7.0 rev 5, partnum c07, arch f, variant 0, implementor 41
Info : imx7.cpu_a7.0 cluster 0 core 0 multi core
However I don’t manage to reset the ship using the reset init
command or modifying pc
by hand, so I cannot do much.
Does anyone have any working configuration for imx7 / colibri / openocd ? Or any advice on how to address the issue / modify the configuration to have reset and break points working ?
Best,
V.
EDIT:
My openocd configuration is the following:
-
http://repo.or.cz/openocd.git/blob/2eadf1e847f4880c698cae8dca857714e464e471[..]
I only commented out line 110 which only applies to NXP sabre boards -
http://repo.or.cz/openocd.git/blob/2eadf1e847f4880c698cae8dca857714e464e471[..]
included by the first file -
http://repo.or.cz/openocd.git/blob/2eadf1e847f4880c698cae8dca857714e464e471[..]
probe related file.
I invoke openocd with openocd -f tcl/interface/ftdi/dp_busblaster.cfg -f tcl/board/nxp_imx7sabre.cfg
From what I could gather from this morning, the setup is almost ok: I
can halt the cpu and perform some “step execution”, or change the value
of some registers, like pc.
Some other options don’t work correctly: I didn’t succeed in setting
some break points, and I have difficulties going through code that shuts
down the MMU.
However, the openocd “reset halt” command doesn’t seem to reset the
board: pc is not modified, VBAR/SCTLR are not modified either.
To test this, I halted the cpu during u-boot’s prompt, where I can use
step or change pc. There, I did two tests:
- reset halt, then step: pc didn’t move
- set pc to 0, reset halt, step: pc resumed the execution from the
address 0, which is not mapped in the current MMU so a prefetch abort
is triggered, in uboot’s VBAR. That’s why it seems that the reset
didn’t happen correctly.
Any help is welcome