1
\$\begingroup\$

I am trying to connect a host USB device on one board to an endpoint USB device on another board, but I am required to send the link between the two devices as a serial (UART) connection between the two boards. The USB to Serial and Serial to USB converters would be housed on the individual boards that house the respective host and endpoint devices.

I need the host USB device to recognize the endpoint device as a USB endpoint just the same as if it were a direct USB connection.

Is it possible to get this work in the way I need? I understand the communication speed would be much slower than conventional USB. I have seen FTDI conversion chips that claim to work up to 3Mbaud, (like this one: https://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT234XD.pdf) and I would think ~2Mbaud would be sufficient for what I am doing. The chip I linked seems to be exclusively for USB host devices to convert to serial out, I have not been as successful at finding a device expected to work in the opposite direction (serial to USB endpoint).

Has anyone done something like this successfully before, or perhaps can identify to me that this is impossible for reasons X, Y, Z?

\$\endgroup\$
  • 2
    \$\begingroup\$ If you're happy with it being a COM port, you should be able to do it \$\endgroup\$ – BeB00 Dec 5 '18 at 19:28
  • 1
    \$\begingroup\$ (USB-Ethernet Bridge) - (routed over serial PPP/SLIP) - (Ethernet-USB Bridge), with each end of the (USB-Ethernet Bridge) being one half of this extender device. \$\endgroup\$ – brhans Dec 5 '18 at 20:02
  • 1
    \$\begingroup\$ @brhans that won't work. The device you link to uses Ethernet style cable, but it doesn't speak Ethernet and it doesn't use IP, so you can't proxy it over PPP/SLIP. \$\endgroup\$ – Chris Stratton Dec 5 '18 at 22:53
  • 1
    \$\begingroup\$ @ChrisStratton - Ok - I was being lazy & just linked the 1st thing that popped up - but USB-over-Ethernet extender devices do exist though. \$\endgroup\$ – brhans Dec 5 '18 at 23:00
  • \$\begingroup\$ @brhans - that's a claim that would need evidence. Transparently proxying one tightly timed packet network over a typically packet switched one is non-trivial, and doing so in a way where PPP/SLIP could be inserted in the middle without breaking it is not really credible at all. Software that intercepted USB traffic on the host at the USB API level would be more plausible, but since the device is mass storage that would need to be something that intercepted file system layers rather than USB. A non-transparent replacement with a networked storage device is probably the best solution. \$\endgroup\$ – Chris Stratton Dec 6 '18 at 0:10
4
\$\begingroup\$

No, as described this will not work. Traditional FTDI USB-Serial converters can only fill the USB device role. They cannot host your far-end USB device. So while you might be able to use one on the near end, you'll require something else on the far end.

There are however embedded USB hosts you might be able to use. These are all ultimately Microcontrollers - some such as FTDI's Viniculum / Viniculum II are sold specifically for this type of purpose (but may or may not fit your exact need) and others are more general-purpose devices definitely able to be customized for this task, perhaps something like a Kinetis KLZ25/KLZ26 (aka Teensy-LC), an STM32 with USB host capability, etc. Or even a small embedded Linux system, though that raises complexity and power consumption, introduces delicate filesystem state, etc.

Regardless of the hardware the first task will be to figure out the exact USB operations expected by the far end device. You'll effectively need to come up with a custom USB driver for that for an embedded host, or decide that there is already one in Linux which you can use by building the far end of your bridge around an embedded Linux system. Or you'll invent some sort of USB-proxying scheme and come up with a custom driver or driver interceptor on the near end operating system that proxies through serial.

Note that things like USB-over-fiber extenders exist. That won't strictly fit your stated requirement of proxying over serial, but it might well fit your actual need and would save you a lot of development time. For that matter you could perhaps move the entire computer to the remote location and interact with it remotely over a network.

\$\endgroup\$
  • \$\begingroup\$ USB endpoint device is a memory device, basically a flash drive that you plug into a USB port of a PC. Your 3rd paragraph is a bit over my head, but my take is that even with some appropriate piece of hardware that can handle the theoretical operation a lot of custom firmware work would be necessary. \$\endgroup\$ – scuba Dec 5 '18 at 19:47
  • 2
    \$\begingroup\$ Can you just put a cheap network-attached-storage box at the far end and plug the USB stick into that? Modifying one for which an open source OS install (DD-WRT or whatever) is available to work over a serial port should be straightforward. But you shouldn't try to present it to the near side as a USB mass storage device, you should use a network filesystem paradigm to talk to it, or perhaps explicit file transfer operations. \$\endgroup\$ – Chris Stratton Dec 5 '18 at 19:49
  • \$\begingroup\$ I'm not sure that that would work with the system architecture but that is certainly a good idea given the constraints. Thank you for your insight into this topic. \$\endgroup\$ – scuba Dec 5 '18 at 20:55
  • 1
    \$\begingroup\$ You may want to post the actual application problem as a new question on superuser SE. Try not to constrain solutions as you've done here, but instead be specific about the needs and the ultimate source of the requirements. \$\endgroup\$ – Chris Stratton Dec 6 '18 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.