0

I have a few cheap Nano clones that I bought online that have worked for the past couple of months. They were working fine today until suddenly the Arduino IDE had trouble uploading sketches to them.

Here is the full error message:

Arduino: 1.8.19 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"

Sketch uses 2080 bytes (6%) of program storage space. Maximum is 30720 bytes.

Global variables use 212 bytes (10%) of dynamic memory, leaving 1836 bytes for local variables. Maximum is 2048 bytes.

An error occurred while uploading the sketch

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

I have tried troubleshooting multiple ways, but none of the following worked:

  • unplugged/replugged in nano
  • restarted computer
  • swapped to another nano clone
  • changed USB cables
  • changed USB ports
  • tried uploading other code
  • downloaded the CH340 drivers

I tried uploading to an Arduino Mega and that DID work, however, I would like to be able to use the Nano.

I am using version 1.8.19

Thanks for the help.

  • Did you update windoz or the Arduino IDE? – VE7JRO Jul 26 '23 at 19:53
  • @VE7JRO No, one minute it was working fine and the next I try to upload and it doesn't work – NibbledPots Jul 27 '23 at 01:12
  • 1
    are you saying that you were able to upload a sketch, and then a few minutes later, you were not able to upload a sketch? ... it could be caused by the sketch that uploaded successfully – jsotola Jul 27 '23 at 03:17
  • @jsotola yes, that is exactly what happened, I am looking into issue with the watchdog timer but any other ideas would be helpful – NibbledPots Jul 27 '23 at 12:45
  • You posted an answer saying it was a problem with the USB driver, which you then deleted. Was that the problem or not? Knowing this saves other people from trying to solve a problem which is already solved. – Nick Gammon Jul 27 '23 at 23:27
  • In short: fake CH340 + latest drivers stopped being compatible (but unlike FTDI few years ago they didn't brick the fakes, it's just not working) – KIIV Jul 30 '23 at 07:24

2 Answers2

0

See Have I bricked my Arduino Uno? Problems with uploading to board.

I know you mentioned Nano, but it is the same concept.

If a sketch you previously uploaded sets up the watchdog timer to fire too quickly the new sketch may not upload.

Try holding down reset while you start the upload process and then release reset when the upload starts. See the part of the linked answer headed "Watchdog timer problems".

Nick Gammon
  • 38,184
  • 13
  • 65
  • 124
0

The cheap Nano requires you to use the old bootloader. I use them without problems most of the time. When it fails to upload I first check tools and validate the bootloader it is running. If it is correct I then close the IDE, power down the Nano and then reopen and repower it, between the two it usually solves the problem.

Gil
  • 1,833
  • 8
  • 17