Having to constantly reinstall ch340 driver for nano

I've just started having this problem. I constantly have to reinstall the ch340 driver in order for my nano to use the port. It works fine until I close the program or turn of the computer. Then I have to do the same thing over again. I've turned off windows 11 updates for drivers, but the problem continues - only for the nano. My ESP boards run fine. As I mentioned it just happened so I'm wondering if it has to do with either a windows 11 update or and IDE 2.0 update. Am I alone with this problem?

Then what happens? Please describe the actual problem. Post any error messages that appear.

Why do you think you have to reinstall the driver?

Why did you turn off driver updates?

What other fixes have you tried?

Does your operating system (which one) still recognise the connected board when this happens?

If yes, can a different terminal program still open the port?

I have the same problem since Microsoft updated the ch340 driver in february.
When I open a serial monitor I get the following error messages.

In arduino: 'Error while setting serial port parameters: 57,600 N 8 1'

In VScode: 'Cannot configure port, something went wrong. Original message: PermissionError(13, 'A device attached to the system is not functioning.', None, 31)'

In arduino the serial monitor is working anyway. But I can't upload. The temporary solution is to reinstall the ch340 driver. It stops working again after the next reboot and often after sleep.

Hi @s1de7

Does the upload fail with the error message "can't set com-state ..."? That is the distinct error message that we see associated with similar reports from other users.

