I have a USB JTAG adapter that I want to use on Linux. How do I do this?
Regular users generally do not by default have USB access permission on Linux. Depending on which Linux distribution you use, there are a number of different ways of granting regular users USB access permission.
On Ubuntu 12.04 and above, Linux Mint 14, openSUSE 12.2 and Fedora 17
You need to create a file in /etc/udev/rules.d (e.g. 60-crossconnect.rules) with the following contents:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="131b", ATTRS{idProduct}=="0003", MODE="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="131b", ATTRS{idProduct}=="0004", MODE="0666"
On Ubuntu 8.10 to 10.04, openSUSE 10.3 and Fedora 8
You need to create a file in /etc/udev/rules.d (e.g. 60-crossconnect.rules) with the following contents:
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
SYSFS{idVendor}=="131b", SYSFS{idProduct}=="0003", MODE="0666"
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
SYSFS{idVendor}=="131b", SYSFS{idProduct}=="0004", MODE="0666"
On Ubuntu 6.06 and Ubuntu 7.10
You need to create a file in /etc/udev/rules.d (e.g. 60-crossconnect.rules) with the following contents:
SUBSYSTEM=="usb_device", SYSFS{idVendor}=="131b", SYSFS{idProduct}=="0003", \
ACTION=="add" MODE="0666"
SUBSYSTEM=="usb_device", SYSFS{idVendor}=="131b", SYSFS{idProduct}=="0004", \
ACTION=="add" MODE="0666"
On RedHat 9.0
You need to add the following lines to the /etc/hotplug/usb.usermap file:
crossconnect 0x0003 0x131B 0x0003 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
crossconnect 0x0003 0x131B 0x0004 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
And create the script file /etc/hotplug/usb/crossconnect which contains:
#!/bin/bash
if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]; then
chmod a+rw "${DEVICE}"
fi
Consult the USB documentation for your specific Linux distribution for more information.
Other Devices
Please note that the examples above are intended for ARM CrossConnects, which have a USB vendor ID of 0x131B and a USB product ID of 0x0003 and 0x0004. If you are using a different device you will need to modify the files so they contain the correct USB vendor and product IDs for your device. The following table describes the vendor and product IDs for other common USB ARM target interface devices:
Device | Vendor ID | Product ID |
Amontec JTAGkey | 0x0403 | 0xCFF8 |
Luminary USB Debug | 0x0403 | 0xBCD9 |
Olimex ARM-USB-OCD | 0x15BA | 0x0003 |
Olimex ARM-USB-OCD-H | 0x15BA | 0x002B |
Olimex ARM-USB-TINY | 0x15BA | 0x0004 |
Olimex ARM-USB-TINY-H | 0x15BA | 0x002A |
Xverve Signalyzer H | 0x0403 | 0xBCA2 |
For devices not on this list, you can determine the USB vendor and product IDs by connecting the device and running the following from the Linux command line:
lsusb -v
Comments
13 comments
Device: MSP-FET430UIF
Vendor ID: 0451
Product ID: f430.
There should be device driver for the TUSB chip built-in to the Linux Kernel. When you plug in the FET430UIF device you should see a file /dev/ttyUSB* appear.
Ooh. That'd explain why I wasn't getting it to work, then! I'll have to look into this further. >_<
Okay, so I yum installed everything msp-related (I'm on Fedora 12), and sure enough, I have /dev/ttyUSB0. However, when trying to connect with the device using CrossStudio (2.0.9.2010033104.7366) I get the error, "Can't connect to target USB: Could not communicate with FET." Any ideas?
I can file a for-reals tech support ticket if you'd like, but it seems I got your attention here now, so...yeah. :v
Are the file permissions on /dev/ttyUSB0 okay?
chmod 666 /dev/ttyUSB0 seemed to do the trick. Thanks! Now: How do I make this happen automatically? Using udev? It didn't seem to work with what I had before, which was something like:
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
SYSFS{idVendor}=="0451", SYSFS{idProduct}=="f430", MODE="0666"
I'm using Fedora 12, which seems to have udev v. 145.
Again: Thanks for all your help! You guys are pretty awesome.
ubuntu 11.10, udev 173, my x-verve signalyzer wasn't found with what you suggest.
I used "udevadm -info --export-db >udevdump" and looked through udevdump until I found the product ID.
I then wrote my rule using ENV{PRODUCT}== "<value I found in udevdump>" and I got a connection. I could have used some of the other ENV values ("E:" in the dump) but the particular one above was distinct. I also added a SYMLINK+="signalyzer" so I could look at /dev/signalyzer to check the permissions.
My device now gets a reset when I try to connect, but I get "Cannot identify target". I'll be tuning my JTAG Clock Divider (STM32F103).
Hello,
any thought how to set up the rights for OLIMEX ARM-USB-TINY-H in Fedora 16? I have tried everything above and nothing helped me.
Thanks in advance
Please add:
Olimex ARM-USB-TINY-H 15ba 002a
device : MSP-FET430UIF
ID 2047:0010
system: Ubuntu 12.04 64bit
crossworks 2.1 (all packages are up to date)
target driver DLL path link to MSP430.so (i tried all *.so)
i set the permission, and set ID to /etc/udev/rules.d (as you discribed above)
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2047", ATTRS{idProduct}=="0010", MODE="0666"
but still :
Can't connect to target USB: Could not communicate with FET
any ideas?
I have this - the FET430-UIFS create a serial port.
ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f432", MODE="0660", GROUP="plugdev"
any change, but i have solution now.
I link target driver DLL path to libmsp430.so (used in codecomposer v5) and it runs.
Thank you for your help.
I had a little trouble after upgrading to Kubuntu 13.10 (saucy), finally got this to work:
Ubuntu 13.10 (saucy)
/etc/udev/rules.d/60-crossconnect.rules
#Device Vendor ID Product ID
#Amontec JTAGkey 0x0403 0xCFF8
#Luminary USB Debug 0x0403 0xBCD9
#Olimex ARM-USB-OCD 0x15BA 0x0003
#Olimex ARM-USB-OCD-H 0x15BA 0x002B
#Olimex ARM-USB-TINY 0x15BA 0x0004
#Olimex ARM-USB-TINY-H 0x15BA 0x002A
#Xverve Signalyzer H 0x0403 0xBCA2
#STMicroelectronics ST-LINK/V2 0x0483 0x3748
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="0403", ATTR{idProduct}=="cff8", MODE="664", GROUP="plugdev"
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="0403", ATTR{idProduct}=="bcd9", MODE="664", GROUP="plugdev"
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="15ba", ATTR{idProduct}=="0003", MODE="664", GROUP="plugdev"
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="15ba", ATTR{idProduct}=="0004", MODE="664", GROUP="plugdev"
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="15ba", ATTR{idProduct}=="002B", MODE="664", GROUP="plugdev"
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="15ba", ATTR{idProduct}=="002a", MODE="664", GROUP="plugdev"
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="0403", ATTR{idProduct}=="bca2", MODE="664", GROUP="plugdev"
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="0483", ATTR{idProduct}=="3748", MODE="664", GROUP="plugdev"
Please sign in to leave a comment.