Xtag Xtag2 and kits on Ubuntu
From XCore Exchange
Contents |
Ubuntu USB Support
This page assumes you have installed the latest version of the XMOS Development Tools (https://www.xmos.com/technology/design-tools) version 10.4 or greater.
In order to use an XMOS development kit, XTAG or XTAG-2 based product on Ubuntu you may have to go through additional USB configuration steps in order to connect to the boards.
Open a terminal, change directory to your tools path and run the following:
source SetEnv
This configures your environment for the XMOS tools. To detect the boards run:
xrun -l
this will list boards recognised by the XMOS tools (10.4) connected to the USB bus.
If you cannot see your board listed (no devices) you may need the additional steps below.
USB Native Driver Support
USB driver support is provided natively on Linux. The method required to enable the driver, however, depends on the distribution you are using and the kernel version.
Get your kernel versions by running:
uname -r
You will need this information to see what kernel support for USB you have.
With USBFS Support
If your distribution provides usbfs support (e.g. pre kernel 2.6.31-20), follow these steps:
1. Edit the fstab file to add usb mounting details
sudo nano /etc/fstab
Add the following lines to the end of the file:
none /proc/bus/usb usbfs defaults,devmode=0666 0 0 none /dev/bus/usb usbfs defaults,devmode=0666 0 0
2. Press CTRL+O to write the changes, then CTRL+X to exit
3. Unmount the USB file systems with the following commands:
sudo umount /proc/bus/usb sudo umount /dev/bus/usb
4. Remount the USB file systems with the following commands:
sudo mount /proc/bus/usb sudo mount /dev/bus/usb
You should be ready to go. Use xrun as above to find your devices. If you still do not see your devices, disconnect and reconnect your devices. If you get complaints about usbfs being unsupported, or no /proc/bus/usb whilst completing the above commands you may need further steps - see the next section.
A useful command for linux usb detective work (not XMOS-specific) is issuing the following:
sudo lsusb
This will list all of the USB devices Linux knows are connected. By issuing this command when the device is plugged in and then repeating when it is unplugged you can see if the device is picked up or not by detecting the differences in its results.
Without USBFS Support
If your distribution does not support usbfs (for example Ubuntu 9.10 kernel 2.6.31-20), you need to set permissions using a udev rule. The procedure depends on the type of debug adapter you are using.
External Debug Adapter (XTAG-2)
Example kits are XK1, SparkFun XMOS development board and NetStamp.
If your development board uses an external XTAG-2 debug adapter, create a file "/etc/udev/rules.d/99-xmos.rules" using your favourite editor.
sudo nano /etc/udev/rules.d/99-xmos.rules
Add these lines to it:
SUBSYSTEM!="usb|usb_device", GOTO="xmos_rules_end"
ACTION!="add", GOTO="xmos_rules_end"
# 20b1:f7d1 for xmos xtag2
ATTRS{idVendor}=="20b1", ATTRS{idProduct}=="f7d1", MODE="0666",
SYMLINK+="xtag2-%n"
LABEL="xmos_rules_end"
Use CTRL+O to write changes and CTRL+X to quit.
To get the device to recognise the new rule, restart the udev service. This varies by distribution but for Ubuntu, you can restart udev by running:
sudo restart udev
When you have restarted the udev service, disconnect and reconnect your debug adapter/board, or alternatively reboot your system. In the latter case the device will automatically pick up the revised udev rule so you do not need to unplug your device. You should now be able to see your XTAG-2 device listed by using xrun.
Integrated Debug Adapter (FTDI/XTAG)
Example kits include XC-2, XC-3, XC1/1A, XC5.
If your development board uses an integrated debug adapter or an XTAG(-1), you may be able to enable the driver by adding the following to "/etc/udev/rules.d/98-xmos.rules"
SUBSYSTEM!="usb|usb_device", GOTO="xmos_rules_end"
ACTION!="add", GOTO="xmos_rules_end"
# 20b1:f7d1 for xmos xtag2
ATTRS{idVendor}=="20b1", ATTRS{idProduct}=="f7d1", MODE="0666",
SYMLINK+="xtag2-%n"
# 0403:6010 for XC-1 with FTDI dual-uart chip
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0666",
SYMLINK+="xc1-%n"
LABEL="xmos_rules_end"
Providing the distribution includes the /proc/bus/usb directory, you can then bind the /dev/bus/usb directory onto /proc/bus/usb:
mount --bind /dev/bus/usb /proc/bus/usb
NOTE this step may not work, particularly if you do not have /proc/bus/usb. in which case you will also likely need the FTDI patch for the tools see below.
Then restart the udev service or reboot your system - see External Debug Adapter section above.
NOTE: The FTDI/XTAG issue (see Integrated Debug Adapater section) has been reported to FTDI Support by XMOS and we are waiting for an official release that resolves the problem, this will be included in a later tools release. In the meantime XMOS has an unofficial patched version of the device library that works on Ubuntu 9.10 kernel 2.6.31-20. If you would like a copy of the library please send a support ticket via the official XMOS support site https://www.xmos.com/support/contact that includes "Linux FTDI Library Request" in the Subject field.
USB Support on other Linux distributions
Please visit the official XMOS knowledge base for information on development kits for Linux distributions other than Ubuntu.
