But i tried everything I found on the web, unplugging, plugging my board into another com port, restarting but nothing worked, i am now ordering another usb cable hope that fixes it.
the strange thing is that it happen just so. i uploaded different sketches to my nano and now it is just not working and even not working on the other nanos. the uno is still working.
i have to say that it is not a genuine arduino but an AZ-Nano V3-Board with ATMEGA328.
does this problem occur only with non genuine arduino boards?
Sounds like a Windows driver problem. Re-install the driver for your board (get the right one for your board, the used chips vary by the manufacturer, chip means the USB2serial converter chip, not the MCU). Depending on the driver you may need to get an updated driver.
Hi @bird3670. Here are the instructions for installing an older version of the driver I've been sharing with affected users. Most of them have reported that it solves the "can't set com-state" error:
Open this tutorial from SparkFun in your browser: https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/all#drivers-if-you-need-them ⓘ We are using this tutorial as a source for an older version of the CH340 drivers. Generally I recommend only obtaining drivers from the manufacturer of the device, but WCH does not provide older versions of their drivers and SparkFun is trustworthy.
Click the "Windows (EXE)" link you see in red under the "Drivers (If You Need Them)" section of the tutorial.
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 appear. 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.
Click the X icon at the top right of the "DriverSetup(X64)" dialog to close it.
Close Arduino IDE if it is running.
Connect the Arduino board to your computer with a USB cable.
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 (COM_n_)" under the "Ports (COM & LPT)" section (where "COM_n_" is some serial port e.g., COM4). Right click on that item.
A context menu will open.
Select the "Drivers" tab of the "USB-SERIAL CH340 (COM_n_) Properties" dialog.
You will see a "Roll Back Driver" button in the dialog. If it is not clickable, perform the following instructions:
Select "Update driver" from the context menu.
An "Update Drivers Device - USB-SERIAL CH340 (COM_n_)" dialog will open.
Click on "Search automatically for drivers" in the "Update Drivers Device - USB-SERIAL CH340 (COM_n_)" 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 the forum thread to let me know. I'll provide alternative instructions you can follow.
Click the "Close" button in the "Update Drivers Device - USB-SERIAL CH340 (COM_n_)" dialog.
Click the "Roll Back Driver" button in the "USB-SERIAL CH340 (COM_n_) 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.
Click the "Close" button in the "USB-SERIAL CH340 (COM_n_) 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.