You could try the procedure I describe here (and alternative procedures in the following replies if that one doesn't work):

I haven't received any reports from the users who followed those procedures that the fault later returned so hopefully it provides a persistent fix.

1 Like

Thank you for your fast response!
Unfortunately I had followed the instructions in the linked post already before I replied here. Windows will eventually update the driver and to disable driver updates is not acceptable for me. What I find curious is that simply reinstalling the current driver version will fix the problem for the current session. For most people who occasionally upload a scetch this would be an easy fix. But I need a constant connection to the board because I use it for monitoring sensors and it gets really annoying having to reinstall the driver on every reboot.

So my personal conclusion would be to buy a genuine nano for this project.

Thank you for your help!

I'm sorry to hear that. I am not able to reproduce the error with my own CH340-based boards so my investigations of this problem have all been based on the information I receive from the affected users.

I did see an interesting claimed workaround here:

I also noticed a discouraging report about the persistence of that workaround though:

but maybe it is worth a try at least to see whether it will provide a permanent fix for you.

I agree. The subject is interesting to me as someone trying to provide support to the many affected users, but your energy is better spent on progressing with your Arduino projects than fighting with Windows to keep a dodgy cheap derivative board working.

1 Like

I have purchased a genuine board but have not switched yet. Windows decided not to update the manually installed ch340 driver since, haha. The driver even survived a windows version update. I did NOT disable driver updating. So installing older versions may help.

That board does not use the CH340.

Yes, that is the point.

i too have the same problem... i regularly need to downgrade it to the 08-08-2014 version driver...
its a windows 11 specific issue... anything below windows11 works fine... what really annoys me is widows doesnt have an option to exclude the driver from being updated

wch.cn - Ports - 3.8.2023.2<<<<<< this is the update that you need to stay away from

Hi @meldren808. Did you try the "roll-back" procedure, as described here?:

If not, I recommend giving it a try. A large number of users have reported that procedure solves the problem and I haven't see reports of the roll-back later being reversed by Windows. So it seems to me that Windows is smart enough to understand that when a user performs a roll-back, they want to stick with that specific version until such time as they manually trigger an update.

No No you are wrong! windows don't take into account that you need and older driver version.
there was an automated system that update the driver to the last version.

So you loose a lot of time to resinstall the old driver because windows has updated your old driver
and i have not found until now how to avoid that...
regards

Hi @knasson

Did you perform a "roll back" procedure as described in the instructions I provided?

When you do that, Windows is smart enough to understand that it should continue to use the version you rolled back to and not automatically update again to the new driver version. I have personally verified this on my own computer.

I have supported dozens of affected users with this procedure. If the solution stopped working for them soon after, they surely would have reported this, yet they did not.

I found that "roll back" worked - to enable a Nano device that would not work. Then... I connected a different Arduino which triggered a driver update and a reboot.

And (of course) that device worked fine... but the other device once again wouldn't work.

Grr.

Hi @logullo. I'm sorry to hear that. Did you try performing the "roll back" procedure once again for the different Arduino?

Even though using the old driver version is not necessary for that different Arduino (I guess that, unlike your Nano, the different Arduino has a legitimate CH340 chip), it should still work even with the older driver.

Since the time I wrote the "roll back" instructions linked above, I found a way to get the newest version of the driver from before the problematic release from a trusted source (the driver provided by SparkFun is very old). These are the improved instructions:

  1. Click the following link to download the previous version of the driver from the chip manufacturer's website:
    https://www.wch-ic.com/downloads/file/65.html?time=2023-03-16%2022:57:59
  2. Wait for the download to finish.
  3. Run the downloaded CH341SER.EXE file.
  4. A "User Account Control" dialog may now appear asking "Do you want to allow this app to make changes to your device?". Click the "Yes" button.
  5. A "DriverSetup(X64)" dialog will appear. Click the "INSTALL" button in the dialog.
  6. Wait for the driver installation to finish, as indicated by the appearance of a "Driver install success!" dialog.
  7. Click the "OK" button in the "Driver install success!" dialog.
  8. Click the X icon at the top right of the "DriverSetup(X64)" dialog to close it.
  9. Close Arduino IDE if it is running.
  10. Connect the Arduino board to your computer with a USB cable.
  11. Open the Windows Device Manager.
  12. Select View > Devices by type from the Device Manager menus.
  13. Open the "View" menu.
  14. If there is a to the left of the "Show hidden devices" menu item, click on "Show hidden devices" to disable it.
  15. Open the "Ports (COM & LPT)" section of the Device Manager tree.
  16. You should see a port identified as "USB-SERIAL CH340 (COMn)" under the "Ports (COM & LPT)" section (where "COMn" is some serial port e.g., COM4). Double click on that item.
    The "USB-SERIAL CH340 (COMn) Properties" dialog will open.
  17. Select the "Driver" tab of the "USB-SERIAL CH340 (COMn) Properties" dialog.
  18. You will see a "Roll Back Driver" button in the dialog. If it is not clickable, perform the following instructions:
    1. Click the "Update driver" button.
      An "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog will open.
    2. Click on "Search automatically for drivers" in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
    3. You should now see the driver installation wizard update the driver. Wait for the update to finish, as indicated by the message "Windows has successfully updated your drivers" in the dialog.
      :exclamation: It is possible you will instead see the message "The best drivers are already installed". If so, please stop following the instructions here and reply on the forum thread to let me know. I'll provide alternative instructions you can follow.
    4. Click the "Close" button in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
      The dialog will close.
  19. Click the "Roll Back Driver" button in the "USB-SERIAL CH340 (COMn) Properties" dialog.
    The "Driver Package rollback" dialog will open.
  20. Click the radio button next to "My apps don't work with this driver" in the "Driver Package rollback" dialog .
  21. Click the "Yes" button.
    The "Driver Package rollback" dialog will close.
  22. Click the "Close" button in the "USB-SERIAL CH340 (COMn) Properties" dialog.

Now start Arduino IDE again and repeat whatever you were doing before when you encountered that error before. Hopefully this time you will not encounter that "can't set com-state" error during the sketch upload.

1 Like

Thanks! Wow -- thank you for the very helpful reply.
The "problem" Nano was part of a kit, and upon examination it seems that the CH340 chip on the underbelly is not a legit CH340. No printing on the case (!).

Just received some new Nano clones and these have CH340 chips with proper markings. And they work with the updated Windows driver.

Life is too short to fight with fake chips and trying to fight driver updates. Lesson learned. But again: I really appreciate your help.

To anyone else that ends up here while fighting the same problem I was having: I suggest you try a different supplier -- and make sure the USB-to-serial chips are genuine :slight_smile:

1 Like

You are welcome.

Yeah, we are noticing this is a common characteristic of the chips that are incompatible with the latest version of the CH340 driver.

I agree that is the best approach, and good advice for others.

1 Like

hello @ptillisch,

"If so, please stop following the instructions here and reply on the forum thread to let me know. I'll provide alternative instructions you can follow."

on one of my computers I could not get the Roll Back Drfiver button.

If you can provide alternate instructions I would be grateful.

Cheers,

Stephen

Hi @sasymon.

I have found that when the driver installation gets into this state, it can be solved by uninstalling and then reinstalling the drivers. After that, the "roll back" option should be enabled.

I'll provide instructions you can follow to do that:

  1. Close Arduino IDE if it is running.
  2. Connect the Arduino board to your computer with a USB cable.
  3. Open the Windows Device Manager.
  4. Select View > Devices by type from the Device Manager menus.
  5. Open the "View" menu.
  6. If there is a to the left of the "Show hidden devices" menu item, click on "Show hidden devices" to disable it.
  7. Open the "Ports (COM & LPT)" section of the Device Manager tree.
  8. You should see a port identified as "USB-SERIAL CH340 (COMn)" under the "Ports (COM & LPT)" section (where "COMn" is some serial port e.g., COM4). Double click on that item.
    The "USB-SERIAL CH340 (COMn) Properties" dialog will open.
  9. Select the "Driver" tab of the "USB-SERIAL CH340 (COMn) Properties" dialog.
  10. Click the "Uninstall Device" button.
    The "Uninstall Device" dialog will open.
  11. Check the box next to "☐ Attempt to remove the driver for this device.".
  12. Click the "Uninstall" button.
    The "Uninstall Device" and "USB-SERIAL CH340 (COMn) Properties" dialogs will close.
  13. Disconnect the USB cable of the Arduino board from your computer.
  14. Reconnect the USB cable of the Arduino board to your computer.
  15. Wait for the "USB-SERIAL CH340 (COMn)" device to appear under the "Ports (COM & LPT)" section of the Device Manager tree.
    :exclamation: This will take a couple of minutes as Windows must first automatically reinstall the driver.
    :exclamation: It might appear first as a "USB2.0-Serial" device under the "Other devices section of the tree. Just wait for a little longer and it will appear in its final place under the "Ports (COM & LPT)" section.
  16. Click the following link to download the previous version of the driver from the chip manufacturer's website:
    https://www.wch-ic.com/downloads/file/65.html?time=2023-03-16%2022:57:59
  17. Wait for the download to finish.
  18. Run the downloaded CH341SER.EXE file.
  19. A "User Account Control" dialog may now appear asking "Do you want to allow this app to make changes to your device?". Click the "Yes" button.
  20. A "DriverSetup(X64)" dialog will open. Click the "INSTALL" button in the dialog.
  21. Wait for the driver installation to finish, as indicated by the appearance of a "Driver install success!" dialog.
  22. Click the "OK" button in the "Driver install success!" dialog.
    The dialog will close.
  23. Click the X icon at the top right of the "DriverSetup(X64)" dialog.
    The dialog will close.
  24. Switch back to the Windows "Device Manager".
  25. Double click on the "USB-SERIAL CH340 (COMn)" device under the "Ports (COM & LPT)" section.
    The "USB-SERIAL CH340 (COMn) Properties" dialog will open.
  26. Select the "Driver" tab of the "USB-SERIAL CH340 (COMn) Properties" dialog.
  27. Click the "Update driver" button.
    An "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog will open.
  28. Click on "Search automatically for drivers" in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
  29. You should now see the driver installation wizard update the driver. Wait for the update to finish, as indicated by the message "Windows has successfully updated your drivers" in the dialog.
  30. Click the "Close" button in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
    The dialog will close.
  31. Click the "Roll Back Driver" button in the "USB-SERIAL CH340 (COMn) Properties" dialog.
    The "Driver Package rollback" dialog will open.
  32. Click the radio button next to "My apps don't work with this driver" in the "Driver Package rollback" dialog .
  33. Click the "Yes" button.
    The "Driver Package rollback" dialog will close.
  34. Click the "Close" button in the "USB-SERIAL CH340 (COMn) Properties" dialog.

Now start Arduino IDE again and repeat whatever you were doing before when you encountered that error before. Hopefully this time you will not encounter that "can't set com-state" error during the sketch upload.