# An error occurred while uploading the sketch

**URL:** <https://forum.arduino.cc/t/an-error-occurred-while-uploading-the-sketch/1270073>\
**Category:** Uploading\
**Created:** [June 10, 2024, 9:06am UTC](https://forum.arduino.cc/t/an-error-occurred-while-uploading-the-sketch/1270073 "2024-06-10T09:06:25Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![zamanbujang](https://avatars.discourse-cdn.com/v4/letter/z/3ec8ea/32.png) [@zamanbujang](https://forum.arduino.cc/u/zamanbujang)\
**Post date:** [June 10, 2024, 9:06am UTC](https://forum.arduino.cc/t/an-error-occurred-while-uploading-the-sketch/1270073/1 "2024-06-10T09:06:25Z")

</div>

Why this happened Sketch uses 6600 bytes (20%) of program storage space. Maximum is 32256 bytes.  
Global variables use 293 bytes (14%) of dynamic memory, leaving 1755 bytes for local variables. Maximum is 2048 bytes.

---

<div class="post-metadata">

**Author:** ![rsmls](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@rsmls](https://forum.arduino.cc/u/rsmls)\
**Post date:** [June 10, 2024, 9:07am UTC](https://forum.arduino.cc/t/an-error-occurred-while-uploading-the-sketch/1270073/2 "2024-06-10T09:07:14Z")

</div>

This tells you that the sketch consumes only a small part of the memory capacity of the board, so it's all good. Proceed with uploading the sketch and see if it works.

---

<div class="post-metadata">

**Author:** ![zamanbujang](https://avatars.discourse-cdn.com/v4/letter/z/3ec8ea/32.png) [@zamanbujang](https://forum.arduino.cc/u/zamanbujang)\
**Post date:** [June 10, 2024, 9:09am UTC](https://forum.arduino.cc/t/an-error-occurred-while-uploading-the-sketch/1270073/3 "2024-06-10T09:09:59Z")

</div>

My uploading appear error?

---

<div class="post-metadata">

**Author:** ![zamanbujang](https://avatars.discourse-cdn.com/v4/letter/z/3ec8ea/32.png) [@zamanbujang](https://forum.arduino.cc/u/zamanbujang)\
**Post date:** [June 10, 2024, 9:11am UTC](https://forum.arduino.cc/t/an-error-occurred-while-uploading-the-sketch/1270073/4 "2024-06-10T09:11:01Z")

</div>

An error occurred while uploading the sketch---\>this is the error

---

<div class="post-metadata">

**Author:** ![rsmls](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@rsmls](https://forum.arduino.cc/u/rsmls)\
**Post date:** [June 10, 2024, 9:21am UTC](https://forum.arduino.cc/t/an-error-occurred-while-uploading-the-sketch/1270073/5 "2024-06-10T09:21:56Z")

</div>

What you posted in #1 is not an error.

---

<div class="post-metadata">

**Author:** ![zamanbujang](https://avatars.discourse-cdn.com/v4/letter/z/3ec8ea/32.png) [@zamanbujang](https://forum.arduino.cc/u/zamanbujang)\
**Post date:** [June 10, 2024, 9:26am UTC](https://forum.arduino.cc/t/an-error-occurred-while-uploading-the-sketch/1270073/6 "2024-06-10T09:26:59Z")

</div>

Because I try several times.After completed uploading and error appear.

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [June 10, 2024, 9:34am UTC](https://forum.arduino.cc/t/an-error-occurred-while-uploading-the-sketch/1270073/7 "2024-06-10T09:34:39Z")

</div>

> [@zamanbujang](#):
>
> After completed uploading and error appear.

Show the error. If it is the output window/pane of the IDE, copy it and paste it here in a new reply using code tags.

Which board are you compiling for? How do you upload (via USB or via ICSP).

---

<div class="post-metadata">

**Author:** ![rsmls](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@rsmls](https://forum.arduino.cc/u/rsmls)\
**Post date:** [June 10, 2024, 10:00am UTC](https://forum.arduino.cc/t/an-error-occurred-while-uploading-the-sketch/1270073/8 "2024-06-10T10:00:31Z")

</div>

> [@zamanbujang](#):
>
> After completed uploading and error appear.

So does the upload complete, or does an error appear? And if an error appears, what is it? Again (third time), the information in post #1 is not an _error_. It's basically a message that tells you that the sketch compiled OK and that it will fit in the Arduino's memory.

---

<div class="post-metadata">

**Author:** ![zamanbujang](https://avatars.discourse-cdn.com/v4/letter/z/3ec8ea/32.png) [@zamanbujang](https://forum.arduino.cc/u/zamanbujang)\
**Post date:** [June 10, 2024, 10:46am UTC](https://forum.arduino.cc/t/an-error-occurred-while-uploading-the-sketch/1270073/9 "2024-06-10T10:46:30Z")

</div>

Settled problem

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [June 10, 2024, 12:52pm UTC](https://forum.arduino.cc/t/an-error-occurred-while-uploading-the-sketch/1270073/10 "2024-06-10T12:52:17Z")

</div>

So maybe you can give a good description of the problem and how you solved it; it will help others.

---

<div class="post-metadata">

**Author:** ![leonmcd](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@leonmcd](https://forum.arduino.cc/u/leonmcd)\
**Post date:** [June 19, 2024, 10:03pm UTC](https://forum.arduino.cc/t/an-error-occurred-while-uploading-the-sketch/1270073/11 "2024-06-19T22:03:23Z")

</div>

Try to load and run Hello World on Arduino Leonardo ETH.  
Found that for the Leonardo boards you need to wait for the serial port connect.  
So I added this...  
void setup() {  
// put your setup code here, to run once:  
// initialize serial communication at 9600 bits per second:  
Serial.begin(9600);

// wait for serial port to connect. Needed for native USB port only:  
while (!Serial) {  
; // wait for serial port to connect. Needed for native USB port only  
}

// print a message to the Serial Monitor:  
Serial.println("Hello, world3");  
}

void loop() {  
// put your main code here, to run repeatedly:

}

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [June 20, 2024, 5:36am UTC](https://forum.arduino.cc/t/an-error-occurred-while-uploading-the-sketch/1270073/12 "2024-06-20T05:36:09Z")

</div>

@leonmcd , that does not help with upload problems.

Please edit your post, select all code and click the `<CODE/>` button to apply code tags and next save your post.

Code tags make that your code is easier to read and easier to copy and the forum software will display it correctly. See [How to get the best out of this forum](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966).

---

<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:** [December 17, 2024, 5:36am UTC](https://forum.arduino.cc/t/an-error-occurred-while-uploading-the-sketch/1270073/13 "2024-12-17T05:36:24Z")

</div>

Closed on December 17, 2024, 5:36am UTC

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