Saturday, December 16th 2017, 9:40pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

damonmbaker

Beginner

Date of registration: May 30th 2017

Posts: 2

1

Tuesday, May 30th 2017, 4:23pm

[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
2
3
$ udevadm monitor --udev
monitor will print the received events for:
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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
UDEV  [23412.778469] add  	/devices/pci0000:00/0000:00:14.0/usb2/2-2 (usb)
UDEV  [23412.782643] add  	/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0 (usb)
UDEV  [23412.785210] add  	/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.2 (usb)
UDEV  [23412.789422] add  	/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.1 (usb)
UDEV  [23412.789521] add  	/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3 (usb)
UDEV  [23412.794049] add  	/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/tty/ttyACM0 (tty)
UDEV  [23412.794827] add  	/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/host2 (scsi)
UDEV  [23412.796541] add  	/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/host2/scsi_host/host2 (scsi_host)
UDEV  [23413.726790] add  	/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.3/host2/target2:0:0 (scsi)
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)
UDEV  [23413.729823] add  	/devices/virtual/bdi/8:16 (bdi)
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)
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)
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)
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)
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)

It shows up in my file system.

Source code

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

It's listed as a USB device.

Source code

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

fdisk shows the folowing.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$ sudo fdisk -l
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: BA386137-15CC-4947-A5CF-EF2F2297A474

Device     	Start   	End   Sectors   Size Type
/dev/sda1   	2048   1333247   1331200   650M Windows recovery environment
/dev/sda2	1333248   1865727	532480   260M EFI System
/dev/sda3	1865728   2127871	262144   128M Microsoft reserved
/dev/sda4	2127872 860083551 857955680 409.1G Microsoft basic data
/dev/sda5  927193088 928948223   1755136   857M Windows recovery environment
/dev/sda6  928948224 976762879  47814656  22.8G Microsoft basic data
/dev/sda7  860084224 863084543   3000320   1.4G Linux swap
/dev/sda8  863084544 927193087  64108544  30.6G Linux filesystem

Partition table entries are not in disk order.

Disk /dev/sdb: 10.7 MiB, 11176448 bytes, 21829 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Also, I can see the files on the device.

Source code

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

But when I call JLinkExe I get this.

Source code

1
2
3
4
5
$ JLinkExe
SEGGER J-Link Commander V6.14h (Compiled May 10 2017 18:39:45)
DLL version V6.14h, compiled May 10 2017 18:39:37

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


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?

damonmbaker

Beginner

Date of registration: May 30th 2017

Posts: 2

2

Thursday, June 1st 2017, 1:41pm

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:

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

3

Thursday, June 1st 2017, 2:00pm

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
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link

HolyDiver

Beginner

Date of registration: Sep 1st 2016

Posts: 5

4

Thursday, June 8th 2017, 4:50pm

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.

Date of registration: Nov 25th 2012

Posts: 26

5

Sunday, June 11th 2017, 2:34am

See Invalid syntax in /etc/udev/rules.d/99-jlink.rules from JLink_Linux_V614f_x86_64.deb for the open issue Niklas was referring to. The issue contains a workaround for all supported devices.

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

6

Friday, June 23rd 2017, 7:15pm

Hi Forum,


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


Best regards,
Niklas
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link