Daily Weekly Monthly

Daily Shaarli

All links of one day in a single page.

January 22, 2020

Problem Flashing nrf52 chip using Openocd - Stack Overflow

I have a custom nrf52 chip on a pcb with swd pins exposed. I have cloned and installed the latest openocd from https://github.com/ntfreak/openocd. The latest version includes all the latest pathes ...

micooke/arduino-nRF5-smartwatches: Smartwatch variants for sandeepmistry's Nordic Semiconductor nRF5 core

To share my experience with the nRF52832.
I was unable to disable the read protection / flash lock with a BMP or ST-Link V2, but i was successful with a J-Link.

When nRF52832 chip is read protected / locked, the first step is to try:
nrfjprog –recover -f nrf52

This performs the same task as:

Jlink -if swd -device nrf52
J-Link>SWDSelect
J-Link>SWDWriteDP 1, 0x50000000
J-Link>SWDWriteDP 2, 0x01000000
J-Link>SWDWriteAP 1, 0x00000001

Wait until AP 2 is 0, and the operation is complete
J-Link>SWDReadAP 2

If two successive reads from AP 3 produce 0, then 1 then protection is disabled
J-Link>SWDReadAP 3
J-Link>SWDReadAP 3

Tested with JLink v6.20b