Issue flashing firmware

Hello.

I have been successfully flashing the nrf52840 dongle using the nrfjprog comand. I have been successfully able to reset and erase as well. Recently however, none of my boards have been able to flash, erase or reset. Here is the error that it presents:

[error] [ Client] - Encountered error -5: Command read_device_info executed for 6 milliseconds with result -5

[error] [ Worker] - Encountered unexpected debug port ID 0, expected 2

[error] [ Client] - Encountered error -11: Command read_memory_descriptors executed for 2150 milliseconds with result -11

Failed to read device memories.

[error] [  nRF52] - Device memory generation failed.

[error] [ Worker] - Could not connect to CPU core. This may indicate that AP protection is enabled.

An unknown error.

ERROR: Cannot connect to any nRF device. Please make sure a device is

ERROR: connected to the debugger and supplied.

NOTE: For additional output, try running again with logging enabled (--log).

NOTE: Any generated log error messages will be displayed.

Any help will be appreciated.

Thanks.

Parents
  • Hi Colby!

    It sounds like you’ve run into a common issue when working with the nRF52840 dongle. The error you’re seeing (unexpected debug port ID 0, expected 2 and Could not connect to CPU core) typically points to one of two main causes:

     1. Access Port (AP) protection enabled
    This happens when the device has had AP (Access Port) protection set, preventing further debug access. To fix this, you might need to use Recover mode instead of Erase.
    Try this command:

    css
    nrfjprog --recover -f nrf52 dummynation

    This will attempt to reset the device to a state where you can re-flash it.

     2. Hardware or connection issue
    Double-check:

    • Are your USB cables and connections reliable?

    • If using a debugger (like J-Link), is it firmly attached?

    • Try re-plugging the dongle or using a different USB port.

    • Consider updating your nrfjprog tool and SEGGER J-Link drivers.

    If the above doesn’t work, enable detailed logging for further insight:

    css
    nrfjprog --recover -f nrf52 --log

    This might show you more specific clues about what’s failing.

Reply
  • Hi Colby!

    It sounds like you’ve run into a common issue when working with the nRF52840 dongle. The error you’re seeing (unexpected debug port ID 0, expected 2 and Could not connect to CPU core) typically points to one of two main causes:

     1. Access Port (AP) protection enabled
    This happens when the device has had AP (Access Port) protection set, preventing further debug access. To fix this, you might need to use Recover mode instead of Erase.
    Try this command:

    css
    nrfjprog --recover -f nrf52 dummynation

    This will attempt to reset the device to a state where you can re-flash it.

     2. Hardware or connection issue
    Double-check:

    • Are your USB cables and connections reliable?

    • If using a debugger (like J-Link), is it firmly attached?

    • Try re-plugging the dongle or using a different USB port.

    • Consider updating your nrfjprog tool and SEGGER J-Link drivers.

    If the above doesn’t work, enable detailed logging for further insight:

    css
    nrfjprog --recover -f nrf52 --log

    This might show you more specific clues about what’s failing.

Children
No Data
Related