1、avrdude: ser_open(): can’t open device “\.\COM6”: 系统找不到指定的文件

arduino的IDE无法识别现在的端口,尝试重新拔插和重新启动IDE,如果能够在IDE的端口中找到它即可正常使用,否则还会报错。
说明:
有的在设备管理器中可以看到虚拟串口,但IDE中不能找到对应的串口,那么,重新启动IDE即可。
如果电源有多个来源,我们可能会考虑共地,这个时候也会出现共地后IDE无法识别虚拟串口,可以暂时去掉共地连接,再试。

如果上述方法都没有解决,可以考虑重新安装串口驱动程序,或者使用VSerialDriverFixer 来修复一下亦可。

2、0号端口或1号端口原始留给串口用的,上传时不能占用(不能插线,否则报错)
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

3、java.io.IOException: jssc.SerialPortException: Port name:这一般属于热插拔器件,改变了电流电压,引起了虚拟串口中断,重新插拔USB也可以解决
java.io.IOException: jssc.SerialPortException: Port name - COM13; Method name - setEventsMask(); Exception type - Can’t set mask.
at processing.app.Serial.dispose(Serial.java:166)
at processing.app.SerialMonitor.close(SerialMonitor.java:116)
at processing.app.AbstractMonitor.suspend(AbstractMonitor.java:90)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2182)
at java.lang.Thread.run(Thread.java:748)
Caused by: jssc.SerialPortException: Port name - COM13; Method name - setEventsMask(); Exception type - Can’t set mask.
at jssc.SerialPort.setEventsMask(SerialPort.java:279)
at jssc.SerialPort.removeEventListener(SerialPort.java:1064)
at jssc.SerialPort.closePort(SerialPort.java:1090)
at processing.app.Serial.dispose(Serial.java:163)
… 4 more

4、串口参数错误(这种错误往往都因为负载太大导致,比如直接挂载了几个舵机而没有用外接电源)
avrdude: ser_open(): can’t set com-state for “\.\COM15”
上传项目出错
设置串口参数时出错:9,600 N 8 1

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