[SOLVED] Invalid syntax in /etc/udev/rules.d/99-jlink.rules from JLink_Linux_V614f_x86_64.deb

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

  • [SOLVED] Invalid syntax in /etc/udev/rules.d/99-jlink.rules from JLink_Linux_V614f_x86_64.deb

    I recently installed JLink_Linux_V614f_x86_64.deb in Debian Debian GNU/Linux 8.7 (jessie), and discovered that the udev rules never take effect. After some tweaking I have found the following:
    • The file has quite a few Windows newlines in it, which makes those rules be ignored
    • A lot of rules have e.g. ATTR{idProduct}=="0x1001", while the correct format is ATTR{idProduct}=="1001", without the "0x"
    • SUBSYSTEM!="usb_device" should probably be changed to either SUBSYSTEM!="usb" or DEVTYPE!="usb_device"

    After making those changes my devices get the correct permissions. I have attached a version of the file which works for me: 99-jlink.rules.txt.

    If anyone is testing this at home, a good way of verifying your changes is to run udevadm test --action=add $(udevadm info -q path -n /dev/bus/usb/001/010), where /dev/bus/usb/001/010 is the device name of your J-Link. As soon as the output starts mentioning MODE 0666 you can reload your udev rules using udevadm control --reload.
  • Hi,


    thanks for your inquiry.
    The file has quite a few Windows newlines in it, which makes those rules be ignored.

    I just gave it a try and indeed, this seems wrong.

    A lot of rules have e.g. ATTR{idProduct}=="0x1001", while the correct format is ATTR{idProduct}=="1001", without the "0x"
    SUBSYSTEM!="usb_device" should probably be changed to either SUBSYSTEM!="usb" or DEVTYPE!="usb_devic


    When running the rules you provided, i get the same output as with the original rules file with corrected line ending, except for one warning.

    SEGGER rules output:

    Source Code

    1. calling: test
    2. version 215
    3. load module index
    4. Network interface NamePolicy= disabled on kernel commandline, ignoring.
    5. timestamp of '/etc/systemd/network' changed
    6. timestamp of '/lib/systemd/network' changed
    7. Parsed configuration file /lib/systemd/network/99-default.link
    8. Created link configuration context.
    9. timestamp of '/etc/udev/rules.d' changed
    10. read rules file: /lib/udev/rules.d/39-usbmuxd.rules
    11. read rules file: /lib/udev/rules.d/40-usb-media-players.rules
    12. read rules file: /lib/udev/rules.d/40-usb_modeswitch.rules
    13. read rules file: /lib/udev/rules.d/42-usb-hid-pm.rules
    14. read rules file: /lib/udev/rules.d/50-bluetooth-hci-auto-poweron.rules
    15. read rules file: /lib/udev/rules.d/50-firmware.rules
    16. read rules file: /lib/udev/rules.d/50-udev-default.rules
    17. read rules file: /lib/udev/rules.d/55-Argyll.rules
    18. read rules file: /lib/udev/rules.d/55-dm.rules
    19. read rules file: /lib/udev/rules.d/56-hpmud.rules
    20. read rules file: /lib/udev/rules.d/60-cdrom_id.rules
    21. read rules file: /lib/udev/rules.d/60-crda.rules
    22. read rules file: /lib/udev/rules.d/60-drm.rules
    23. read rules file: /lib/udev/rules.d/60-fuse.rules
    24. read rules file: /lib/udev/rules.d/60-gnupg.rules
    25. read rules file: /lib/udev/rules.d/60-keyboard.rules
    26. read rules file: /lib/udev/rules.d/60-libgphoto2-6.rules
    27. read rules file: /lib/udev/rules.d/60-libsane.rules
    28. read rules file: /lib/udev/rules.d/60-persistent-alsa.rules
    29. read rules file: /lib/udev/rules.d/60-persistent-input.rules
    30. read rules file: /lib/udev/rules.d/60-persistent-serial.rules
    31. read rules file: /lib/udev/rules.d/60-persistent-storage-dm.rules
    32. read rules file: /lib/udev/rules.d/60-persistent-storage-tape.rules
    33. read rules file: /lib/udev/rules.d/60-persistent-storage.rules
    34. read rules file: /lib/udev/rules.d/60-persistent-v4l.rules
    35. read rules file: /lib/udev/rules.d/61-accelerometer.rules
    36. read rules file: /lib/udev/rules.d/61-gnome-bluetooth-rfkill.rules
    37. read rules file: /lib/udev/rules.d/61-gnome-settings-daemon-rfkill.rules
    38. read rules file: /lib/udev/rules.d/64-btrfs.rules
    39. read rules file: /lib/udev/rules.d/64-xorg-xkb.rules
    40. read rules file: /lib/udev/rules.d/69-cd-sensors.rules
    41. read rules file: /lib/udev/rules.d/69-libmtp.rules
    42. read rules file: /lib/udev/rules.d/69-wacom.rules
    43. read rules file: /lib/udev/rules.d/69-xorg-vmmouse.rules
    44. read rules file: /lib/udev/rules.d/70-power-switch.rules
    45. read rules file: /lib/udev/rules.d/70-printers.rules
    46. read rules file: /lib/udev/rules.d/70-uaccess.rules
    47. read rules file: /lib/udev/rules.d/71-seat.rules
    48. read rules file: /lib/udev/rules.d/73-idrac.rules
    49. read rules file: /lib/udev/rules.d/73-seat-late.rules
    50. read rules file: /lib/udev/rules.d/75-net-description.rules
    51. read rules file: /lib/udev/rules.d/75-persistent-net-generator.rules
    52. read rules file: /lib/udev/rules.d/75-probe_mtd.rules
    53. read rules file: /lib/udev/rules.d/75-tty-description.rules
    54. read rules file: /lib/udev/rules.d/77-mm-cinterion-port-types.rules
    55. read rules file: /lib/udev/rules.d/77-mm-ericsson-mbm.rules
    56. read rules file: /lib/udev/rules.d/77-mm-huawei-net-port-types.rules
    57. read rules file: /lib/udev/rules.d/77-mm-longcheer-port-types.rules
    58. read rules file: /lib/udev/rules.d/77-mm-mtk-port-types.rules
    59. read rules file: /lib/udev/rules.d/77-mm-nokia-port-types.rules
    60. read rules file: /lib/udev/rules.d/77-mm-pcmcia-device-blacklist.rules
    61. read rules file: /lib/udev/rules.d/77-mm-platform-serial-whitelist.rules
    62. read rules file: /lib/udev/rules.d/77-mm-qdl-device-blacklist.rules
    63. read rules file: /lib/udev/rules.d/77-mm-simtech-port-types.rules
    64. read rules file: /lib/udev/rules.d/77-mm-telit-port-types.rules
    65. read rules file: /lib/udev/rules.d/77-mm-usb-device-blacklist.rules
    66. read rules file: /lib/udev/rules.d/77-mm-usb-serial-adapters-greylist.rules
    67. read rules file: /lib/udev/rules.d/77-mm-x22x-port-types.rules
    68. read rules file: /lib/udev/rules.d/77-mm-zte-port-types.rules
    69. read rules file: /lib/udev/rules.d/77-nm-olpc-mesh.rules
    70. read rules file: /lib/udev/rules.d/78-sound-card.rules
    71. read rules file: /lib/udev/rules.d/80-drivers.rules
    72. read rules file: /lib/udev/rules.d/80-mm-candidate.rules
    73. read rules file: /lib/udev/rules.d/80-net-setup-link.rules
    74. read rules file: /lib/udev/rules.d/80-networking.rules
    75. read rules file: /lib/udev/rules.d/80-udisks2.rules
    76. read rules file: /lib/udev/rules.d/85-hplj10xx.rules
    77. read rules file: /lib/udev/rules.d/85-hwclock.rules
    78. read rules file: /lib/udev/rules.d/85-regulatory.rules
    79. read rules file: /lib/udev/rules.d/90-alsa-restore.rules
    80. read rules file: /lib/udev/rules.d/90-libgpod.rules
    81. read rules file: /lib/udev/rules.d/90-pulseaudio.rules
    82. read rules file: /lib/udev/rules.d/95-cd-devices.rules
    83. read rules file: /lib/udev/rules.d/95-udev-late.rules
    84. read rules file: /lib/udev/rules.d/95-upower-csr.rules
    85. read rules file: /lib/udev/rules.d/95-upower-hid.rules
    86. read rules file: /lib/udev/rules.d/95-upower-wup.rules
    87. read rules file: /lib/udev/rules.d/97-hid2hci.rules
    88. read rules file: /etc/udev/rules.d/99-jlink.rules
    89. read rules file: /lib/udev/rules.d/99-systemd.rules
    90. rules contain 393216 bytes tokens (32768 * 12 bytes), 34250 bytes strings
    91. 34514 strings (280894 bytes), 30903 de-duplicated (250256 bytes), 3612 trie nodes used
    92. IMPORT builtin 'usb_id' /lib/udev/rules.d/50-udev-default.rules:9
    93. IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:9
    94. MODE 0664 /lib/udev/rules.d/50-udev-default.rules:41
    95. IMPORT builtin 'hwdb' /lib/udev/rules.d/55-Argyll.rules:88
    96. PROGRAM 'mtp-probe /sys/devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb2/2-1 2 2' /lib/udev/rules.d/69-libmtp.rules:1429
    97. starting 'mtp-probe /sys/devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb2/2-1 2 2'
    98. 'mtp-probe /sys/devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb2/2-1 2 2'(out) '0'
    99. 'mtp-probe /sys/devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb2/2-1 2 2' [5315] exit with return code 0
    100. MODE 0666 /etc/udev/rules.d/99-jlink.rules:46
    101. handling device node '/dev/bus/usb/002/002', devnum=c189:129, mode=0666, uid=0, gid=0
    102. preserve permissions /dev/bus/usb/002/002, 020666, uid=0, gid=0
    103. preserve already existing symlink '/dev/char/189:129' to '../bus/usb/002/002'
    104. unable to create temporary db file '/run/udev/data/c189:129.tmp': Permission denied
    105. unload module index
    106. Unloaded link configuration context.
    107. This program is for debugging only, it does not run any program
    108. specified by a RUN key. It may show incorrect results, because
    109. some values may be different, or not available at a simulation run.
    110. ACTION=add
    111. BUSNUM=002
    112. DEVNAME=/dev/bus/usb/002/002
    113. DEVNUM=002
    114. DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb2/2-1
    115. DEVTYPE=usb_device
    116. DRIVER=usb
    117. ID_BUS=usb
    118. ID_MODEL=J-Link
    119. ID_MODEL_ENC=J-Link
    120. ID_MODEL_ID=0105
    121. ID_REVISION=0100
    122. ID_SERIAL=SEGGER_J-Link_000600101939
    123. ID_SERIAL_SHORT=000600101939
    124. ID_USB_INTERFACES=:020201:0a0000:ffffff:
    125. ID_VENDOR=SEGGER
    126. ID_VENDOR_ENC=SEGGER
    127. ID_VENDOR_FROM_DATABASE=SEGGER
    128. ID_VENDOR_ID=1366
    129. MAJOR=189
    130. MINOR=129
    131. PRODUCT=1366/105/100
    132. SUBSYSTEM=usb
    133. TYPE=239/2/1
    134. USEC_INITIALIZED=389856711
    Display All


    Your rules output:

    Source Code

    1. calling: test
    2. version 215
    3. load module index
    4. Network interface NamePolicy= disabled on kernel commandline, ignoring.
    5. timestamp of '/etc/systemd/network' changed
    6. timestamp of '/lib/systemd/network' changed
    7. Parsed configuration file /lib/systemd/network/99-default.link
    8. Created link configuration context.
    9. timestamp of '/etc/udev/rules.d' changed
    10. read rules file: /lib/udev/rules.d/39-usbmuxd.rules
    11. read rules file: /lib/udev/rules.d/40-usb-media-players.rules
    12. read rules file: /lib/udev/rules.d/40-usb_modeswitch.rules
    13. read rules file: /lib/udev/rules.d/42-usb-hid-pm.rules
    14. read rules file: /lib/udev/rules.d/50-bluetooth-hci-auto-poweron.rules
    15. read rules file: /lib/udev/rules.d/50-firmware.rules
    16. read rules file: /lib/udev/rules.d/50-udev-default.rules
    17. read rules file: /lib/udev/rules.d/55-Argyll.rules
    18. read rules file: /lib/udev/rules.d/55-dm.rules
    19. read rules file: /lib/udev/rules.d/56-hpmud.rules
    20. read rules file: /lib/udev/rules.d/60-cdrom_id.rules
    21. read rules file: /lib/udev/rules.d/60-crda.rules
    22. read rules file: /lib/udev/rules.d/60-drm.rules
    23. read rules file: /lib/udev/rules.d/60-fuse.rules
    24. read rules file: /lib/udev/rules.d/60-gnupg.rules
    25. read rules file: /lib/udev/rules.d/60-keyboard.rules
    26. read rules file: /lib/udev/rules.d/60-libgphoto2-6.rules
    27. read rules file: /lib/udev/rules.d/60-libsane.rules
    28. read rules file: /lib/udev/rules.d/60-persistent-alsa.rules
    29. read rules file: /lib/udev/rules.d/60-persistent-input.rules
    30. read rules file: /lib/udev/rules.d/60-persistent-serial.rules
    31. read rules file: /lib/udev/rules.d/60-persistent-storage-dm.rules
    32. read rules file: /lib/udev/rules.d/60-persistent-storage-tape.rules
    33. read rules file: /lib/udev/rules.d/60-persistent-storage.rules
    34. read rules file: /lib/udev/rules.d/60-persistent-v4l.rules
    35. read rules file: /lib/udev/rules.d/61-accelerometer.rules
    36. read rules file: /lib/udev/rules.d/61-gnome-bluetooth-rfkill.rules
    37. read rules file: /lib/udev/rules.d/61-gnome-settings-daemon-rfkill.rules
    38. read rules file: /lib/udev/rules.d/64-btrfs.rules
    39. read rules file: /lib/udev/rules.d/64-xorg-xkb.rules
    40. read rules file: /lib/udev/rules.d/69-cd-sensors.rules
    41. read rules file: /lib/udev/rules.d/69-libmtp.rules
    42. read rules file: /lib/udev/rules.d/69-wacom.rules
    43. read rules file: /lib/udev/rules.d/69-xorg-vmmouse.rules
    44. read rules file: /lib/udev/rules.d/70-power-switch.rules
    45. read rules file: /lib/udev/rules.d/70-printers.rules
    46. read rules file: /lib/udev/rules.d/70-uaccess.rules
    47. read rules file: /lib/udev/rules.d/71-seat.rules
    48. read rules file: /lib/udev/rules.d/73-idrac.rules
    49. read rules file: /lib/udev/rules.d/73-seat-late.rules
    50. read rules file: /lib/udev/rules.d/75-net-description.rules
    51. read rules file: /lib/udev/rules.d/75-persistent-net-generator.rules
    52. read rules file: /lib/udev/rules.d/75-probe_mtd.rules
    53. read rules file: /lib/udev/rules.d/75-tty-description.rules
    54. read rules file: /lib/udev/rules.d/77-mm-cinterion-port-types.rules
    55. read rules file: /lib/udev/rules.d/77-mm-ericsson-mbm.rules
    56. read rules file: /lib/udev/rules.d/77-mm-huawei-net-port-types.rules
    57. read rules file: /lib/udev/rules.d/77-mm-longcheer-port-types.rules
    58. read rules file: /lib/udev/rules.d/77-mm-mtk-port-types.rules
    59. read rules file: /lib/udev/rules.d/77-mm-nokia-port-types.rules
    60. read rules file: /lib/udev/rules.d/77-mm-pcmcia-device-blacklist.rules
    61. read rules file: /lib/udev/rules.d/77-mm-platform-serial-whitelist.rules
    62. read rules file: /lib/udev/rules.d/77-mm-qdl-device-blacklist.rules
    63. read rules file: /lib/udev/rules.d/77-mm-simtech-port-types.rules
    64. read rules file: /lib/udev/rules.d/77-mm-telit-port-types.rules
    65. read rules file: /lib/udev/rules.d/77-mm-usb-device-blacklist.rules
    66. read rules file: /lib/udev/rules.d/77-mm-usb-serial-adapters-greylist.rules
    67. read rules file: /lib/udev/rules.d/77-mm-x22x-port-types.rules
    68. read rules file: /lib/udev/rules.d/77-mm-zte-port-types.rules
    69. read rules file: /lib/udev/rules.d/77-nm-olpc-mesh.rules
    70. read rules file: /lib/udev/rules.d/78-sound-card.rules
    71. read rules file: /lib/udev/rules.d/80-drivers.rules
    72. read rules file: /lib/udev/rules.d/80-mm-candidate.rules
    73. read rules file: /lib/udev/rules.d/80-net-setup-link.rules
    74. read rules file: /lib/udev/rules.d/80-networking.rules
    75. read rules file: /lib/udev/rules.d/80-udisks2.rules
    76. read rules file: /lib/udev/rules.d/85-hplj10xx.rules
    77. read rules file: /lib/udev/rules.d/85-hwclock.rules
    78. read rules file: /lib/udev/rules.d/85-regulatory.rules
    79. read rules file: /lib/udev/rules.d/90-alsa-restore.rules
    80. read rules file: /lib/udev/rules.d/90-libgpod.rules
    81. read rules file: /lib/udev/rules.d/90-pulseaudio.rules
    82. read rules file: /lib/udev/rules.d/95-cd-devices.rules
    83. read rules file: /lib/udev/rules.d/95-udev-late.rules
    84. read rules file: /lib/udev/rules.d/95-upower-csr.rules
    85. read rules file: /lib/udev/rules.d/95-upower-hid.rules
    86. read rules file: /lib/udev/rules.d/95-upower-wup.rules
    87. read rules file: /lib/udev/rules.d/97-hid2hci.rules
    88. read rules file: /etc/udev/rules.d/99-jlink.rules
    89. unknown key 'DEVTYPE' in /etc/udev/rules.d/99-jlink.rules:9
    90. invalid rule '/etc/udev/rules.d/99-jlink.rules:9'
    91. read rules file: /lib/udev/rules.d/99-systemd.rules
    92. rules contain 393216 bytes tokens (32768 * 12 bytes), 34035 bytes strings
    93. 34512 strings (280775 bytes), 30926 de-duplicated (250327 bytes), 3587 trie nodes used
    94. IMPORT builtin 'usb_id' /lib/udev/rules.d/50-udev-default.rules:9
    95. IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:9
    96. MODE 0664 /lib/udev/rules.d/50-udev-default.rules:41
    97. IMPORT builtin 'hwdb' /lib/udev/rules.d/55-Argyll.rules:88
    98. PROGRAM 'mtp-probe /sys/devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb2/2-1 2 2' /lib/udev/rules.d/69-libmtp.rules:1429
    99. starting 'mtp-probe /sys/devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb2/2-1 2 2'
    100. 'mtp-probe /sys/devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb2/2-1 2 2'(out) '0'
    101. 'mtp-probe /sys/devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb2/2-1 2 2' [5344] exit with return code 0
    102. MODE 0666 /etc/udev/rules.d/99-jlink.rules:46
    103. handling device node '/dev/bus/usb/002/002', devnum=c189:129, mode=0666, uid=0, gid=0
    104. preserve permissions /dev/bus/usb/002/002, 020666, uid=0, gid=0
    105. preserve already existing symlink '/dev/char/189:129' to '../bus/usb/002/002'
    106. unable to create temporary db file '/run/udev/data/c189:129.tmp': Permission denied
    107. unload module index
    108. Unloaded link configuration context.
    109. This program is for debugging only, it does not run any program
    110. specified by a RUN key. It may show incorrect results, because
    111. some values may be different, or not available at a simulation run.
    112. ACTION=add
    113. BUSNUM=002
    114. DEVNAME=/dev/bus/usb/002/002
    115. DEVNUM=002
    116. DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:03.0/usb2/2-1
    117. DEVTYPE=usb_device
    118. DRIVER=usb
    119. ID_BUS=usb
    120. ID_MODEL=J-Link
    121. ID_MODEL_ENC=J-Link
    122. ID_MODEL_ID=0105
    123. ID_REVISION=0100
    124. ID_SERIAL=SEGGER_J-Link_000600101939
    125. ID_SERIAL_SHORT=000600101939
    126. ID_USB_INTERFACES=:020201:0a0000:ffffff:
    127. ID_VENDOR=SEGGER
    128. ID_VENDOR_ENC=SEGGER
    129. ID_VENDOR_FROM_DATABASE=SEGGER
    130. ID_VENDOR_ID=1366
    131. MAJOR=189
    132. MINOR=129
    133. PRODUCT=1366/105/100
    134. SUBSYSTEM=usb
    135. TYPE=239/2/1
    136. USEC_INITIALIZED=389856711
    Display All


    What it the expected result?
    What was the output for you when using your rules file?

    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
  • SEGGER - Niklas wrote:

    When running the rules you provided, i get the same output as with the original rules file with corrected line ending, except for one warning.

    SEGGER - Niklas wrote:

    What it the expected result?
    What was the output for you when using your rules file?

    Let's go over these one by one and I'll explain my reasoning.

    A lot of rules have e.g. ATTR{idProduct}=="0x1001", while the correct format is ATTR{idProduct}=="1001", without the "0x"

    Its not unlikely that this one is version dependent, and that the "0x" worked at the time it was originally written. I get this output with the 0x format:

    Source Code

    1. root@obelisk:~# udevadm test --action=add $(udevadm info -q path -n /dev/bus/usb/001/015)
    2. calling: test
    3. version 215
    4. This program is for debugging only, it does not run any program
    5. specified by a RUN key. It may show incorrect results, because
    6. some values may be different, or not available at a simulation run.
    7. load module index
    8. Network interface NamePolicy= disabled on kernel commandline, ignoring.
    9. timestamp of '/etc/systemd/network' changed
    10. timestamp of '/lib/systemd/network' changed
    11. Parsed configuration file /lib/systemd/network/99-default.link
    12. Created link configuration context.
    13. timestamp of '/etc/udev/rules.d' changed
    14. read rules file: /lib/udev/rules.d/39-usbmuxd.rules
    15. [shortened to avoid exceeding the maximum post length]
    16. read rules file: /etc/udev/rules.d/ols.rules
    17. rules contain 393216 bytes tokens (32768 * 12 bytes), 34800 bytes strings
    18. 34598 strings (282174 bytes), 30961 de-duplicated (251012 bytes), 3638 trie nodes used
    19. IMPORT builtin 'usb_id' /lib/udev/rules.d/50-udev-default.rules:9
    20. IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:9
    21. MODE 0664 /lib/udev/rules.d/50-udev-default.rules:41
    22. RUN '/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}' /etc/udev/rules.d/60-vboxdrv.rules:5
    23. PROGRAM 'mtp-probe /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2 1 15' /lib/udev/rules.d/69-libmtp.rules:1429
    24. starting 'mtp-probe /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2 1 15'
    25. 'mtp-probe /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2 1 15'(out) '0'
    26. 'mtp-probe /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2 1 15' [1085] exit with return code 0
    27. handling device node '/dev/bus/usb/001/015', devnum=c189:14, mode=0664, uid=0, gid=0
    28. preserve permissions /dev/bus/usb/001/015, 020664, uid=0, gid=0
    29. preserve already existing symlink '/dev/char/189:14' to '../bus/usb/001/015'
    30. ACTION=add
    31. BUSNUM=001
    32. DEVNAME=/dev/bus/usb/001/015
    33. DEVNUM=015
    34. DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-2
    35. DEVTYPE=usb_device
    36. DRIVER=usb
    37. ID_BUS=usb
    38. ID_MODEL=J-Link
    39. ID_MODEL_ENC=J-Link
    40. ID_MODEL_ID=1015
    41. ID_REVISION=0100
    42. ID_SERIAL=SEGGER_J-Link_000682912069
    43. ID_SERIAL_SHORT=000682912069
    44. ID_USB_INTERFACES=:020201:0a0000:ffffff:080650:
    45. ID_VENDOR=SEGGER
    46. ID_VENDOR_ENC=SEGGER
    47. ID_VENDOR_FROM_DATABASE=SEGGER
    48. ID_VENDOR_ID=1366
    49. MAJOR=189
    50. MINOR=14
    51. PRODUCT=1366/1015/100
    52. SUBSYSTEM=usb
    53. TYPE=239/2/1
    54. USEC_INITIALIZED=378852601074
    55. run: '/usr/lib/virtualbox/VBoxCreateUSBNode.sh 189 14 ef'
    56. unload module index
    57. Unloaded link configuration context.
    Display All


    If I remove the "0x", I get this:

    Source Code

    1. root@obelisk:~# udevadm test --action=add $(udevadm info -q path -n /dev/bus/usb/001/015)
    2. calling: test
    3. version 215
    4. load module index
    5. Network interface NamePolicy= disabled on kernel commandline, ignoring.
    6. timestamp of '/etc/systemd/network' changed
    7. timestamp of '/lib/systemd/network' changed
    8. Parsed configuration file /lib/systemd/network/99-default.link
    9. Created link configuration context.
    10. timestamp of '/etc/udev/rules.d' changed
    11. read rules file: /lib/udev/rules.d/39-usbmuxd.rules
    12. [shortened to avoid exceeding the maximum post length]
    13. read rules file: /etc/udev/rules.d/ols.rules
    14. rules contain 393216 bytes tokens (32768 * 12 bytes), 34585 bytes strings
    15. 34598 strings (282080 bytes), 30986 de-duplicated (251108 bytes), 3613 trie nodes used
    16. IMPORT builtin 'usb_id' /lib/udev/rules.d/50-udev-default.rules:9
    17. IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:9
    18. MODE 0664 /lib/udev/rules.d/50-udev-default.rules:41
    19. RUN '/usr/lib/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass}' /etc/udev/rules.d/60-vboxdrv.rules:5
    20. PROGRAM 'mtp-probe /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2 1 15' /lib/udev/rules.d/69-libmtp.rules:1429
    21. starting 'mtp-probe /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2 1 15'
    22. 'mtp-probe /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2 1 15'(out) '0'
    23. 'mtp-probe /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2 1 15' [1188] exit with return code 0
    24. MODE 0666 /etc/udev/rules.d/99-jlink.rules:128
    25. handling device node '/dev/bus/usb/001/015', devnum=c189:14, mode=0666, uid=0, gid=0
    26. set permissions /dev/bus/usb/001/015, 020666, uid=0, gid=0
    27. preserve already existing symlink '/dev/char/189:14' to '../bus/usb/001/015'
    28. unload module index
    29. Unloaded link configuration context.
    30. This program is for debugging only, it does not run any program
    31. specified by a RUN key. It may show incorrect results, because
    32. some values may be different, or not available at a simulation run.
    33. ACTION=add
    34. BUSNUM=001
    35. DEVNAME=/dev/bus/usb/001/015
    36. DEVNUM=015
    37. DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-2
    38. DEVTYPE=usb_device
    39. DRIVER=usb
    40. ID_BUS=usb
    41. ID_MODEL=J-Link
    42. ID_MODEL_ENC=J-Link
    43. ID_MODEL_ID=1015
    44. ID_REVISION=0100
    45. ID_SERIAL=SEGGER_J-Link_000682912069
    46. ID_SERIAL_SHORT=000682912069
    47. ID_USB_INTERFACES=:020201:0a0000:ffffff:080650:
    48. ID_VENDOR=SEGGER
    49. ID_VENDOR_ENC=SEGGER
    50. ID_VENDOR_FROM_DATABASE=SEGGER
    51. ID_VENDOR_ID=1366
    52. MAJOR=189
    53. MINOR=14
    54. PRODUCT=1366/1015/100
    55. SUBSYSTEM=usb
    56. TYPE=239/2/1
    57. USEC_INITIALIZED=378852601074
    58. run: '/usr/lib/virtualbox/VBoxCreateUSBNode.sh 189 14 ef'
    Display All


    You'll notice that these are almost identical, but the latter says "MODE 0666 /etc/udev/rules.d/99-jlink.rules:128" while the former does not. What this tells me is that ATTR{idProduct}=="1015" successfully matched my J-Link and set the permissions to 0666, while ATTR{idProduct}=="0x1015" did not.

    We appear to be using the same version of udev. However, looking at your output, the device you are testing with has ID_MODEL_ID=0105. This model ID is not affected by my proposed change, since the block of "old format" model IDs didn't have 0x in them in the original file either. My change only affects debuggers using the new format for the model ID, like the one included on the nRF52-DK I am currently playing with.

    SUBSYSTEM!="usb_device" should probably be changed to either SUBSYSTEM!="usb" or DEVTYPE!="usb_devic

    This one wouldn't show any visible difference during this test, since it is only used in this code:

    Source Code

    1. ACTION!="add", SUBSYSTEM!="usb_device", GOTO="jlink_rules_end"

    What this presumably attempts to do is to skip all the rules in the file if this is not an "add" action and this is not USB. However, since the match for whether it is USB is using either the wrong variable or the wrong value (depending on what was the desired behavior), the rules are never skipped. This gives no visible difference in this particular test-case (since the action is "add", making the first part of the test not match). It is unclear to me why one would need to skip the rules (I would expect MODE="666" to be a no-op if the file is removed anyway, and merely redundant if the file permissions were already set to that during add), but I assume this was added for a reason. In its current form, it will never match and may as well be deleted if it doesn't add value.

    Admittedly, even if you do change this to one of my proposed changes, the logic is still very odd. Since it is an "and" match, the rules would still not be skipped if you were adding a non-USB device, or if you were removing a USB device. It would make more sense to me these were checks for equality and included on each line, like this:

    Source Code

    1. ACTION=="add", DEVTYPE=="usb_device", ATTR{idProduct}=="1015", ATTR{idVendor}=="1366", MODE="666"

    However, I have to reiterate that I do not know the intended purpose of the original code.
  • I am developing on a NXP FRDM-K64 board, J-Link idProduct attribute 1015.
    I also had the problem that after installing J-Link v 6.14f I could not start the debugger in Eclipse under Linux. (kubuntu 16.04 in VM on Win7 host.)

    The error message was unhelpful, "Connecting to J-Link failed. Connected correctly?"

    The installation worked previously with J-Link v. 6.14b so evidently there was some recent problem.
    I found that I could start JLinkGDBServer from a root console but not from a user console. My work-around was to set the UID and GID bits on the JLinkGDBServer executable. (sudo chmod ug+s JLinkGDBServer) (The file is installed with ownership root|root.) While this works, it is probably not a desirable fix, since it allows the program to run with root privileges.

    After reading the post from knuta I modified the 99-jlink.rules file as suggested, removing the 0x prefix from the idProduct strings.
    This resolved the issue and allowed me to restore the permission bits of JLinkGDBServer to the initial values.

    Thanks to knuta for finding and posting the info. I believe his/her analysis is correct, that udev fails to match the idProduct attribute due to the 0x prefix in the recent versions of the file. This problem is still observed in J-Link v 6.14h, which is the latest at the time of this posting.
  • Hi,


    thanks for the report.
    I have not forgotten this, it is still on the todo, but there is no time slot left until next week.
    I need to research this - are there differences in the rules implementation etc - so that we fix this only once and not only half-way (or maybe break existing setups).

    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
  • At first I suspected that the 0x was for an earlier version of udev, but since jdcso reports that it used to work, I took a look at JLink_Linux_V614e_x86_64.deb (the version before the one I had issues with). There I found a shorter list without the 0x:

    Source Code

    1. #
    2. # 0x1001 - 0x100f not added yet
    3. #
    4. ATTR{idProduct}=="1010", ATTR{idVendor}=="1366", MODE="666"
    5. ATTR{idProduct}=="1011", ATTR{idVendor}=="1366", MODE="666"
    6. ATTR{idProduct}=="1012", ATTR{idVendor}=="1366", MODE="666"
    7. ATTR{idProduct}=="1013", ATTR{idVendor}=="1366", MODE="666"
    8. ATTR{idProduct}=="1014", ATTR{idVendor}=="1366", MODE="666"
    9. ATTR{idProduct}=="1015", ATTR{idVendor}=="1366", MODE="666"
    10. ATTR{idProduct}=="1016", ATTR{idVendor}=="1366", MODE="666"
    11. ATTR{idProduct}=="1017", ATTR{idVendor}=="1366", MODE="666"
    12. ATTR{idProduct}=="1018", ATTR{idVendor}=="1366", MODE="666"
    13. ATTR{idProduct}=="1019", ATTR{idVendor}=="1366", MODE="666"
    14. ATTR{idProduct}=="101A", ATTR{idVendor}=="1366", MODE="666"
    15. ATTR{idProduct}=="101B", ATTR{idVendor}=="1366", MODE="666"
    16. ATTR{idProduct}=="101C", ATTR{idVendor}=="1366", MODE="666"
    17. ATTR{idProduct}=="101D", ATTR{idVendor}=="1366", MODE="666"
    18. ATTR{idProduct}=="101E", ATTR{idVendor}=="1366", MODE="666"
    19. ATTR{idProduct}=="101F", ATTR{idVendor}=="1366", MODE="666"
    Display All

    I suspect the person who expanded the list did so by regenerating it completely using a Windows computer (hence the Windows newlines), and didn't notice that he/she also added an extra "0x" in the ATTR{idProduct}.
  • Hi,


    sorry for the long delay in response.
    I appreciate your efforts in investigating this issue.
    We fixed the issue internally. A fixed public version will be available by the end of this 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
  • 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