通过 ls /dev/tty* 可以看到设备已经显示出来了 ttyCH341USB0。但就不出现在 VSCode PlatformIO 的 Devices 列表中。
这可能是因为 PlatformIO 过滤掉了ttyC 开头的串口设备。通过修改 CH340/341 的驱动程序来重命名串口设备名即可搞定。
## 下载驱动程序
https://www.wch.cn/downloads/CH341SER_LINUX_ZIP.html
解压之后进入源码目录,首先卸载旧版本
```
sudo make uninstall
```
## 修改源码
修改 ch341.c 代码文件
```
dev_info(&intf->dev, "ttyCH341USB%d: ch341 USB device\n", minor);
改为
dev_info(&intf->dev, "ttyAMAUSB%d: ch341 USB device\n", minor);
ch341_tty_driver->driver_name = "ch341_uart", ch341_tty_driver->name = "ttyCH341USB",
改为
ch341_tty_driver->driver_name = "ch341_uart", ch341_tty_driver->name = "ttyAMAUSB",
```
## 编译安装
```
make clean
make && sudo make install
```