unlocking NRF52480

Dear all,

I have pca10059 nrf52480 dongle which I accidentally erased and I could not upload any elf file to run moreover it was not blinking red anymore, no presence in system.

I managed to restore the bootloader with this procedure:

https://devzone.nordicsemi.com/f/nordic-q-a/87495/nrf52480-dongle-bricked-after-recover-in-openocd/365842

Thenafter, the dongle started to flash red again and I could flash the dongle with my custom blinky example and the diode was blinking again.

The problem I am facing now is, I want to have a look at the running process via OpenOCD, but anytime I start openocd with this command:

openocd -f rpi_as_debugger.cfg -c "transport select swd" -c "adapter speed 100" -f target/nrf52.cfg

I get following problem:

(THE DONGLE IS RUNNING JUST FINE, I CAN SEE THE DIODE BLINKING, BUT AFTER FIRMWARE RESTORATION, IT SEEMS THE CHIP IS LOCKED, BUT WHY? AFTER I RECEIVED THE DONGLE FROM MOUSER, I COULD EASILY DEBUG THE SAME EXAMPLE AND OPENOCD WAS NOT PRINTING ANY PROBLEM, ANYWAY I AM USING SWD OVER RASPBERRY)

Is the chip detecting any internal error at startup being the reason it gets locked?

Open On-Chip Debugger 0.11.0+dev-00651-g9de084e00 (2022-04-24-10:22)
Licensed under GNU GPL v2
For bug reports, read
openocd.org/.../bugs.html
BCM2835 GPIO nums: swclk = 24, swdio = 25

swd
adapter speed: 100 kHz

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : BCM2835 GPIO JTAG/SWD bitbang driver
Info : clock speed 1001 kHz
Info : SWD DPIDR 0x2ba01477
Error: [nrf52.cpu] Could not find MEM-AP to control the core
****** WARNING ******
nRF52 device has AP lock engaged (see UICR APPROTECT register).
Debug access is denied.
Use 'nrf52_recover' to erase and unlock the device.

Warn : target nrf52.cpu examination failed
Info : starting gdb server for nrf52.cpu on 3333
Info : Listening on port 3333 for gdb connections

During firmware restoration, I was also facing this, which I haven't a clue what it might be:

Warn : [nrf52.cpu] target was in unknown state when halt was requested
Info : SWD DPIDR 0x2ba01477
Error: Wrong parity detected

Thank you

Parents
  • Is it related to this?

    devzone.nordicsemi.com/.../working-with-the-nrf52-series-improved-approtect

    Regarding this info from OpenOCD printout:

    SWD DPIDR 0x2ba01477

    Is it related to the fact I read somewhere that the chip is running in low power mode and I have to set up some appropriate registers?

    I assumed that when flashing Nordic official bootloader via openOCD I return the entire firmware of nrf52480 dongle to factory settings.

    Do I have to update something more than a bootloader?Is it necessary to update some more firmware and is it possible that when erasing everything and flashing the Nordic bootloader the up-to-date bootloader hex file has a routine which automatically locks the dongle cpu preventing it from being debugged?

    If I make a backup of another dongle with older firmware and reflash my broken dongle with this older backup?Would it prevent if from locking?I assume that all the default settings for the hardware to run are stored somewhere in chip memory therefore erasing and reflashing must definitely resolve the issue or does it mean that by reflashing bootloader some chunk of the internal memory is untouched and the settings for the hardware to run are untouched when flashing new bootloader?

    If so,is there any firmware to flash apart from the bootloader hex file?I only found the bootloader hex file,anything else.

Reply
  • Is it related to this?

    devzone.nordicsemi.com/.../working-with-the-nrf52-series-improved-approtect

    Regarding this info from OpenOCD printout:

    SWD DPIDR 0x2ba01477

    Is it related to the fact I read somewhere that the chip is running in low power mode and I have to set up some appropriate registers?

    I assumed that when flashing Nordic official bootloader via openOCD I return the entire firmware of nrf52480 dongle to factory settings.

    Do I have to update something more than a bootloader?Is it necessary to update some more firmware and is it possible that when erasing everything and flashing the Nordic bootloader the up-to-date bootloader hex file has a routine which automatically locks the dongle cpu preventing it from being debugged?

    If I make a backup of another dongle with older firmware and reflash my broken dongle with this older backup?Would it prevent if from locking?I assume that all the default settings for the hardware to run are stored somewhere in chip memory therefore erasing and reflashing must definitely resolve the issue or does it mean that by reflashing bootloader some chunk of the internal memory is untouched and the settings for the hardware to run are untouched when flashing new bootloader?

    If so,is there any firmware to flash apart from the bootloader hex file?I only found the bootloader hex file,anything else.

Children
No Data
Related