09-08-2017 08:52 AM
x-post on LAVA: https://lavag.org/topic/20287-crio-usb-device-limit/#comment-123250
I have a cRIO 9030 based test system that connects to 16 control boards over USB (FTDI). I can connect and communicate with 14 just fine, but it seems NI Linux RT is not recognizing the 15th and 16th devices. /dev/ttyACM0 through /dev/ttyACM13 show up for the first 14 boards, but no new ttyACM files appear for devices 15 and 16. The first 14 also show up under devices and interfaces in MAX and are discoverable with VISA. I've tried a couple different hubs in different configurations connected to the two USB ports (including daisy chaining them), and I'm always able to get exactly 14 boards to connect. The first configuration I tried was two 8-port hubs, each with their own 60W DC supply. If I instead daisy chain them, I can see up to 14 devices enumerated from the one cRIO USB port, and when I connect a 15th board directly to the second cRIO USB port (not through a hub), nothing new shows up in /dev and there are no new devices in MAX or VISA discovery.
I can communicate with all 16 without issue on my Windows 7 desktop, so I don't think it's an issue with the hubs.
Is this a real OS or hardware limitation, or does anyone know of a potential solution or workaround? If there is a real limitation, I can settle for testing two batches of 8 at a time. Thanks!
09-09-2017 08:23 PM
Two quick questions:
09-11-2017 12:15 PM
from dmesg:
[ 7.434709] usb 1-4.4.4.2: new full-speed USB device number 24 using xhci_hcd
[ 7.577906] usb 1-4.4.4.2: Not enough host controller resources for new device state.
[ 7.577923] usb 1-4.4.4.2: can't set config #1, error -12
It looks like this issue is not limited to NI Linux-RT: https://superuser.com/questions/731751/not-enough-host-controller-resources-for-new-device-state
I poked around in BIOS and couldn't find anything that would allow me to disable xhci.
I'm running NI Linux Real-Time x64 4.6.7-rt14-5.0.0f0
09-14-2017 02:59 PM
Unfortunately, it seems that NI also builds xhci support into the kernel. You could try disabling the kernel configuration, rebuilding the kernel, and testing that out, but it's your call as to whether or not this effort is worth being able to use all ports at the same time.
09-14-2017 03:16 PM - edited 09-14-2017 03:16 PM
I'm following the conversation because I'm interested in having multiple devices later on a Linux RT chassis. What is the real limitation here? Lets say I have a single USB to 16 port RS-232 device like this one. Will it only see 14 of the serial ports? Or is this seen as one host controller, and all 16 devices would show up? Or does each port get its own controller?
If this does get recognized properly, then you could combine this with 16 serial to uart devices like this one, and then talk to each of the Arduinos by wiring from the tx and rx pins, to the TTL of the converter? Essentially wiring around the FTDI chip on the Arduino.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-14-2017 04:37 PM
Hooovahh, I've not actually dug into the kernel code, it does seem odd to me that it would be some sort of arbitrary limit that has something to do with whether or not you enable an xhci controller (other than the error itself comes from the xhci host controller driver in the kernel).
Digging in a bit more, it seems that the SoC used for the 903x series controllers does not include a ehci/ohci/uhci controller (separate from the xhci controller built into the SoC), so simply disabling the xhci controller won't fix the problem (since it will likely break the USB ports) (sorry for the bad news, DavidBTaylor).
I'll do a quick sanity check and report back
09-14-2017 05:35 PM
Verified. If you disable the xhci driver, you won't get any USB devices on 903x controllers.
02-15-2018 09:55 AM
Quick update on this now that I have some actual hardware. I have several cDAQ 9136 and each needs 8 COM ports so we bought a StarTech 8 port USB Serial hub. The controller with nothing plugged in shows two ASRL devices in MAX, one is built into the chassis and the other I assume is internal I can't get it to do anything. When I plug in the 8 port hub I end up with 10 serial devices (as expected). My setups only need 8 but since I had these extra hubs I plugged two into the controller and sure enough only 14 USB COMs were detected, and the original 2 making a total of 16.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord