This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrfjprog "Cannot connect to J-Link" though libjlinkarm.so.6.88.1 found

Hello Nordic Devzone Community,

My name is Ted, and I recently posted a question here regarding trouble when attempting to flash a Sparkfun Thing Plus nRF9160 board, using a Segger J-Link physical programmer and emulator.  This work taking place on an Ubuntu 20.04LTS host, with Nordic's sdk-nrf version 1.6.1 and associated tools installed.  At that time the programmer's 'runner' called by meta-tool `west` complained of a missing DLL.

Not sure what changed, as I did not solve that problem nor reinstall any Nordic tools.  Today upon retry I find the firmware flash process goes a little further.  Can a Devzone engineer tell me whether the following log file points to a specific issue I may fix?

 

```1 [2021-Sept-23 19:55:58] [ info] --------------------------------------------------------------------------------
  2 [2021-Sept-23 19:55:58] [ info] nrfjprog --program /var/local/guest/embedded/z3-aws-iot-stand-alone-work/kionix-driver-demo/build/zephyr/zephyr.hex --sectorerase -f NRF91 --snr 59104091 --log
  3 [2021-Sept-23 19:55:59] [ info] nrfjprog version 10.12.2
  4 [2021-Sept-23 19:55:59] [ info] --------------------------------------------------------------------------------
  5 [2021-Sept-23 19:55:59] [debug] [ nRF0x0] - open_dll
  6 [2021-Sept-23 19:55:59] [ info] [ nRF0x0] - Load library at /opt/nrfjprog/libjlinkarm_nrf91_nrfjprogdll.so.
  7 [2021-Sept-23 19:55:59] [ info] [ nRF0x0] - Library loaded, loading member functions.
  8 [2021-Sept-23 19:55:59] [ info] [ nRF0x0] - Member functions succesfully loaded.
  9 [2021-Sept-23 19:55:59] [ info] [Backend] - Logger callback at 0x559e5af45150 registered in Segger backend logger.
 10 [2021-Sept-23 19:55:59] [ info] [  JLink] - [Info    ] [JLink     ] Logger callback at 0x559e5af45150 registered in JLink logger.
 11 [2021-Sept-23 19:55:59] [debug] [nRF910x0] - open
 12 [2021-Sept-23 19:55:59] [debug] [Backend] - open_dll
 13 [2021-Sept-23 19:55:59] [ info] [Backend] - No J-Link DLL path was provided. Attempting to auto detect.
 14 [2021-Sept-23 19:55:59] [ info] [Backend] - Load library at /opt/SEGGER/JLink/libjlinkarm.so.6.88.1.
 15 [2021-Sept-23 19:55:59] [ info] [Backend] - Library loaded, loading member functions.
 16 [2021-Sept-23 19:55:59] [ info] [Backend] - Member functions succesfully loaded.
 17 [2021-Sept-23 19:55:59] [debug] [Backend] - dll_version
 18 [2021-Sept-23 19:55:59] [ info] [Backend] - Segger dll version 6.88.a loaded.
 19 [2021-Sept-23 19:55:59] [debug] [ nRF0x0] - enum_emu_snr
 20 [2021-Sept-23 19:55:59] [debug] [nRF910x0] - enum_emu_snr
 21 [2021-Sept-23 19:55:59] [debug] [Backend] - is_connected_to_emu
 22 [2021-Sept-23 19:55:59] [debug] [Backend] - enum_emu_snr
 23 [2021-Sept-23 19:55:59] [debug] [Backend] - ---just_enum_emu_snr
 24 [2021-Sept-23 19:55:59] [debug] [Backend] - ---just_get_num_emus
 25 [2021-Sept-23 19:55:59] [debug] [Backend] - is_connected_to_emu
 26 [2021-Sept-23 19:55:59] [debug] [ nRF0x0] - connect_to_emu_with_snr
 27 [2021-Sept-23 19:55:59] [debug] [nRF910x0] - connect_to_emu_with_snr
 28 [2021-Sept-23 19:55:59] [debug] [Backend] - is_connected_to_emu
 29 [2021-Sept-23 19:55:59] [debug] [Backend] - connect_to_emu_with_snr
 30 [2021-Sept-23 19:55:59] [debug] [Backend] - is_connected_to_emu
 31 [2021-Sept-23 19:55:59] [debug] [Backend] - ---just_enum_emu_snr
 32 [2021-Sept-23 19:55:59] [debug] [Backend] - ---just_get_num_emus
 33 [2021-Sept-23 19:55:59] [debug] [Backend] - ---just_connect_to_emu_with_snr
 34 [2021-Sept-23 19:55:59] [debug] [Backend] - ---just_connect_to_emu_without_snr
 35 [2021-Sept-23 19:55:59] [ info] [Backend] - Segger logging enabled.
 36 [2021-Sept-23 19:55:59] [ info] [  JLink] - [Info    ] [JLink     ]    ***** Error:
 37 [2021-Sept-23 19:55:59] [ info] [  JLink] - [Info    ] [JLink     ] Cannot connect to J-Link.
 38 [2021-Sept-23 19:55:59] [ info] [  JLink] - [Info    ] [JLink     ] - 73.403ms returns "Cannot connect to J-Link."
 39 [2021-Sept-23 19:55:59] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()
 40 [2021-Sept-23 19:55:59] [ info] [Backend] - JLinkARM.dll Open returned error 'Cannot connect to J-Link.'
 41 [2021-Sept-23 19:55:59] [debug] [Backend] - is_connected_to_emu
 42 [2021-Sept-23 19:55:59] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()
 43 [2021-Sept-23 19:55:59] [ info] [  JLink] - [Info    ] [JLink     ] - 0.003ms returns 0x00
 44 [2021-Sept-23 19:55:59] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()
 45 [2021-Sept-23 19:55:59] [debug] [ nRF0x0] - close_dll
 46 [2021-Sept-23 19:55:59] [debug] [nRF910x0] - close
 47 [2021-Sept-23 19:55:59] [debug] [Backend] - is_connected_to_emu
 48 [2021-Sept-23 19:55:59] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()
 49 [2021-Sept-23 19:55:59] [ info] [  JLink] - [Info    ] [JLink     ] - 0.003ms returns 0x00
 50 [2021-Sept-23 19:55:59] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()
 51 [2021-Sept-23 19:55:59] [debug] [Backend] - close
 52 [2021-Sept-23 19:55:59] [debug] [Backend] - disconnect_from_emu
 53 [2021-Sept-23 19:55:59] [debug] [Backend] - is_connected_to_emu
 54 [2021-Sept-23 19:55:59] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_IsOpen()
 55 [2021-Sept-23 19:55:59] [ info] [  JLink] - [Info    ] [JLink     ] - 0.003ms returns 0x00
 56 [2021-Sept-23 19:55:59] [ info] [  JLink] - [Info    ] [JLink     ] JLINK_HasError()
 57 [2021-Sept-23 19:55:59] [debug] [Backend] - Segger Backend closed.
 58 [2021-Sept-23 19:55:59] [debug] [nRF910x0] - nRF family DLL closed```

