[SOLVED] J-Link Commander V6.14h on Ubuntu 16.04.2 LTS, cannot connect to nRF52832.

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] J-Link Commander V6.14h on Ubuntu 16.04.2 LTS, cannot connect to nRF52832.

    The board I am using is a nRF52 Development Kit hosting a nRF52832 SoC. The IC on the board has a label that says, "PCA10040, V1.1.1, 2017.1, then the S/N, (the same number that shows up in my troubleshooting.)"

    The ESD packaging that it came in has a label that says "nRF6827, REV. 1.1.1, 2016.50"

    I am connecting this laptop running Ubuntu
    16.04.2 LTS directly to the described dev board with a known working USB cable.

    To ensure that I have a good USB connection I run the command -

    Source Code

    1. $ udevadm monitor --udev
    2. monitor will print the received events for:
    3. UDEV - the event which udev sends out after rule processing

    Once I plug in my nRF52 Development Kit hosting a nRF52832 SoC the following is reported.

    Source Code

    1. UDEV [23412.778469] add /devices/pci0000:00/0000:00:14.0/usb2/2-2 (usb)
    2. UDEV [23412.782643] add /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0 (usb)
    3. UDEV [23412.785210] add /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.2 (usb)
    4. UDEV [23412.789422] add /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.1 (usb)
    5. UDEV [23412.789521] add /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3 (usb)
    6. UDEV [23412.794049] add /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/tty/ttyACM0 (tty)
    7. UDEV [23412.794827] add /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/host2 (scsi)
    8. UDEV [23412.796541] add /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/host2/scsi_host/host2 (scsi_host)
    9. UDEV [23413.726790] add /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/host2/target2:0:0 (scsi)
    10. UDEV [23413.729526] add /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/host2/target2:0:0/2:0:0:0 (scsi)
    11. UDEV [23413.729823] add /devices/virtual/bdi/8:16 (bdi)
    12. UDEV [23413.731263] add /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/host2/target2:0:0/2:0:0:0/scsi_device/2:0:0:0 (scsi_device)
    13. UDEV [23413.732545] add /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/host2/target2:0:0/2:0:0:0/scsi_disk/2:0:0:0 (scsi_disk)
    14. UDEV [23413.734212] add /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/host2/target2:0:0/2:0:0:0/bsg/2:0:0:0 (bsg)
    15. UDEV [23413.734784] add /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/host2/target2:0:0/2:0:0:0/scsi_generic/sg2 (scsi_generic)
    16. UDEV [23413.961929] add /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/host2/target2:0:0/2:0:0:0/block/sdb (block)
    Display All

    It shows up in my file system.

    Source Code

    1. $ df
    2. Filesystem 1K-blocks Used Available Use% Mounted on
    3. udev 1966792 0 1966792 0% /dev
    4. tmpfs 397592 11412 386180 3% /run
    5. /dev/sda8 31419336 5790332 24009908 20% /
    6. tmpfs 1987956 328 1987628 1% /dev/shm
    7. tmpfs 5120 4 5116 1% /run/lock
    8. tmpfs 1987956 0 1987956 0% /sys/fs/cgroup
    9. /dev/sda2 262144 116396 145748 45% /boot/efi
    10. tmpfs 397592 76 397516 1% /run/user/1000
    11. /dev/sda4 428977836 202403180 226574656 48% /media/damon/Windows
    12. /dev/sdb 10848 128 10720 2% /media/damon/JLINK
    Display All

    It's listed as a USB device.

    Source Code

    1. $ lsusb
    2. Bus 001 Device 007: ID 04f3:038a Elan Microelectronics Corp.
    3. Bus 001 Device 003: ID 0bda:5776 Realtek Semiconductor Corp.
    4. Bus 001 Device 002: ID 8087:8000 Intel Corp.
    5. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    6. Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    7. Bus 002 Device 007: ID 1366:1015 SEGGER
    8. Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    fdisk shows the folowing.

    Source Code

    1. $ sudo fdisk -l
    2. Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
    3. Units: sectors of 1 * 512 = 512 bytes
    4. Sector size (logical/physical): 512 bytes / 4096 bytes
    5. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    6. Disklabel type: gpt
    7. Disk identifier: BA386137-15CC-4947-A5CF-EF2F2297A474
    8. Device Start End Sectors Size Type
    9. /dev/sda1 2048 1333247 1331200 650M Windows recovery environment
    10. /dev/sda2 1333248 1865727 532480 260M EFI System
    11. /dev/sda3 1865728 2127871 262144 128M Microsoft reserved
    12. /dev/sda4 2127872 860083551 857955680 409.1G Microsoft basic data
    13. /dev/sda5 927193088 928948223 1755136 857M Windows recovery environment
    14. /dev/sda6 928948224 976762879 47814656 22.8G Microsoft basic data
    15. /dev/sda7 860084224 863084543 3000320 1.4G Linux swap
    16. /dev/sda8 863084544 927193087 64108544 30.6G Linux filesystem
    17. Partition table entries are not in disk order.
    18. Disk /dev/sdb: 10.7 MiB, 11176448 bytes, 21829 sectors
    19. Units: sectors of 1 * 512 = 512 bytes
    20. Sector size (logical/physical): 512 bytes / 512 bytes
    21. I/O size (minimum/optimal): 512 bytes / 512 bytes
    22. Disklabel type: dos
    23. Disk identifier: 0x00000000
    Display All

    Also, I can see the files on the device.

    Source Code

    1. damon@Violet:/media/damon/JLINK$ ls
    2. MBED.HTM README.TXT Segger.html User Guide.html

    But when I call JLinkExe I get this.

    Source Code

    1. $ JLinkExe
    2. SEGGER J-Link Commander V6.14h (Compiled May 10 2017 18:39:45)
    3. DLL version V6.14h, compiled May 10 2017 18:39:37
    4. Connecting to J-Link via USB...FAILED: Can not connect to J-Link via USB.

    To trobleshoot further, I tried the following J-Link commands

    Source Code

    1. J-Link>usb
    2. Connecting to J-Link via USB...FAILED: Can not connect to J-Link via USB.
    3. J-Link>usb 2
    4. Connecting to J-Link via USB...FAILED: Can not connect to J-Link via USB.
    5. J-Link>usb 0
    6. Connecting to J-Link via USB...FAILED: Can not connect to J-Link via USB.
    7. J-Link>usb 1
    8. Connecting to J-Link via USB...FAILED: Can not connect to J-Link via USB.
    9. J-Link>usb 3
    10. Connecting to J-Link via USB...FAILED: Can not connect to J-Link via USB.
    11. J-Link>ShowEmuList
    12. J-Link[0]: Connection: USB, Serial number: {S/N redacted}, ProductName: J-Link OB-SAM3U128-V2-NordicSem
    13. J-Link>selemu
    14. J-Link[0]: Connection: USB, Serial number: {S/N redacted}, ProductName: J-Link OB-SAM3U128-V2-NordicSem
    15. Select emulator index: 0
    16. Connecting to J-Link via USB...FAILED: Can not connect to J-Link via USB.
    17. J-Link>SelectEmuBySN {S/N redacted}
    18. Connecting to J-Link via USB...FAILED: Can not connect to J-Link via USB.
    19. J-Link>
    Display All


    I have also tried using another dev board with the same results.

    Is there something else I should try? Is this a known issue given the this particular set up?
  • A college suggested I should try -

    Source Code

    1. $ sudo JLinkExe
    That solved it! I don't know why I didn't think of it before. I am familiar with privileges being an issue on the Raspberry Pi and having to run anything sudo to get access to H/W. I think they fixed that on a recent Raspbian release though. It didn't occur to me that Ubuntu might also have this "feature". Dohhhpe (as Homer would say while smacking forehead with palm). :cursing: :rolleyes:
  • Hi,


    thanks for your inquiry and sorry for the delay in response.
    Normally it should work without root privileges.

    There is an open issue regarding the udev-rules not working on all system / under all circumstances.
    I hope I will have the time to look at this next week.


    Best regards,
    Niklas
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Workaround for Ubuntu 16.04:

    Create file /etc/udev/rules.d/98-jlink.rules with the following content


    SUBSYSTEM=="usb", ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1015", MODE="664", GROUP="plugdev"

    idProduct can be found using:

    Source Code

    1. $ lsusb |grep SEGGERBus 001 Device 011: ID 1366:1015 SEGGER



    You also need to be a member of GROUP plugdev in order for it to work. Restart using:

    Source Code

    1. $ sudo udevadm control --reload




    Unpower/power your dev board, and observe that the device node has the correct permissions applied.


    Note that this bug also affect Segger embedded studio causing it to crash during start-up, because the permissions to JLink device node is incorrect.
  • Hi Forum,


    this issue has been fixed in version 6.16c of the J-Link software & documentation pack.


    Best regards,
    Niklas
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.