Re-flash Interface ICU Code on nRF52840 DevKit

I have been developing for several years with the nRF52832 and 52840 devkits. I have several of each available. One specific 52840 dk seems to have crashed code in the interface MCU. I found a thread several years old discussing how to re-flash the code, but the links there are all broken. Also, they all mention an IF reset/boot button, and i see no such item on my board. How should I go about re-flashing the IF MCU firmware?

  • Hello,

    Are you sure you don't have an IF BOOT/RESET button on your nRF52840 DK? Is it a devkit from Nordic Semiconductor, or a 3rd party DK? If it is a Nordic DK it should be here:

    I guess a lot of these links are broken after we migrated to the new layout for nordicsemi.com.

    However, if it is in fact the Nordic DK, you can find the IF MCU FW under the download section on the DK page on nordicsemi.com:

    https://www.nordicsemi.com/Products/Development-hardware/nRF52840-DK/Download?lang=en#infotabs

    So to repeat the guide:

    1. power off the DK

    2. hold IF BOOT/RESET while you power on the DK and note LED5 (next to the IF MCU) blinking.

    3. Drag and drop the FW from the link above into the "BOOTLOADER" device that pops up.

    4: wait for the copy to finish, and note the LED5 blinking faster

    5. Power off the DK and power it back on (without holding IF BOOT/RESET this time).

    Best regards,

    Edvin

  • It is indeed the Nordic devkit board, same one in your picture. I thought that reset button was just the nRF52840 reset. I used to laugh at folk who complained about the itty-bitty text I would squeeze into tight places like that - not so much any more, with my bifocals.

    LED5 flickered briefly and then appeared to be on steady. Below is the journal from nRF Connect VS Code. After the first attempt I tried using west, but it's not in the system path so I used nrfjprog --recover instead, which appeared to work. Then I made two more attempts, performing the suggested corrections. Still no joy. What am I missing?

    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: Flashing file: d:\304\FW\Hook\examples\ble_central\multi-NUS-master\build\zephyr\zephyr.hex
    ERROR: The operation attempted is unavailable due to readback protection in
    ERROR: your device. Please use --recover to unlock the device.
    ERROR: runners.nrfjprog: Flashing failed because the target must be recovered.
      To fix, run "west flash --recover" instead.
      Note: this will recover and erase all flash memory prior to reflashing.
    FATAL ERROR: command exited with status 16: nrfjprog --program 'd:\304\FW\Hook\examples\ble_central\multi-NUS-master\build\zephyr\zephyr.hex' --sectoranduicrerase -f NRF52 --snr 1050267783
    The terminal process terminated with exit code: 16.

    Terminal will be reused by tasks, press any key to close it.

    > Executing task: nRF Connect: Build: multi-NUS-master/build (active) <

    Building multi-NUS-master
    west build --build-dir d:\304\FW\Hook\examples\ble_central\multi-NUS-master\build d:\304\FW\Hook\examples\ble_central\multi-NUS-master

    ninja: no work to do.

    Terminal will be reused by tasks, press any key to close it.

    > Executing task: nRF Connect: Flash: multi-NUS-master/build (active) <

    Flashing build to undefined
    west flash -d d:\304\FW\Hook\examples\ble_central\multi-NUS-master\build --skip-rebuild -r nrfjprog --dev-id 1050267783

    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: Flashing file: d:\304\FW\Hook\examples\ble_central\multi-NUS-master\build\zephyr\zephyr.hex
    Parsing image file.
    ERROR: The file specified is not a valid hex file, has data outside valid areas
    ERROR: or does not have data in valid areas.
    FATAL ERROR: command exited with status 52: nrfjprog --program 'd:\304\FW\Hook\examples\ble_central\multi-NUS-master\build\zephyr\zephyr.hex' --sectoranduicrerase -f NRF52 --snr 1050267783
    The terminal process terminated with exit code: 52.

    Terminal will be reused by tasks, press any key to close it.

    > Executing task: nRF Connect: Flash: multi-NUS-master/build (active) <

    Flashing build to undefined
    west flash -d d:\304\FW\Hook\examples\ble_central\multi-NUS-master\build --skip-rebuild -r nrfjprog --dev-id 1050267783 --recover

    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: Recovering and erasing all flash memory.
    Recovering device. This operation might take 30s.
    Writing image to disable ap protect.
    Erasing user code and UICR flash areas.
    -- runners.nrfjprog: Flashing file: d:\304\FW\Hook\examples\ble_central\multi-NUS-master\build\zephyr\zephyr.hex
    Parsing image file.
    ERROR: The file specified is not a valid hex file, has data outside valid areas
    ERROR: or does not have data in valid areas.
    FATAL ERROR: command exited with status 52: nrfjprog --program 'd:\304\FW\Hook\examples\ble_central\multi-NUS-master\build\zephyr\zephyr.hex' --sectoranduicrerase -f NRF52 --snr 1050267783
    The terminal process terminated with exit code: 52.

    Terminal will be reused by tasks, press any key to close it.

  • Hello,

    Sorry for the late reply. I was out of office last week. 

    What version of nrfjprog do you have? Can you please try to update to the latest version? (I see that you have a DK with the new serial numbers (starting with 10...). Perhaps nrfjprog doesn't recognize that serial number. 

    I am using nRF Command Line Tools version 10.15.4, so try using that (I believe this is currently the latest version).

    Can you please show me how you created the project that you are trying to flash? Either the initial build command or the project setup in VS Code.  And are you trying to flash this using the nRF Connect for VS Code, or through the command line?

    Also, is it possible to upload the .hex file that you are trying to flash here, so that I can have a look at what it is trying to flash. What area that it claims is outside the flash? It may be a bug where it doesn't recognize the UICR area, but that should succeed despite the programmer some times say that it is outside the flash. But I am not sure what area it refers to just by looking at the log.

    BR,
    Edvin

  • It looks like that did the trick (new version of nrfjprog), so we can close this thread now. Thank you for the help.

Related