Alchitry Forums
USB-UART, which port is which? - Printable Version

+- Alchitry Forums (https://forum.alchitry.com)
+-- Forum: Alchitry (https://forum.alchitry.com/forum-1.html)
+--- Forum: General Questions (https://forum.alchitry.com/forum-2.html)
+--- Thread: USB-UART, which port is which? (/thread-420.html)



USB-UART, which port is which? - darkmatta - 04-11-2022

Hi, I am working with getting some UART code running on the Alchitry AU and realized I had a question. Which of the two /dev/ttyUSB? ports is which. In the schematic JTAG seems to be port A and UART on port B, but would that necessarily give the expected result of /dev/ttyUSB0 is the JTAG and /dev/ttyUSB1?

PySerial just labels them both "Alchitry - Au"

Code:
>>> from serial.tools import list_ports
>>> for element in list_ports.comports(): print(element)
...
/dev/ttyUSB1 - Alchitry Au - Alchitry Au
/dev/ttyUSB0 - Alchitry Au - Alchitry Au
>>>


I suspect it's arbitrary which is which, just whichever the kernel saw first, but I was wondering if anyone had an easy way to read them and be sure.


RE: USB-UART, which port is which? - alchitry - 04-15-2022

It is likely ttyUSB1. As you've already noted, it is port B which is the UART which I believe should enumerate second.


RE: USB-UART, which port is which? - darkmatta - 04-21-2022

That makes some sense. I don't know enough about USB to understand how the handshake works. I figured it was whichever the kernel sees first, but if the chip enumerates things to the kernel in the same order as its output ports, what you say makes sense.

Thanks!