[SOLVED] Can't upload sketches to Arduino micro

I can't upload sketches to my Arduino Micro anymore. After i uploaded a self-opening sketch that will execute when plugged in, i decided to delete the sketch because i wanted to edit the script. I deleted it but then i couldn't upload a new sketch anymore. I unplugged it and plugged it back in. The blue LED was lid but the orange one was only flashing for less than a second. The green one doesn't even turn on anymore.

I tried to reset it with the button, waited 8 seconds but it disconected from my pc while it was still on. In the first 8 seconds i cannot upload. This means it is impossible to upload because after 8 seconds, it disconnects automaticly.

C:\Users\PCNAME\AppData\Local\Temp\ccZ0uwgH.ltrans0.ltrans.o: In function `main':
C:\Users\PCNAME\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino/main.cpp:43: undefined reference to `setup'
C:\Users\PCNAME\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino/main.cpp:46: undefined reference to `loop'
collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

I tried to find solutions but found none. Please help me.

please post as txt not image

I did. Something else i need to do? :slight_smile:

Was that the entire listing? That is not an upload error, it is a compilation error. Try resetting the GUI and upload an example sketch like Blink.

1 Like

2 posts were split to a new topic: Countdown timer sketch

What did you delete and what do you want to edit - sketch/script ?? You cannot delete the sketch in the micro. You only can overwrite it with another ( correctly compiled! ) sketch.
Please post the sketch you want to upload. Seems you want to upload a sketch without a setup() and loop() function.

Or, are you talking about deleting files in the sketch folder?

Hey aarg, sorry for the late repsonse.

Thanks for helping me but i uploaded the code and now my green light works again how it should be. But i still get this output:

Sketch uses 3958 bytes (13%) of program storage space. Maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.
Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
    Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x44

Any idea what is going on?
(I'm a newbie btw. Sorry if i don't give you the right info.)

Ah i see. But i don't have the script anymore. :sweat_smile:

I just wanted to remove the previous script but i already did.

Thanks for your answer btw!

You tell me. The log you posted suggests a successful upload.

1 Like

Oh..whoops :sweat_smile:. But when i run the script, windows makes a disconnect sound. After a couple seconds it says it connected again. Is it supposed to disconnect when running?

Yes. The Arduino micro runs in one of two modes. In the first mode it executes the sketch, in the second one it's in bootloader mode. When you upload, it switches from execution mode to bootloader mode so you can upload. After that it switches back to execution mode.

I see, but it the script even runs when plugged in. Idk why.

const int dummy = 0;

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(100);                       // wait for a second
}

Um so...my arduino just...died?

If i plug it in windows says it doesnt regonize it.
One of the orange lights is also lit and doesn't blink.

I think i broke it lol.

By default it's in execution mode. If you enable verbose output during upload, you can see what happens once the IDE reports the memory usage.

It attempts to reset the board; any code that is uploaded has a very small piece of code that detects the baudrate change and results in a reset of the board. After the board is reset, a small part of code (technically part of the bootloader) determines the cause of the reset.

When it knows the cause of the reset, it will either wait for the upload or hand over to your code.

1 Like

Yes but now somehow my RX led (orange light) is being lit and it doesnt blink.

Windows also said it is unable to reconize the "Usb". I tried different micro-usb cables.
It is connected to my laptop btw.

Sorry for all my messages btw, i fixed it again. Sometimes this arduino makes me go crazy.

Thanks for the help y'all.

Cheers.

I mentioned earlier that there is a small piece of code that handles the baudrate change. There is also one to handle the identification of the board

A buggy sketch can overwrite variables used by those codes; either your board is no longer recognised or it does not react on the reset "command".

In my experience helping people here, it's always the sketch. Thosr problems will never happen when you load something innocent like blink.

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