Xmos kits and linux

Technical discussions related to any XMOS development kit or reference design. Eg XK-1A, sliceKIT, etc.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

I just want to get the tools working so I can get some work done, I am using Ubuntu 9.10 but there is a newer version that's just come out - 10.04 , has anyone got it working with either of these distribution versions?


User avatar
XMatt
XCore Addict
Posts: 147
Joined: Tue Feb 23, 2010 6:55 pm

Post by XMatt »

Have you followed the instructions in https://www.xmos.com/kbase/index.php?Vi...EntryID=27

This has the required information for setting up USB devices on linux, if it does not contain everything it needs to be updated.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

larry wrote:
Folknology wrote:Why does this knowledge base article exist then:
https://www.xmos.com/kbase/index.php?Vi ... EntryID=27
Thanks, Al. The text of this article does not affect the statement I've made. XMOS provide Ubuntu tips at their discretion.

Thanks Larry and I understand your position, but the Xmos position of not supporting Ubuntu surely has to be questioned given it's popularity and common place. In the real world, real people have to get real world work done, using real tools, surely some common sense has to be employed with this. I would hazard a guess that's why such Knowledgebase tips exist because in the real world customers do use Ubuntu I am not alone here and I am certainly not going to be the only one in the future.

regards
Al
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

XMatt wrote:Have you followed the instructions in https://www.xmos.com/kbase/index.php?Vi...EntryID=27

This has the required information for setting up USB devices on linux, if it does not contain everything it needs to be updated.
If you mean this one http://www.xmos.com/kbase/index.php?Vie ... EntryID=27
Yes I have followed the instructions, but no dice I'm afraid.

The irony is it used to work with the XC-2

*Update - the hyperlinks for the knowledge articles keep getting mangled for some reason. But I think we are talking about the same article.
"if it does not contain everything it needs to be updated."
Agreed it does need updating..
Last edited by Folknology on Thu May 20, 2010 12:04 pm, edited 2 times in total.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

By the way my original (old) thread http://www.xcore.com/forum/viewtopic.php?f=8&t=64
Does not work any longer! do not follow this..

I am guessing it is because the kernel has been updated since my earlier Ubuntu experiments (this happens for security reasons). Hence my question about 10.04. The trouble is if I go the 10.04 route I may actually make it worse as won't be able to back up to 9.10 without a painful reinstall, hence my question about versions.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

I also note that the knowledgebase article seems to be blaming the issue on FTDI and their drivers, this is odd on a couple of fronts:

1) Blaming another company on your knowledgebase seems a bit odd, also if anyone knows about building cross platform usb drivers FTDI should surely? Dissing them in public I suggest isn't good practice.
2) I am using both an XC-2 which has an Xtag FTDI version which used to work! I also have a new XK1 which has an XTAG2 which has never worked to my knowledge, so how is FTDI to blame?

Anyone care to explain that?
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

Here is the text from the knowledgebase article in case the mangled links aren't working :
How do you enable the USB drivers for the Linux Development Tools?

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.

USBFS Support
If your distribution provides usbfs support, follow these steps:
1. Log into a shell with root permissions.
2. Open the file /etc/fstab in an editor and add the following lines:
none /proc/bus/usb usbfs defaults,devmode=0666 0 0
none /dev/bus/usb usbfs defaults,devmode=0666 0 0

3. Unmount the USB file systems with the following commands:

umount /proc/bus/usb
umount /dev/bus/usb

4. Remount the USB file systems with the following commands:

mount /proc/bus/usb
mount /dev/bus/usb

Non-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)

If your development board uses an external XTAG-2 debug adapter, create a file "/etc/udev/rules.d/99-xmos.rules"

that contains:

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"


Integrated Debug Adapter (FTDI)

If your development board uses an integrated debug adapter, you may be able to enable the driver by adding the following to a file "/etc/udev/rules.d/99-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

If the distribution does not include the /proc/bus/usb directory, we recommend that you use a earlier kernel or use a different platform.
NOTE: This issue has been reported to FTDI Support and we are waiting for an official release that resolves the problem, which will be included in a later tools release. In the meantime we have 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 us a support ticket that includes "Linux FTDI Library Request" in the Subject field.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

For the record, I also didn't notice anyone at Xmos complaining about the time I spent documenting my the process of getting XC-2 working last time around despite Xmos only supporting certain versions of RedHat..

This really does need to be a 2 way street you know a real community...
User avatar
daveg
Member++
Posts: 28
Joined: Thu Dec 10, 2009 7:25 pm

Post by daveg »

The FTDI driver doesn't work on newer versions of Ubuntu (including newer kernels on 9.10 and 10.04). Our patched version makes it use /dev/bus/usb instead of /proc/bus/usb, due to deprecation of usbfs (usually mounted on /proc/bus/usb) on these newer kernels.

The udev rules are required to make the permissions correct for the device and are separate to the usbfs problems mentioned. If you run xrun as root and it finds the device but not as a normal user then this is because of the permissions problems of the USB devices.


Our support for Redhat also includes CentOS and other Redhat-derived OSes, and we do endeavour to support "all" distributions, but it's difficult to test on all possible kernel versions and releases of distributions so we have to limit the list of officially-supported versions somewhere.

Installing the patched version of the library (the knowledgebase entry suggests contacting us to get this, but it would probably make sense for us to make it available from the tools page) and the udev rules has worked in our testing on Ubuntu 9.10 and 10.04, but there may be differences in any setup which affects this of course.


Basically the non-FTDI kits should work without any trouble (but try xrun as root to rule out permissions problems), but the FTDI ones will need our patched library until a new version is released by FTDI.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

Thanks Dave for the feedback and more details I appreciate you trying to help us Linux folks!
but try xrun as root to rule out permissions problems
I have tried this as it has been mentioned before, but it makes no difference in this case.

The fundamental problem appears to be with :
The FTDI driver doesn't work on newer versions of Ubuntu (including newer kernels on 9.10 and 10.04). Our patched version makes it use /dev/bus/usb instead of /proc/bus/usb, due to deprecation of usbfs (usually mounted on /proc/bus/usb) on these newer kernels.
Again I have negative results with both devices, this is not confined to the FTDI xtag and XC-2 combination, my XK1 + Xtag2 is not showing up either.

Code: Select all

Our support for Redhat also includes CentOS and other Redhat-derived OSes, and we do endeavour to support "all" distributions, but it's difficult to test on all possible kernel versions and releases of distributions so we have to limit the list of officially-supported versions somewhere.
Officially it is only Redhat and certain versions at that, not RedHat derived distros, but you point is important, supporting outside of those specific RH versions is critical for real customers. Given that Ubuntu is the most popular and prolific, surely this would be at the top of the list?

regards
Al
Last edited by Folknology on Thu May 20, 2010 12:58 pm, edited 1 time in total.