nrfjprog shows ERROR: Unable to connect to a debugger

Trying to evaluate Nordic nRF52840 but it refuses to work.

nrfjprog -f nrf52 --sectorerase --program build/nrf52840/dk/hello-world.hex
[error] [ Client] - Encountered error -105: Command connect_to_emu_with_snr executed for 217 milliseconds with result -105
ERROR: Unable to connect to a debugger.
[error] [ Worker] - JLinkARM.dll Open returned error 'Cannot connect to J-Link.'
ERROR: The JLinkARM DLL timed out while communicating to the J-Link probe.
ERROR: If the error condition persists, run the same command again with
ERROR: argument -- log, contact Nordic Semiconductor and provide the generated
ERROR: 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.

Adding `--log` creates an empty `log.log` file. And I'm not finding error 105 in the docs.

The following does not work either

nrfjprog --recover
[error] [ Client] - Encountered error -105: Command connect_to_emu_with_snr executed for 264 milliseconds with result -105
ERROR: Unable to connect to a debugger.
[error] [ Worker] - JLinkARM.dll Open returned error 'Cannot connect to J-Link.'
ERROR: The JLinkARM DLL timed out while communicating to the J-Link probe.
ERROR: If the error condition persists, run the same command again with
ERROR: argument -- log, contact Nordic Semiconductor and provide the generated
ERROR: 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.

Details on the environment:

nrfjprog -v
nrfjprog version: 10.22.0 external
JLinkARM.dll version: 7.80c

running on Ubuntu 22.04.2 LTS

Parents
  • Hi,

    There are several options you could try.
    1. replace your current USB cable which you use for connecting the board with Ubuntu computer
    2. use Ubuntu 20.04 LTS where NCS tools should always work as described in supporting OS documentation
    3. ensure that your nRF52840-dk device is visible by running the command "nrfjprog --com"
    4. use "west flash --recover" instead of "nrfjprog --recover"
    5. completely remove current build folder from your system, build the sample again and flash it to the board

    Please let me know if any of these potential solution options resolved the issue.

    Best regards,
    Dejan

  • Thank you for the detailed reply.

    I am very interested in learning what is error 105. Can you please help with that?

    Following on your suggestions:

    1. Different cables, different boards, and different USB ports of the computer -- all produce the same results (I tried that before opening the ticket).

    2. Downgrading Ubuntu will be time consuming. I will leave that as the last resort.

    3. 

    nrfjprog --com
    1050232358    /dev/ttyACM1    VCOM1
    1050232358    /dev/ttyACM0    VCOM0

    The following also works:

    nrfjprog --ids --expand
    ---------- Emulators ----------
    serial number:      1050245438
    connection type:    USB
    -------------------------------

    4. TBD.

    5. Did not help.

    I understand that Ubuntu 22.04 is not officially approved yet. However, migrating to 20.04 will be time consuming and giving that the board is visible to above `nrfjprog` commands, I was wondering if you can think about another solution.

Reply
  • Thank you for the detailed reply.

    I am very interested in learning what is error 105. Can you please help with that?

    Following on your suggestions:

    1. Different cables, different boards, and different USB ports of the computer -- all produce the same results (I tried that before opening the ticket).

    2. Downgrading Ubuntu will be time consuming. I will leave that as the last resort.

    3. 

    nrfjprog --com
    1050232358    /dev/ttyACM1    VCOM1
    1050232358    /dev/ttyACM0    VCOM0

    The following also works:

    nrfjprog --ids --expand
    ---------- Emulators ----------
    serial number:      1050245438
    connection type:    USB
    -------------------------------

    4. TBD.

    5. Did not help.

    I understand that Ubuntu 22.04 is not officially approved yet. However, migrating to 20.04 will be time consuming and giving that the board is visible to above `nrfjprog` commands, I was wondering if you can think about another solution.

Children
  • Hi,

    Did your device work properly in the past? Was there any change introduced that could cause this behavior?

    Which version of nRF Command Line Tools did you use?

    Rahav said:
    Different cables, different boards, and different USB ports of the computer -- all produce the same results (I tried that before opening the ticket).

    Could you specify different types of boards that you used? Are those of the same family? Did you use boards with the same version number (this is the number on the board's sticker)?

    Rahav said:
    4. TBD.

    It could be useful to know the result of "west flash --recover" command.

    Best regards,
    Dejan

  • nrfjprog -v
    nrfjprog version: 10.22.0 external
    JLinkARM.dll version: 7.80c

    I have been evaluating two boards, nRF52840-DK and nRF5340-DK. They both fail.

    The board version numbers:

       nRF52840-DK:

          PCA10056

          3.0.1

          2023.14

          1050232358

       mRF5340-DK:

          PCA10095

          2.0.1

          2023.15

          1050070107

    I installed `west` but it refuses to work:

    pip3 install --user -U west
    Collecting west
      Downloading west-1.1.0-py3-none-any.whl (92 kB)
    ...
    Installing collected packages: docopt, ruamel.yaml.clib, colorama, ruamel.yaml, pykwalify, west
    Successfully installed colorama-0.4.6 docopt-0.6.2 pykwalify-1.8.0 ruamel.yaml-0.17.32 ruamel.yaml.clib-0.2.7 west-1.1.0

    and

    west flash --recover
    usage: west [-h] [-z ZEPHYR_BASE] [-v] [-V] <command> ...
    west: unknown command "flash"; do you need to run this inside a workspace?

  • Hi,

    Rahav said:
    I am very interested in learning what is error 105. Can you please help with that?

    The error 105 is a timeout error and this error should be fixed by power cycling the device.

    dejans said:
    Did your device work properly in the past? Was there any change introduced that could cause this behavior?

    Which version of nRF Command Line Tools did you use?

    Did you have your devices working in the past?
    You can find information about nRF Command Line Tools on the Products page.

    How did you install nRF Connect SDK?

    Best regards,
    Dejan

  • The problem was solved by https://github.com/pjonsson. When the nRF commands run from the Contiki-NG OS container, and the nRF tools are not installed on the host OS, it will fail as I reported. The solution is to install the tools on the host. This makes the Contiki container, not fully ready, or not self contained and ready to benefit from Nordic motes, but it work.

    Until the problem is fixed, to use Nordic motes with Contiki OS, one must install the nRF tools also outside of the container, on the host OS. Following are the instructions to doing so:

    On the host computer (not inside the Contiki container), download the version for your host OS from Nordic nRF Command Line Tools. Then,

    Install it:

    sudo dpkg -i Downloads/nrf-command-line-tools_10.23.0_amd64.deb
    

    Install SEGGER J-Link:

    sudo apt install /opt/nrf-command-line-tools/share/JLink_Linux_V788j_x86_64.deb --fix-broken

    Maybe  can shed some light on the reasons for that, or inform about future plans to fix this.

  • Hi,

    Thank you for providing your solution.

    Best regards,
    Dejan

Related