Problem flashing Xenon with OpenOCD

Hi - this is similar to this...

...but I didn't want to bump it after all this time, so tagging @nrobinson2000 in case he has any insights.

Basically, I have what I think is a bricked Xenon - no LED, no serial, can't put it into any mode with the buttons. I have probed round the board with a multimeter and all the voltages seem ok.

So I thought I would try to re-flash the bootloader incase it was corrupt?

First I installed openocd from homebrew and ran the following command:

openocd -f interface/cmsis-dap.cfg -f target/nrf52.cfg -c "init; program /Users/mhazley/Downloads/1.4.3/xenon/release/xenon-bootloader@1.4.3.bin 0xf4000 verify reset exit"

This resulted in the following error (same as @nrobinson2000 in linked thread)

Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
adapter speed: 10000 kHz
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 1.10
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : reduce speed request: 10000kHz to 5000kHz maximum
Info : clock speed 10000 kHz
Info : SWD DPIDR 0x2ba01477
Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000998 msp: 0x20000400
** Programming Started **
** Programming Failed **
shutdown command invoked
embedded:startup.tcl:512: Error:
in procedure 'flash' called at file "embedded:startup.tcl", line 512

So, as the guys did in the linked thread, I built openocd from source - I tired master and the version at the commit used in the linked thread, in both cases I get the same error:

Open On-Chip Debugger 0.10.0+dev-00620-g02279e2f (2019-11-27-09:21)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
embedded:startup.tcl:21: Error: target requires -dap parameter instead of -chain-position!
in procedure 'script'
at file "embedded:startup.tcl", line 60
in procedure 'target' called at file "target/nrf52.cfg", line 22
in procedure 'ocd_bouncer'
at file "embedded:startup.tcl", line 21

So, I did some digging around on that and found a web-page noting that this was something to do with the way the scripts have been changed in openocd - I started going down into the .cfg files but I honestly got a bit lost (not familiar with openocd that much).

Anyone come across this issue? Or know a way around it...?

Deeply sorry - I just noticed there is a file called target/nrf52-particle.cfg

Going back to the 0.10.0 release of openocd and using the command:

openocd -f interface/cmsis-dap.cfg -f target/nrf52-particle.cfg -c "init; program /Users/mhazley/Downloads/1.4.3/xenon/release/xenon-bootloader@1.4.3.bin 0xf4000 verify reset exit"

It all works… well… hopefully this helps someone!

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.