As an anecdote, I am able to flash a Zephyr based application via `west flash` to a Nordic nRF9160DK development board.  This board has a JLink programmer+debugger integrated within itself.  West's flash runner has actually detected when I have both the Segger JLink connected to the host computer, and the nRF9160DK.  In that set up `nrfjprog` prompts me for which programmer I wish to use to flash firmware.

Any help with above log.log file message appreciated!

- Ted

  • Hi,

     

    Your user does not seem to have access to your device.

    Are the udev rules present on your computer? It should be located in "/etc/udev/rules.d/99-jlink.rules".

    Have you rebooted (or reloaded udev rules) after installing the JLink driver? 

    As an anecdote, I am able to flash a Zephyr based application via `west flash` to a Nordic nRF9160DK development board.  This board has a JLink programmer+debugger integrated within itself.  West's flash runner has actually detected when I have both the Segger JLink connected to the host computer, and the nRF9160DK.  In that set up `nrfjprog` prompts me for which programmer I wish to use to flash firmware.

    nrfjprog --ids shows the correct one as well? Nothing in "dmesg" that suggests there should be any problems with the usb device?

     

    Kind regards,

    Håkon

  • Hi Håkon,

    JLink's udev rules by that very filename are installed.  I've rebooted a number of times since installing the driver, and on a Linux system like I am using I don't recall explicitly installing a JLink driver.  I assumed any driver got installed as part of the larger nRF Connect toolchain and SDK installation.

    I have not studied the full record of `dmesg`.  What kind of warnings or errors would I be looking for there?  Is it possible those errors would not name "JLink" itself, but refer only to the USB subsystem in more general or abstract ways?

    - Ted

  • Hi Ted,

     

    Which physical debugger are you using?

    Note that some older versions are unable to program Cortex M33 devices, as per segger's wiki page:

    https://wiki.segger.com/Software_and_Hardware_Features_Overview

     

    tedhavelka said:
    What kind of warnings or errors would I be looking for there?  Is it possible those errors would not name "JLink" itself, but refer only to the USB subsystem in more general or abstract ways?

    This was just a thought, but if do not see any highlights in red after plugging in the debugger, you should be fine.

      

    Kind regards,

    Håkon

Related