Board disconnets when uploading sketch

After compiling and verifying any sort of sketch (for this example a basic blinking LED)...

int LED = 9;

void setup() {

pinMode(LED, OUTPUT);

}

void loop() {

digitalWrite(LED, HIGH);

delay(500);

digitalWrite(LED, LOW);

delay(500);

}

...it says the code is OK to upload. In the bottom right corner it says the board is connected and I selected the right COM port. Then I press upload and it starts compiling normally, but right when it says "Uploading..." the board instantly disconnects and connects up again after Arduino IDE spits out the error "error uploading: exit status 1". This is not the board's fault, as I tried three different ones (2 Arduino Pro Micros and a Raspberry Pi Pico). Even more, I tried uploading from two different Windows 10 computers (A custom PC and a ThinkPad laptop) and three different USB cables. What is even more worrying is that when I tried uploading from a Mac, it worked perfectly fine. But I still need a solution for Win 10, as the Mac isn't mine. I think I found the exact issue, but I just don't know how to fix it.

Here is the part that I think causes the error:
image

You see, the board is connected to COM11 (I tried different ones but the same thing happens). Right when it starts uploading, it performs a reset on that port and then starts uploading to COM13 for some reason. The board is obviously still on COM11 so it doesn't recieve the code.

From Device Manager's perspective, it sees the connected board on COM11 up until the error happens. Then it stops seeing it but right after Ardu IDE spits out the error, everything goes back to the state before.

I still don't know how to fix that problem, so any feedback is highly appreciated (If anyone solves this I'll make sure to pay tribute to you on my YouTube channel)!

Additional information:
Arduino IDE version: 2.0.3

what is on com13?

Please post the FULL output, what you have shown is expected.

Sorry, I'm a beginner and that was the only thing that drew my attention :sweat_smile:
The full output:

Performing 1200-bps touch reset on serial port COM11
Waiting for upload port...
Upload port found on COM13
"C:\Users\badacz\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\badacz\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega32u4 -cavr109 "-PCOM13" -b57600 -D "-Uflash:w:C:\Users\badacz\AppData\Local\Temp\arduino-sketch-675DDCF20EECA37F63C3329255887445/sketch_mar1a.ino.hex:i"

avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Users\badacz\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : COM13
     Using Programmer              : avr109
     Overriding Baud Rate          : 57600
     AVR Part                      : ATmega32U4
     Chip Erase delay              : 9000 us
     PAGEL                         : PD7
     BS2                           : PA0
     RESET disposition             : dedicated
     RETRY pulse                   : SCK
     serial program mode           : yes
     parallel program mode         : yes
     Timeout                       : 200
     StabDelay                     : 100
     CmdexeDelay                   : 25
     SyncLoops                     : 32
     ByteDelay                     : 0
     PollIndex                     : 3
     PollValue                     : 0x53
     Memory Detail                 :

                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom        65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00
       flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

     Programmer Type : butterfly
     Description     : Atmel AppNote AVR109 Boot Loader

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

avrdude: devcode selected: 0x44
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% -0.00s

avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: reading input file "C:\Users\badacz\AppData\Local\Temp\arduino-sketch-675DDCF20EECA37F63C3329255887445/sketch_mar1a.ino.hex"
avrdude: writing flash (3970 bytes):

Writing | ################################################## | 100% 0.32s

avrdude: 3970 bytes of flash written

avrdude done. Thank you.

(I just copied and pasted)

That shows the upload was good.

it looks like a successful upload. the bootloader can use a different com port

Thank you everyone, it turns out it was my fault all along... Thanks again!

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