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 Ray,

    We see that the error happens very early thus preventing nrfjprog and nrfutil to work properly. Since your firmware sleeps for 1 second, there might be just enough time for you to potentially run "nrfjprog --halt" right after you power the board to block the firmware from going to SYSTEM OFF. If this works, you should be able to run "nrfjprog --erase" and "nrfjprog --recover" commands.
    To prevent the board from setting SYSTEM OFF, you could try to run the script 

    #!/bin/bash
    while true; do
       nrfjprog --halt
    done

    without any boards connected, and then connecting the board could potentially work.

    Best regards,
    Dejan


  • Hi,
    I tried your helpful tip however it unfortunately still didn't work. I started the script before connecting the board and the log is continuously saying that it doesn't find a debugger (as it should) but as soon as i connect the board i get the same error as the title of this thread again. Here is the log just before and after i connect the board.

    ERROR: No debuggers were discovered.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.
    ERROR: No debuggers were discovered.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.
    [error] [ Client] - Encountered error -102: Command connect_to_emu_with_snr executed for 518 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.
    [error] [ Client] - Encountered error -102: Command connect_to_emu_with_snr executed for 164 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.

    Do you think it's bricked?

    Best,

    Ray


  • Hi Ray,

    There is a chapter in the documentation which specifies what needs to be done before entering SYSTEM OFF mode. Have you fulfilled all mentioned preconditions for entering SYSTEM OFF mode?

    Best regards,
    Dejan

  • I finally found the problem... The shunt/jumper at p22 on the nrf9160DK was off since i wanted to measure the current. Putting it back on resolved it and i can now flash the board like normal. Thanks for all the help!

  • Hi Ray,

    RayCali said:
    I finally found the problem... The shunt/jumper at p22 on the nrf9160DK was off since i wanted to measure the current. Putting it back on resolved it and i can now flash the board like normal. Thanks for all the help!

    This is great to hear. Thank you for the status update.

    Best regards,
    Dejan

Reply Children
No Data
Related