Hello, I can finally reproduce the bug. It occurs when trying to flash the 
tock-bootloader on a microbit v2.

~~~
git clone https://github.com/tock/tock
cd tock/boards/microbit_v2/
make flash-bootloader
...
openocd -f openocd.cfg -c "program 
/tmp/tock-bootloader.microbit_v2.vv1.1.1.bin; verify_image 
/tmp/tock-bootloader.microbit_v2.vv1.1.1.bin; reset; shutdown;"
Open On-Chip Debugger 0.11.0-rc2
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Error: flash bank name 'nrf52.flash' already exists
Error: flash bank name 'nrf52.uicr' already exists
-4
Info : Using CMSIS-DAPv2 interface with VID:PID=0x0d28:0x0204, 
serial=9904360258994e450062900c00000033000000009796990b
Warn : could not claim interface: Resource busy
Error: error writing data: Input/Output Error
Error: CMSIS-DAP command CMD_INFO failed.
Error: No Valid JTAG Interface Configured.
make: *** [Makefile:37: flash-bootloader] Error 255
~~~

When I posted my original message I didn't realize that the bug was this weird 
message `Error: flash bank name 'nrf52.flash' already exists Error: flash bank 
name 'nrf52.uicr' already exists -4`.

What is even more suspicious is that on one laptop that I tested this, the bug 
went away after a reboot. (Lenvo Yoga running ArchLinux) On another laptop 
(ThinkPad  running Fedora) it disappeared after two reboots :)

As you have request of me last time, I was finally able to attach a some 
debugging information. I would also like to note that the same error appears 
when flashing the [tock-bootloader](https://github.com/tock/tock-bootloader), 
whether I use a pre-build version or not.

Thank you for your patience, for I am beginner.


Attachments:

- 
[odd.txt](https://sourceforge.net/p/openocd/tickets/_discuss/thread/421e8071d5/6338/attachment/odd.txt)
 (9.1 kB; text/plain)


---

** [tickets:#356] fail to debug a micro:bit v2 application**

**Status:** new
**Milestone:** 0.11.0
**Created:** Wed Jul 13, 2022 01:04 PM UTC by Matei Barbu
**Last Updated:** Wed Jul 20, 2022 02:39 PM UTC
**Owner:** nobody


Hello,

Am i trying to flash&debug the [TockOS](https://github.com/tock/tock/) kenel 
using OpenOCD on a 
[micro:bitv2](https://github.com/tock/tock/tree/master/boards/microbit_v2) 
board, but ran into difficulties.

```bash
$ openocd
Open On-Chip Debugger 0.11.0-rc2
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Error: flash bank name 'nrf52.flash' already exists
Error: flash bank name 'nrf52.uicr' already exists
-4
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : Using CMSIS-DAPv2 interface with VID:PID=0x0d28:0x0204, 
serial=9904360258994e450062900c00000033000000009796990b
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: FW Version = 0255
Info : CMSIS-DAP: Serial# = 9904360258994e450062900c00000033000000009796990b
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x2ba01477
Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for nrf52.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Info : nRF52833-xxAA(build code: A0) 512kB Flash, 128kB RAM
undefined debug reason 8 - target needs reset
Polling target nrf52.cpu failed, trying to reexamine
Info : SWD DPIDR 0x2ba01477
Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
Polling target nrf52.cpu failed, trying to reexamine
Info : SWD DPIDR 0x2ba01477
Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: nrf52.cpu -- clearing lockup after double fault
Polling target nrf52.cpu failed, trying to reexamine
Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : dropped 'gdb' connection
Info : accepting 'gdb' connection on tcp/3333```

I would ignore the error messages, but `gdb` fails to run correctly:
```Reading symbols from 
../../target/thumbv7em-none-eabi/release/microbit_v2.elf...
(gdb) target extended-remote localhost:3333
Remote debugging using localhost:3333
0x0001ad90 in ?? ()```

I am running Debian 5.10.127-1 (2022-06-30) x86_64 GNU/Linux natively, with
```$ gdb-multiarch -v
GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git```

Am I doing something wrong? I would much appreciate your help!



---

Sent from sourceforge.net because openocd-devel@lists.sourceforge.net is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.


Reply via email to