Avrdude: ser_open(): can't set com-state for "\\.\COMx"

hi
the message above the x is for 3, 4 , 6 , 7
i have 5 new Nano from China. I have tried this:
all available Com Ports (USB2 and USB3) a few cables.
The driver Manager says for example:
image
installed Arduino IDE 2.1.0 two times (Win 10)
done with old and new bootloader
installed the CH340 driver
always get:

FQBN: arduino:avr:nano
Using board 'nano' from platform in folder: C:\Users\hape\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\hape\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

Verwendete Bibliotheken erkennen ...
"C:\Users\hape\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Users\hape\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\hape\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6\sketch\Demo.ino.cpp" -o nul
Alternativen für max7219.h: [max7219@1.0.0]
ResolveLibrary(max7219.h)
-> Kandidaten: [max7219@1.0.0]
"C:\Users\hape\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Users\hape\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\hape\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IC:\Users\hape\Documents\Arduino\libraries\max7219" "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6\sketch\Demo.ino.cpp" -o nul
Using cached library dependencies for file: C:\Users\hape\Documents\Arduino\libraries\max7219\max7219.cpp
Funktionsprototypen werden generiert ...
"C:\Users\hape\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Users\hape\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\hape\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IC:\Users\hape\Documents\Arduino\libraries\max7219" "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6\sketch\Demo.ino.cpp" -o "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Users\hape\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6\preproc\ctags_target_for_gcc_minus_e.cpp"
Sketch wird kompiliert ...
"C:\Users\hape\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Users\hape\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\hape\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IC:\Users\hape\Documents\Arduino\libraries\max7219" "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6\sketch\Demo.ino.cpp" -o "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6\sketch\Demo.ino.cpp.o"
Bibliotheken werden kompiliert ...
Compiling library "max7219"
Zuvor kompilierte Datei wird verwendet: C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6\libraries\max7219\max7219.cpp.o
Kern wird kompiliert ...
Using precompiled core: C:\Users\hape\AppData\Local\Temp\arduino\cores\arduino_avr_nano_cpu_atmega328_7cc71d767c63013906a6063e16f74525\core.a
Linking everything together...
"C:\Users\hape\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6/Demo.ino.elf" "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6\sketch\Demo.ino.cpp.o" "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6\libraries\max7219\max7219.cpp.o" "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6/..\..\cores\arduino_avr_nano_cpu_atmega328_7cc71d767c63013906a6063e16f74525\core.a" "-LC:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6" -lm
"C:\Users\hape\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6/Demo.ino.elf" "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6/Demo.ino.eep"
"C:\Users\hape\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6/Demo.ino.elf" "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6/Demo.ino.hex"

Bibliothek max7219 in Version 1.0.0 im Ordner: C:\Users\hape\Documents\Arduino\libraries\max7219 wird verwendet
"C:\Users\hape\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-size" -A "C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6/Demo.ino.elf"
Der Sketch verwendet 8310 Bytes (27%) des Programmspeicherplatzes. Das Maximum sind 30720 Bytes.
Globale Variablen verwenden 324 Bytes (15%) des dynamischen Speichers, 1724 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
"C:\Users\hape\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\hape\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM4" -b115200 -D "-Uflash:w:C:\Users\hape\AppData\Local\Temp\arduino\sketches\067FB5A436E0002A1911965A275736B6/Demo.ino.hex:i"

avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Users\hape\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : COM4
     Using Programmer              : arduino
     Overriding Baud Rate          : 115200

avrdude: ser_open(): can't set com-state for "\.\COM4"

avrdude done. Thank you.

Fehlgeschlagenes Hochladen: Hochladefehler: exit status 1

has anyone any idea what the error could be beside CH340 wrong port?
that would be very nice because i do want to programm the Nano with USB and not per FTPI or other things
thx in advance
hape

bitte lösche diese unendliche unformatierte und unnötige Fehlermeldung.
zeige was du in Menu "werkzeuge" hast; gibts da Prozessor Auswahl?
зображення

Arduino IDE 2.1.0

select this option and try again

done same problem

do you got any working board, that you can using as "Arduino as ISP" programer ?

i have used another Arduino Nano from China. This one works. Also with an USB-Asp i can flash the Arduino and i see it as CH340 in Win 10. The USB is describe in the product sheet as CH340C but there is nothing labled on the chip. Its this one https://de.aliexpress.com/item/1005001447227362.html?spm=a2g0o.order_detail.order_detail_item.3.11656368anmkVb&gatewayAdapt=glo2deu
What could be the problem???
any ideas?
hape

look video how to prepare one arduino to be a programmer and how using it to reprogram other (second) arduino board. you should know, if Atmega328p chip not contain bootloader then any signals from PC converted by CH340 doing nothing, Atmega not hearing them, but bootloader checks pins 0 and 1, and react on signals.

hi
i have flashed a bootloader via USB-ASP on the Nano. But the Nano is not reacting. I take the Bootloader from inside of the Arduino IDE 2.1.0. Could this the wrong choice?
hape

there are many variants. which one did you take?

i make it like this:

image

i didn't see any other choices

ah, ok, so you burn bootloader, disconnect USBASP, connect USB cable, select right port and try upload. and you say it not succeed

yes thats exactly what i'm doing - before i tried it without bootloader burn

to be sure i understand you : you was able to burn bootloader without errors. yes?

yes

fine. make it. then disconnect usbasp from board and Computer. and try normal to upload some sketch.

i have done this and get the error i mentioned above

if you did tried any processor option, then CH340 driver is glitchy or CH340 self

so you mean these Arduinos are unusable for programming via USB?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.