I\'ve uploaded a sketch to an Arduino Uno whose loop is something like this:
void loop(){
Serial.println(\"Hello, World!\");
}
So, now,
I had this issue as well. I tried the above methods and none seemed to work, however something that did work (somehow, not sure if it was just a freak thing or it is actually a way to do it) was:
Here is the best way that works out if you are trying to program through the USB cable:
You are all set!
The only way it worked for me for arduino nano 33 iot is via pressing the reset button on the board continuously many time then press uoplad!
I also had your problem,and I solved the problem using the following steps (though you may already finish the problem, it just shares for anyone who visit this page):
I had the same problem on two Arduinos (one Uno, and one Modern Device Freeduino/USB Host board) and the window between reset and the beginning of serial port usage was so small that it was impossible to upload.
I finally fixed the problem by purchasing another Arduino Uno and building an ISP cable per these instructions, and using it to flash the Bare Bones app from the examples into each inaccessible board, using Arduino IDE version 0023, following these instructions to change preferences.txt. (Be sure to save the original file before editing it so you can replace it after you've rescued your Arduino.)
It took one quick upload to fix each board. Such a fast fix after so much grief. You might not want to purchase another Arduino, but consider these benefits:
Be sure you are not accessing the serial port from a terminal. That loop (or any code) should not prevent the Arduino from being programmed.