opened 05:18AM - 25 Mar 23 UTC
closed 05:32AM - 25 Mar 23 UTC
invalid
I think this is not an avrdude issue but an WCH CH340 driver issue.
Still it… is good to put some info here so that people can reference to it, since there are quite some similar issues posted online.
I was playing with CH341A yesterday and install the latest CH341SER driver for CH340/CH341. Then I was encountering the above issue. Reverting to an old version sorted out the issue for me -- I am using version 3.5 (3.5.2019.1) and it is working fine.
Problematic driver version:
http://www.wch-ic.com/downloads/CH341SER_EXE.html (version 3.8, uploaded on 2023-03-16, size 642KB)
```
; CH341SER.INF
; Driver for CH340/CH341 (USB=>SERIAL chip) V3.8
; WDM&VXD for Windows 98/Me/2000/XP/Vista/7/8/8.1/10/11/SERVER 2003/2008/2012/2016/2019/2022
; Copyright (C) WCH 2001-2023
;
[Version]
Signature = "$Chicago$"
Class = Ports
ClassGuid = {4D36E978-E325-11CE-BFC1-08002BE10318}
Provider = %WinChipHead%
DriverVer = 02/11/2023, 3.8.2023.02
CatalogFile =CH341SER.CAT
```
Working driver version:
```
; CH341SER.INF
; Driver for CH340/CH341 (USB=>SERIAL chip) V3.5
; WDM&VXD for Windows 98/Me/2000/XP/Vista/7/8/8.1/10/SERVER 2003/2008/2012/2016
; Copyright (C) W.ch 2001-2019
;
[Version]
Signature = "$Chicago$"
Class = Ports
ClassGuid = {4D36E978-E325-11CE-BFC1-08002BE10318}
Provider = %WinChipHead%
DriverVer = 01/30/2019, 3.5.2019.1
CatalogFile = CH341SER.CAT
```
If you can not find the older driver version, here is one link for version 3.5.
https://github.com/wemos/ch340_driver
Good and bad run log for reference:
```
PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_pr1215v1 -C .\avrdude_pr1215v1.conf -p m328pb -c urclock -P COM4 -xshowall -xbootsize=512
avrdude_pr1215v1: AVR device initialized and ready to accept instructions
0 0000-00-00 00.00 application 0 store 0 meta 0 boot 512 o8.0 -?s-?-r-- vector 0 (RESET) ATmega328PB
PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_pr1215v1 -C .\avrdude_pr1215v1.conf -p m328pb -c arduino -P COM4
avrdude_pr1215v1: AVR device initialized and ready to accept instructions
avrdude_pr1215v1: device signature = 0x1e9516 (probably m328pb)
avrdude_pr1215v1 done. Thank you.
PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_pr1215v1 -C .\avrdude_pr1215v1.conf -p m328pb -c arduino -P COM4
avrdude_pr1215v1 error: cannot set com-state for \\.\COM4
avrdude_pr1215v1 error: unable to open programmer arduino on port COM4
avrdude_pr1215v1 done. Thank you.
PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_pr1215v1 -C .\avrdude_pr1215v1.conf -p m328pb -c urclock -P COM4 -xshowall -xbootsize=512
avrdude_pr1215v1 error: cannot set com-state for \\.\COM4
avrdude_pr1215v1 error: unable to open programmer urclock on port COM4
avrdude_pr1215v1 done. Thank you.
```