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

Hello, I have quite a sticky issue with programming my arduino nano (CH340) from my PC (AMD64 WIN 11).
I have read all the posts on this issue that I can find with no luck.

When programming starts the arduino resets but the IDE immediately throws the error in the title.
I have confirmed that this is the correct port.
I am able to communicate with the arduino no problem from a Java processing script.
I can program the board from my macbook using the same version of the IDE.

So far I have tried the following:

  • Restarting the computer.
  • Manually removing and reinstalling drivers from https://www.wch.cn/download/CH341SER_EXE.html.
  • Reinstalling the arduino IDE
  • Using the legacy IDE
  • Uninstalling the device from device manager and allowing windows to automatically reinstall drivers.
  • Changing the cable and port used.

I can't think of any other issues that could be causing this.
Any ideas?

I suspect that that is your problem. And I do not know enough how you can prevent it.

This SparkFun page (How to Install CH340 Drivers - SparkFun Learn) has a link to drivers. Some people have reported success with the https://cdn.sparkfun.com/assets/learn_tutorials/8/4/4/CH341SER.EXE on that page.

Thanks!

I was using a newer version of that same driver EXE.
Uninstalling the device, then overwriting the newer driver with this old one solved the problem for me.

1 Like

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