uploading error Arduino1010


I get the following error

An error occurred while uploading the sketch

The program compiles. I attached output that occurs after program compiles.

Is there some thing that is not configured correct. The port works with other devices. I am using WIN 10.


error upload.txt (1.13 KB)

Is COM5 labeled with "Arduino MKR WiFi 1010" in the Arduino IDE's Tools > Port menu?

Yes COM5 is labeled with "Arduino MKR WiFi 1010" in the Arduino IDE's Tools > Port menu

The way uploads work is:

  1. The Arduino IDE (or the upload tool used by the Arduino IDE) sends a signal for the microcontroller to reset.
  2. The microcontroller resets.
  3. The bootloader runs and waits (normally only for a short time) for an upload to start.
  4. The upload tool sends the program to the microcontroller, where the bootloader writes it to flash memory.

On the boards with native USB (like the one you're using), the way the IDE signals the microcontroller to reset is by opening a serial connection at 1200 baud. There is some special code running on the microcontroller in the background of your sketch that does the reset when it detects that 1200 baud connection.

In some cases, your sketch code might cause that reset code to be missing or not working correctly, which will mean the bootloader never runs and the upload fails with the error you're seeing.

The fix is to manually reset the board.

Try this:

  1. Press and release the reset button on your board quickly twice.
    You should now see the LED on the board pulsing, which means the bootloader is running.
    The double reset causes the bootloader to run until the board is reset normally, powered off, or an upload is done.
  2. Select the port of your board from the Tools > Port menu.
    The port may be different when the bootloader is running so don't assume you already have the correct port selected.
  3. Start an upload in the Arduino IDE.

The upload should now finish successfully.

After this, you should be able to go back to doing normal uploads without needing to use the reset button technique. If you still need to do the reset trick to do uploads after this, the problem may be caused by your code. You can verify this by uploading a simple sketch like File > Examples > 01.Basics > BareMinimum.

1 Like

The case can be closed.

The procedure of pressing the button quickly and make sure the port is correct cleared my error.

You're welcome. I'm glad to hear it's working now. Enjoy!