Encountered error -102: Unable to connect to a debugger.

Hi!
Recently, I tried putting my nrf9160dk into SYSTEM OFF mode. The code instantly puts it into SYSTEM OFF mode and waits for a gpio interrupt. The problem however is that the code for some reason does not work and the board is stuck in SYSTEM OFF mode. So i tried reflashing it but when i use west flash i get this error:

[error] [ Client] - Encountered error -102: Command read_device_info executed for 136 milliseconds with result -102
[error] [ Worker] - An unknown error.
[error] [ Client] - Encountered error -102: Command read_memory_descriptors executed for 33 milliseconds with result -102
Failed to read device memories.
[error] [ Worker] - An unknown error.
ERROR: JLinkARM DLL reported an error. Try again. If error condition
ERROR: persists, run the same command again with argument --log, contact Nordic
ERROR: Semiconductor and provide the generated log.log file to them.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.
FATAL ERROR: command exited with status 33: nrfjprog --program /home/raytoningu/flox_zephyr_workspace/ws/apps/deepsleep_test/build/zephyr/merged.hex --sectorerase --verify -f NRF91 --snr 960083536

If i try things like nrfjprog --recover i get a similar error:

[error] [ Client] - Encountered error -102: Command connect_to_emu_with_snr executed for 674 milliseconds with result -102
ERROR: Unable to connect to a debugger.
[error] [ Worker] - An unknown error.
ERROR: JLinkARM DLL reported an error. Try again. If error condition
ERROR: persists, run the same command again with argument --log, contact Nordic
ERROR: Semiconductor and provide the generated log.log file to them.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.



I know that the board is stuck in deepsleep since the measured current is around 2 microampere. What can I do to reset the board?

Parents
  • Hi,

    nRF9160-dk has Reset button onboard. You should ensure that the PROG/DEBUG switch (SW10) in put into nRF91 position and then you can look at SW5 in the nRF9160-dk User Guide

    Are you able to update DK firmware using Programmer application?

    Best regards,
    Dejan

  • Thank you for the help! Unfortunately it didn't work. I tried resetting with the button and using the Programmer but just selecting my device gives me this error:

    09:58:29.767	Getting serial port options from the persistent store for 000960083536.pc-nrfconnect-programmer
    09:58:50.339	Selecting device with the serial number 000960083536
    09:58:51.581	Error: Failed with exit code 1. Failed to device info one or more devices: * 960083536: [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1), code: Generic. Message: Operation device-info failed, [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1).
    09:58:51.582	Selected device with the serial number 000960083536
    09:58:51.582	Using nrfutil device to communicate with target via JLink
    09:58:52.741	Reading readback protection status for Application core
    09:58:52.741	Failed "reading readback protection status for application core". Error: code: 1, description: Generic, message: Batch task protection-get failed, [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1)
    09:58:52.836	Error: Failed with exit code 1. One or more batch tasks failed: - [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1), code: Generic. Message: Batch task protection-get failed, [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1).
    09:58:52.836	Error: Failed with exit code 1. One or more batch tasks failed: - [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1), code: Generic. Message: Batch task protection-get failed, [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1).


    clicking erase all gives me the same error.

  • Hi,

    You can try to use nrfutil. You can follow this guide for programming the device and find more information in this blog.

    Best regards,
    Dejan

  • Thanks for the help again,

    It might be that a hardware fault has ocurred on the board because even when i try to erase with nrfutil I get this error:

    ❌ Failed to erase 960083536, [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1)
    Error: One or more erase tasks failed:
     * 960083536: [Probe] Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1), code: Generic
    

    All of these errors are quite vague making it harder for me to debug it.

  • Hi,

    Which command did you use when you got "Device error: Failed to write DebugPort register 2: Unknown Error in J-Link DLL (error code =-1), code: Generic"?

    Can your board be erased using Programmer tool?

    Best regards,
    Dejan

  • Hello,

    This was the command

    nrfutil device erase --serial-number 960083536


    It also cannot be erased using the Programmer tool.

Reply Children
  • Hi,

    Thank you for additional information.

    Which specific version of the nrf9160-dk device do you use?

    Recently, I tried putting my nrf9160dk into SYSTEM OFF mode. The code instantly puts it into SYSTEM OFF mode and waits for a gpio interrupt. The problem however is that the code for some reason does not work and the board is stuck in SYSTEM OFF mode.

    Can you elaborate on this? Please provide detailed information about your application and the steps you took to put your device to SYSTEM OFF mode.

    Best regards,
    Dejan

Related