laanwj / k210-sdk-stuff

Kendryte K210 / MaixGo stuff
ISC License
141 stars 31 forks source link

The Go seems to have 2 UARTs over USB #2

Closed thepian closed 5 years ago

thepian commented 5 years ago

I see:

 ls /dev/cu.*
/dev/cu.Bluetooth-Incoming-Port     /dev/cu.usbserial-14200
/dev/cu.HenriksAirPods-Wireless-4   /dev/cu.usbserial-14201

I guess one is the STM the other is CH340. Do you see the same?

laanwj commented 5 years ago

Fairly sure that the CH340 is not connected on the Go. It's the same UART chip (which emulates a FTDI USB chip) exposing two ports:

$ dmesg
...
[9586389.455848] ftdi_sio 5-2:1.0: FTDI USB Serial Device converter detected
[9586389.455892] usb 5-2: Detected FT2232C
[9586389.458538] usb 5-2: FTDI USB Serial Device converter now attached to ttyUSB0
[9586389.458613] ftdi_sio 5-2:1.1: FTDI USB Serial Device converter detected
[9586389.458657] usb 5-2: Detected FT2232C
[9586389.462535] usb 5-2: FTDI USB Serial Device converter now attached to ttyUSB1
...
$ lsusb
...
Bus 005 Device 028: ID 0403:6010 Future Technology Devices International, Ltd FT2232C Dual USB-UART/FIFO IC
...
$ ls -l /sys/class/tty/ttyUSB*
lrwxrwxrwx 1 root root 0 May 15 08:31 /sys/class/tty/ttyUSB0 -> ../../devices/pci0000:00/0000:00:13.0/usb5/5-2/5-2:1.0/ttyUSB0/tty/ttyUSB0
lrwxrwxrwx 1 root root 0 May 15 08:31 /sys/class/tty/ttyUSB1 -> ../../devices/pci0000:00/0000:00:13.0/usb5/5-2/5-2:1.1/ttyUSB1/tty/ttyUSB1

One, /dev/ttyUSB1 is the serial port, /dev/ttyUSB0 is used for JTAG in openocd—but I haven't got that to work yet.