This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nrf52480 dongle bricked after recover in OpenOCD

Dear all,

I am facing similar issue. found in this thread:

devzone.nordicsemi.com/.../364579

I used openOCD running on Raspberry Pi to debug nrf52480 dongle with Eclipse and  but I experience some problems not being able to run my code on the dongle when pressing build in Eclipse. Nevertheless after removing the dongle from my Raspberry and plugging in again, the LED on dongle started to flash RED which looked ok again, but the openOCD offered me to enter command nrf52_recover. After this command the dongle stopped working. I probably erased the firmware which must be recovered. I am experiencing voltage 2.9V on C27,does that mean it could still be recovered? In this post the guy had 0V cross C27.If so, is it necessary to use J-link or any other probe to upload the firmware or is there any other way when having 2.9V across C27?

Thank you

  • Actually, the error when running openOCD is this:

    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

    I triend to unlock the device via command:

    openocd -f rpi_as_debugger.cfg -c "transport select swd" -c "adapter speed 100" -c "init nrf52.dap apreg 1 0x0C reset"

    or

    openocd -f rpi_as_debugger.cfg -c "transport select swd" -c "adapter speed 100" -c "init nrf52.dap apreg 1 0x04 0x01 reset"

    but no success

  • Hello,

    I managed to do it!

    This managed to unlock the device (make sure you have set up OpenOCD on Raspberry properly to be able to communicate via SWD):

    sudo openocd -f rpi_as_debugger.cfg -c "transport select swd" -f target/nrf52.cfg -c "init;nrf52_recover"

    or this:

    sudo openocd -f rpi_as_debugger.cfg -c "transport select swd" -f target/nrf52.cfg -c "init; nrf52.dap apreg 1 0x0c; nrf52.dap apreg 1 0x04 0x01; reset; nrf5 mass_erase; reset; shutdown;"

    Now I do not know which one is the right one, probably the first one. I guess both do quite simmilar job, but one of them was not working properly.

    But still I could not see the red LED flashing.

    Entering this command fixed it all:

    sudo openocd -c 'bindto 0.0.0.0' -f rpi_as_debugger.cfg -c 'transport select swd' -c 'adapter speed 100' -f target/nrf52.cfg -c 'init' -c 'halt' -c 'nrf5 mass_erase' -c 'program a.hex verify' -c 'reset'

    a.hex is this file (the official Nordic firmware for pca10059): /cfs-file/__key/communityserver-discussions-components-files/4/1373.pca10059_5F00_bootloader.zip

    Then unplugged the dongle, plugged in and restarted OpenOCD and works like a charm back again!

    Please could anyone verify this way as a correct way?

    Thank you

Related