Arduino pro micro either freezes or disconnects during upload

Hello I am fairly new to this hobby and I just bought some Arduino pro micros to make a keyboard but they aren't working. I'm running a BareMinimum program after my keyboard code failed but it freezes on uploading after the upload bar has finished. I've tried resetting it using the RST and GND pins before, during, and after upload but when I reset it and uploaded the code it says problem uploading to board and when i scrolled up it wrote:
"avrdude: ser_open(): can't open device "\.\COM5": Access is denied."
But this disappears and returns to freezing when I change the COM in device manager. This is what it writes when it freezes:

processing.app.debug.RunnerException
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:152)
	at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
	at processing.app.SketchController.upload(SketchController.java:732)
	at processing.app.SketchController.exportApplet(SketchController.java:703)
	at processing.app.Editor$UploadHandler.run(Editor.java:2061)
	at java.lang.Thread.run(Thread.java:748)
Caused by: processing.app.SerialException: Error touching serial port 'COM5'.
	at processing.app.Serial.touchForCDCReset(Serial.java:107)
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:136)
	... 5 more
Caused by: jssc.SerialPortException: Port name - COM5; Method name - openPort(); Exception type - Port not found.
	at jssc.SerialPort.openPort(SerialPort.java:167)
	at processing.app.Serial.touchForCDCReset(Serial.java:101)
	... 6 more

If someone knows a fix that would be very helpful!

It is normal that boards with native USB (like your ProMicro, disconnect during upload.

Which version of the IDE?

Is COM5 indeed your ProMicro? Does it disappear of you disconnect the ProMicro?

That's what you have to solve :wink: And it's a Windows problem that I'm not sure if I know a solution for. One thing might be that Bluetootsh that interferes; switch it off. Another one might be antivirus; try to temporariy (!!) disable your virus scanner if you are running one.

Some options to work around COM5:

  1. If you have a COM1 in Windows, select that. Do an upload and when the IDE reports the memory usage double tap the reset (in your case, short the reset pin to GND twice in quick succession).
  2. If you have an Uno, Nano, Mega, connect it and select its port (keep the target as ProMicro or whatever you were using); keep the Uno/Mega/further as above

Im using IDE 1.8.19 and COM5 is my arduino. Would it help if I changed to 2.0 or an earlier version?

I checked for Bluetooth and antivirus and I dont have bluetooth and I disabled the antivirus but it still gave me the same error message.
I tried with antivirus disabled and changing the Arduino to COM1 but it froze on upload and when I reset it and tried to run the code again, the Arduino changed to COM5 and then returned to COM1.
I tried connecting my uno to my pc and running the code to the ProMicro and using the programmer "Arduino as ISP" and it failed too.
Is there a way to bypass the denied access on he ProMicro by uploading the code to the Uno and then uploading the code from the Uno to the ProMicro.

Good news, I solved it!
I just uploaded the code with a mac and it did the trick.
Thanks for helping!

1 Like

Did you do that in device manager or did you simply select COM1 in the IDE?

That is basically expected behaviour. The change to COM5 is the result of the software reset which activates the bootloader on the chip; once upload is finished (with or without success), the board will fall back to 'normal' which in this case was COM1.

If COM5 was the 'normal' port, COM5 should not have been the port when the bootloader was running.

Does anyone have any suggestions for this problem? I burned the bootloader using an Arduino UNO as ISP but continue to have the port disconnect and connect in the middle of uploading. The code says it uploads successfully but never actually works on the board since it doesn't make it there. The error message I receive is this:

Sketch uses 3460 bytes (12%) 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.
Forcing reset using 1200bps open/close on port COM7
PORTS {COM4, COM7, } / {COM4, } => {}
PORTS {COM4, } / {COM4, } => {}
PORTS {COM4, } / {COM4, COM8, } => {COM8, }
Found upload port: COM8
C:\Users\carlo\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\carlo\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega32u4 -cavr109 -PCOM8 -b57600 -D -Uflash:w:C:\Users\carlo\AppData\Local\Temp\arduino_build_754443/sketch_jul26a.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\carlo\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : COM8
     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\carlo\AppData\Local\Temp\arduino_build_754443/sketch_jul26a.ino.hex"
avrdude: writing flash (3460 bytes):

Writing | ################################################## | 100% 0.28s

avrdude: 3460 bytes of flash written
avrdude: verifying flash memory against C:\Users\carlo\AppData\Local\Temp\arduino_build_754443/sketch_jul26a.ino.hex:
avrdude: load data flash data from input file C:\Users\carlo\AppData\Local\Temp\arduino_build_754443/sketch_jul26a.ino.hex:
avrdude: input file C:\Users\carlo\AppData\Local\Temp\arduino_build_754443/sketch_jul26a.ino.hex contains 3460 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.03s

avrdude: verifying ...
avrdude: 3460 bytes of flash verified

avrdude done. Thank you.

Anything would be a great help! Thanks.

Is that when you see

Forcing reset using 1200bps open/close on port COM7
PORTS {COM4, COM7, } / {COM4, } => {}
PORTS {COM4, } / {COM4, } => {}
PORTS {COM4, } / {COM4, COM8, } => {COM8, }
Found upload port: COM8

If so, that's expected behaviour.

That is what you think :wink: Does the same thing happen when you upload an innocent sketch like below? Note that it's ProMicro specific.

int RXLED = 17;  // The RX LED has a defined Arduino pin
void setup()
{
//  Serial.begin(57600);
//  while(!Serial);
//  Serial.println("ProMicro Blink (pin 17)");
  
  pinMode(RXLED, OUTPUT);  // Set RX LED as an output
}

void loop()
{
  digitalWrite(RXLED, LOW);     // set the RX LED ON
  delay(500);
  digitalWrite(RXLED, HIGH);    // set the RX LED OFF
  delay(500);
}

The above shouldflash the RX LED similar to the normal blink example. If you uncomment the three lines in setup(), it will only start blinkling after you open e.g. Serial Monitor.

This is a clear indication that the upload succeeded and the code made it to the board.

1 Like

It works!! Thank you so much sterretje!

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