# Can’t upload code on MKRZero

**URL:** <https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434>\
**Category:** MKR Zero\
**Created:** [May 22, 2022, 8:38am UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434 "2022-05-22T08:38:44Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefa24](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stefa24/32/214229_2.png) [@stefa24](https://forum.arduino.cc/u/stefa24)\
**Post date:** [May 22, 2022, 8:38am UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434/1 "2022-05-22T08:38:45Z")

</div>

Hello  
Following old posts  
I tried the "quickly double tap the reset button" that will put it into bootloader mode on another COM port and allow me to upload as normal

```cpp
Sketch uses 39216 bytes (14%) of program storage space. Maximum is 262144 bytes.
Global variables use 3884 bytes (11%) of dynamic memory, leaving 28884 bytes for local variables. Maximum is 32768 bytes.
Atmel SMART device 0x10010005 found
Device : ATSAMD21G18A
Chip ID : 10010005
Version : v2.0 [Arduino:XYZ] Dec 20 2016 15:36:46
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
Lock Regions : 16
Locked : none
Security : false
Boot Flash : true
BOD : true
BOR : true
Arduino : FAST_CHIP_ERASE
Arduino : FAST_MULTI_PAGE_WRITE
Arduino : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
done in 0.870 seconds

Write 39216 bytes to flash (613 pages)
[==============================] 100% (613/613 pages)
done in 0.304 seconds

Verify 39216 bytes of flash with checksum.
Verify successful
done in 0.035 seconds
CPU reset.

```

---

<div class="post-metadata">

**Author:** ![in0](https://avatars.discourse-cdn.com/v4/letter/i/77aa72/32.png) [@in0](https://forum.arduino.cc/u/in0)\
**Post date:** [May 22, 2022, 8:45am UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434/2 "2022-05-22T08:45:05Z")

</div>

Hi @stefa24. Please provide a detailed description of the problem.

The output you shared appears to be from a successful upload.

---

<div class="post-metadata">

**Author:** ![stefa24](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stefa24/32/214229_2.png) [@stefa24](https://forum.arduino.cc/u/stefa24)\
**Post date:** [May 23, 2022, 8:27am UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434/3 "2022-05-23T08:27:03Z")

</div>

Hi

```cpp
The output you shared appears to be from a successful upload.

```

I shared for information about my ZERO  
The problem I met I wasn t able to make any upload after some updates, below the message after several minutes later I lunched upload command

```cpp
Arduino: 1.8.19 (Windows 10), Board: "Arduino MKRZERO"

Sketch uses 39216 bytes (14%) of program storage space. Maximum is 262144 bytes.

Global variables use 3884 bytes (11%) of dynamic memory, leaving 28884 bytes for local variables. Maximum is 32768 bytes.

An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

```

---

<div class="post-metadata">

**Author:** ![MartinL](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/martinl/32/216911_2.png) [@MartinL](https://forum.arduino.cc/u/MartinL)\
**Post date:** [May 23, 2022, 10:12am UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434/4 "2022-05-23T10:12:34Z")

</div>

Hi @stefa24

Have you attempted double tapping the reset button, selecting the bootloader's COM port and uploading the code oncemore?

The issue with boards that use their native USB for uploading code, is that they require the current program (sketch) to be functioning, in order to allow the next to be uploaded. If the current program crashes for whatever reason, it prevents the auto-upload from working correctly. When this happens, it's necessary to manually activate bootloader mode by double tapping the reset button.

This is in contrast to boards such as the Arduino Uno/Nano/Mega that use a co-processor or FTDI USB-to-Serial chip. This device acts as an intermediary and keeps the COM port connection alive no matter what the current state of the main microcontroller.

---

<div class="post-metadata">

**Author:** ![stefa24](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stefa24/32/214229_2.png) [@stefa24](https://forum.arduino.cc/u/stefa24)\
**Post date:** [May 24, 2022, 7:27am UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434/5 "2022-05-24T07:27:39Z")

</div>

> [@MartinL](#):
>
> Have you attempted double tapping the reset button, selecting the bootloader's COM port and uploading the code oncemore?

Yes I did

thanks for the explanation

---

<div class="post-metadata">

**Author:** ![MartinL](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/martinl/32/216911_2.png) [@MartinL](https://forum.arduino.cc/u/MartinL)\
**Post date:** [May 24, 2022, 7:50am UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434/6 "2022-05-24T07:50:40Z")

</div>

Hi @stefa24

Have you tried disconnecting the board from any external circuitry and uploading a simple "blink" sketch?

Does double tapping the reset button actually place the board into bootloader mode and does the new COM port appear in the Arduino IDE?

---

<div class="post-metadata">

**Author:** ![stefa24](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stefa24/32/214229_2.png) [@stefa24](https://forum.arduino.cc/u/stefa24)\
**Post date:** [May 24, 2022, 11:47am UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434/7 "2022-05-24T11:47:20Z")

</div>

> [@MartinL](#):
>
> Have you tried disconnecting the board from any external circuitry and uploading a simple "blink" sketch?

didn t worked

> [@MartinL](#):
>
> Does double tapping the reset button actually place the board into bootloader mode and does the new COM port appear in the Arduino IDE?

yes it does

---

<div class="post-metadata">

**Author:** ![MartinL](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/martinl/32/216911_2.png) [@MartinL](https://forum.arduino.cc/u/MartinL)\
**Post date:** [May 24, 2022, 11:55am UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434/8 "2022-05-24T11:55:54Z")

</div>

Hi @stefa24

> [@stefa24](#):
>
> didn t worked

Ok, have you selected the bootloader COM port in the Arduino IDE?

On the menu bar select Tools-\>Port, then select the new COM port for your board.

If you check a second time, the COM port should be ticked.

Then try uploading a basic sketch with visual feedback, such as "blink" oncemore.

---

<div class="post-metadata">

**Author:** ![stefa24](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stefa24/32/214229_2.png) [@stefa24](https://forum.arduino.cc/u/stefa24)\
**Post date:** [May 24, 2022, 11:56am UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434/9 "2022-05-24T11:56:46Z")

</div>

ok I did, now I can upload the sketch

---

<div class="post-metadata">

**Author:** ![MartinL](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/martinl/32/216911_2.png) [@MartinL](https://forum.arduino.cc/u/MartinL)\
**Post date:** [May 24, 2022, 11:57am UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434/10 "2022-05-24T11:57:12Z")

</div>

@stefa24 Is the LED on your board blinking?

---

<div class="post-metadata">

**Author:** ![MartinL](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/martinl/32/216911_2.png) [@MartinL](https://forum.arduino.cc/u/MartinL)\
**Post date:** [May 24, 2022, 12:09pm UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434/11 "2022-05-24T12:09:30Z")

</div>

> [@stefa24](#):
>
> ok I did, now I can upload the sketch

@stefa24 Once you've uploaded the code with the board in bootloader mode, it will run the sketch and return to normal operation. Auto-upload will start working again, (although you might have to select the new COM port in the IDE, as you just did for the bootloader).

---

<div class="post-metadata">

**Author:** ![stefa24](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stefa24/32/214229_2.png) [@stefa24](https://forum.arduino.cc/u/stefa24)\
**Post date:** [May 24, 2022, 12:49pm UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434/12 "2022-05-24T12:49:33Z")

</div>

I did  
Now the board is working again  
thanks

---

<div class="post-metadata">

**Author:** ![MartinL](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/martinl/32/216911_2.png) [@MartinL](https://forum.arduino.cc/u/MartinL)\
**Post date:** [May 24, 2022, 2:09pm UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434/13 "2022-05-24T14:09:57Z")

</div>

@stefa24 Glad to hear your board's up and running again 😃.

---

<div class="post-metadata">

**Author:** ![stefa24](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/stefa24/32/214229_2.png) [@stefa24](https://forum.arduino.cc/u/stefa24)\
**Post date:** [May 24, 2022, 7:59pm UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434/14 "2022-05-24T19:59:12Z")

</div>

thanks to you all  
😀

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [November 20, 2022, 7:59pm UTC](https://forum.arduino.cc/t/can-t-upload-code-on-mkrzero/994434/15 "2022-11-20T19:59:36Z")

</div>

Closed on November 20, 2022, 7:59pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
