I have received the following error messages while trying to upload a sketch. The sketch works with the Uno R3 but none of the Nanos will upload.
The Nano R4 and Every are brand new direct from Arduino Store.
I have used the same laptop USB socket.
I have searched the Forum and Google but cannot find solutions.
Arduino Nano using a cable from a camera which I assume must be a data cable -
Error: cannot set com-state for \.\COM4
Error: unable to open port COM4 for programmer arduino
Failed uploading: uploading error: exit status 1.
Arduino Nano R4 using Arduino’s own “blue/white” cable -
Error: cannot open port \.\COM4: The system cannot find the file specified.
Error: unable to open port COM4 for programmer arduino
Failed uploading: uploading error: exit status 1
Error: programmer is not responding.
Arduino Every – similar errors messages but that might be due to cables possibly not being dada cables.
Hi @elegooman.
This error occurs when uploading to the boards that use specific batches of the WCH CH340 USB chip. The problem only occurs when using the latest version of the CH340 Windows driver.
The workaround for the problem is to perform a "roll back" to an older version of the driver that is compatible with these problematic "CH340" chips. I'll provide instructions you can follow to do that:
- Click the following link to download the previous version of the driver from an archive of the chip manufacturer's website:
https://web.archive.org/web/20220519153932/https://www.wch-ic.com/downloads/file/65.html
- Wait for the download to finish.
- Run the downloaded
CH341SER.EXE file.
- 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.
- A "DriverSetup(X64)" dialog will open. Click the "INSTALL" button in the dialog.
- Wait for the driver installation to finish, as indicated by the appearance of a "Driver install success!" dialog.
- Click the "OK" button in the "Driver install success!" dialog.
The dialog will close.
- Click the X icon at the top right of the "DriverSetup(X64)" dialog
The dialog will close.
- Close Arduino IDE if it is running.
- Connect the Arduino board to your computer with a USB cable.
- Open the Windows Device Manager.
- Select View > Devices by type from the Device Manager menus.
- Open the "View" menu.
- If there is a ✓ to the left of the "Show hidden devices" menu item, click on "Show hidden devices" to disable it.
- Open the "Ports (COM & LPT)" section of the Device Manager tree.
- 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.
- Select the "Driver" tab of the "USB-SERIAL CH340 (COMn) Properties" dialog.
- You will see a "Roll Back Driver" button in the dialog. If it is not clickable, perform the following instructions:
- Click the "Update driver" button.
An "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog will open.
- Click on "Search automatically for drivers" in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
- 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.
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 this forum topic to let us know. I'll provide alternative instructions you can follow.
- Click the "Close" button in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
The dialog will close.
- Click the "Roll Back Driver" button in the "USB-SERIAL CH340 (COMn) Properties" dialog.
The "Driver Package rollback" dialog will open.
- Click the radio button next to "My apps don't work with this driver" in the "Driver Package rollback" dialog .
- Click the "Yes" button.
The "Driver Package rollback" dialog will close.
- 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 everything will work as expected.
This error might be caused by having the wrong port selected from the Tools > Port menu in Arduino IDE.
Please perform this experiment to verify that the port you have selected is your Arduino board:
- Connect the Arduino board to your computer with a USB cable (if it is not already).
- Select Tools > Port from the Arduino IDE menus. If one of the ports in the menu is labeled with the board name (e.g., "COM42 (Arduino Uno)"), that is the port of your Arduino board.
If you saw the port labeled with the board name in the Tools > Port menu, select that port and try uploading again.
If this doesn't solve the problem, please reply here on this forum topic with the answers to the following questions:
- While following those instructions, did you see a port in the Tools > Port menu that was labeled with the board name?
- If you did see a labeled port, was the upload successful after you selected that port?
Follow the same procedure I described above for the Nano R4 problem.
If you see a new port appear, then that result will indicate that the USB cable is a data cable. If you do not see a new port appear, then that result will indicate that the USB cable may not be a data cable.
Your assistance is much appreciated.
I have followed your instructions in the first part however at point 16 the only port available is "USB Serial Device (COM3)".
I've tried several times starting from downloading the CH341SER.EXE again but get the same result.
With respect to point 3 following point 18, when I downloaded I received the following message "successfully preinstalled in advance."