背景
在网上用9.9淘的一块ESP32-C3(RISC-V)的小开发板上,用的CH343的USB转串口。
最近打算学习用Rust开发ESP32-C3,在Ubuntu上搭建开发环境的时候发现,Ubuntu20.04上默认使用的是 CDC-ACM 驱动,即生成的节点为/dev/ttyACM0
,但是用Rust开发ESP32-C3,需要使用 VCP 驱动,于是在网上找到了官方(WCH-南京沁恒)的一份Linux驱动源码:
里面的文档也说明了使用 CDC-ACM 驱动的一些局限性:
The CDC-ACM driver has limited capabilities to control specific devices. This generic driver does not have any knowledge about specific device protocols. Because of this, device manufacturers can create an alternate, or custom driver that is capable of accessing the device specific function sets, such as hardware flow control or GPIO functions.
到目前为止,这份驱动支持的USB转串口的芯片,挺全挺新的,感觉官方一直在维护:
This driver and application support USB to single serial port chip ch343/ch347/ch9101/ch9102, USB to dual serial ports chip ch342/ch347/ch9103, USB to quad serial ports chip ch344, etc.
。。。。。。