I'm building a nrfmicro bluetooth keyboard controller which uses an ebyte E73-2G4M08S1C nrf52840. My programmer is cmsis dap link. Openocd verson is 0.11.0.
Unlock is fine using command nrf52.dap apreg 1 0x04 0x01
openocd -d2 -f interface/cmsis-dap.cfg -f target/nrf52.cfg -c "init" -c "nrf52.dap apreg 1 0x04 0x01" -c "exit"
############## unlock output omitted
openocd -d2 -f interface/cmsis-dap.cfg -f target/nrf52.cfg -c "init" -c "nrf52.dap apreg 1 0x04" -c "exit"
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Serial# = 205526554555
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
0x00000001
When flash nrf bootloader according to nrfmicro wiki, or Adafruit nRF52 Bootloader pca10056_bootloader-0.6.3_s140_6.1.1.hex, got error
openocd -d2 -f interface/cmsis-dap.cfg -f target/nrf52.cfg -c "init" -c "program ./bootloader.hex verify reset exit"
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: FW Version = 2.0.0
Info : CMSIS-DAP: Serial# = 205526554555
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
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000a80 msp: 0x20000400
** Programming Started **
Info : nRF52840-xxAA(build code: D0) 1024kB Flash, 256kB RAM
Info : Padding image section 0 at 0x00000b00 with 1280 bytes
Info : Flash write discontinued at 0x00025de8, next section at 0x000f4000
Warn : Adding extra erase range, 0x00025de8 .. 0x00025fff
Info : SWD DPIDR 0x2ba01477
Error: Failed to write memory at 0x20002024
Error: Failed to write to nrf5 flash
Error: error writing to flash at address 0x00000000 at offset 0x00000000
** Programming Failed **
shutdown command invoked
Here is the full debug level 3 log
7774.nrfmicro_bootloader_log.txt