Pro Micro connection issues

Hi

A friend popped by with two Pro Micro boards he was not able to program.

I notice when I hook them up, that they show up in the device manager as unknown USB Devices.
If I reset the board, it will show up "correctly" in the device manager (in the ports section, on COM6), but only for a few seconds, and then go back to being an unknown USB device.
At one occation even the IDE caught the board while it was connected ok for a few seconds, but lost it again as soon as it went to be being an unknown device.

I am running win10 on a 64 bit machine.. There seems to be some issues installing the drivers, but I managed to update the driver when it showed up correctly for a few seconds. But still the same issue.

Any idea how to get these Pro Micro boards working?

Due to the USB stack running on the same ATmega32U4 microcontroller as your sketch on the Pro Micro, it is possible for code in your sketch to break the USB functionality, which can lead to the sort of error you report.

Fortunately, the program that handles uploads (bootloader) is stored in a separate section of memory and can not be broken by the sketch code.

The only tricky thing is that the bootloader has to be activated at just the right time during the upload. Normally this is done by some special code that runs in the background of your sketch code recognizing a 1200 baud connection as the signal to reset the microcontroller and start the bootloader. However, in your current situation, that system won't work so you'll need to manually reset the board to activate the bootloader.

You need to get the timing right. If you do the reset too early, the bootloader will have already timed out by the time the upload starts. The tricky thing is that when you press the "Upload" button in the Arduino IDE, it first compiles your sketch before starting the actual upload. So you need to wait until after the compilation finishes before resetting the board.

Try this:

  1. Prepare some way to reset your Pro Micro by momentarily connecting the RST pin to the GND pin. This could be done with a wire or even some metal tweezers.
  2. Select Sketch > Upload from the Arduino IDE's menus.
  3. Watch the black console window at the bottom of the Arduino IDE window until you see something like this:
    Sketch uses 444 bytes (1%) of program storage space. Maximum is 30720 bytes.
    Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. 
    Maximum is 2048 bytes.
    
  4. Immediately reset the Arduino board.

After that, the sketch should upload successfully. If the problem persists after a successful upload, you know there is something in your sketch that is breaking the USB functionality. You can verify this by uploading the File > New sketch, after which the board should be recognized by your computer and you should be able to upload normally. If the problem is in your sketch, you will need to find out what it is in your sketch breaking the USB code. Now that you know how to recover your board, that should be manageable.

1 Like

Adding to @in0's reply

You need to have a valid COM port selected.

  1. If your system has a COM1, use that.
  2. If your system does not have COM1, you can hook up another board that does not have native USB (e.g. Nano, Mega, Uno) and select its port. Keep that board connected. [edit]Only select the port, keep the ProMicro as the target.[/edit]

ProMicros usually need a double reset to invoke the bootloader; if you used a wire to reset the board, you might have done that unintentionally (bounce) and that is why it worked. So for step 4 above, use a double reset; if you have wired a button, just tap it twice in quick succession.

If a single reset worked, the ProMicro does not have its original SparkFun bootloader but might have e.g. the Leonardo bootloader; not really a problem.

2 Likes

Sorry but that doesn't work.

The board is only visible to the PC, and arduino IDE for a few seconds after reset, and that is not enough to first set the IDE to the correct port and then start compilation and upload. The IDE doesn't even find the board in the short time it is available. I think I saw that only once and then it lost it again right away.

Not even the device manager catches the board more than every now and then.

This does not seem to be a bootloader problem but rather a USB problem. The board is not recognised for more than a few seconds after reset. Windows is saying something about failed migration, which seems to be related to drivers.

You mean I should have both the pro micro and and uno connected at the same time on two different USB connectors? How would that get the code into the promicro if I select the uno?

Thanks for the double reset info, didn't know that. Use tweezers for reset so must have done double "by mistake" a few times. Explains why it worked only occasionally.

Yes

You don't select the Uno as the board; you select the Uno's port (I will edit my post to make it clearer). The reset mechanisms for boards with native USB (e.g. the ProMicro) and those with a TTL-to-USB converter (e.g. Uno) differ. The Uno will react on activation of the DTR signal and the ProMicro will react on the software reset invoked by opening and closing the serial port at 1200 baud.

THE IDE looks or the bootloader and when you double reset the ProMicro, the ProMicro's bootloader is invoked. If you enable verbose output during upload under file -> preferences, you will see something like the below if you have a valid COM port.

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 COM23

You can see that a reset is forced. That is followed by the below where the IDE tries to find a bootloader after the reset attempt.

PORTS {COM1, COM5, COM23, } / {COM1, COM5, } => {}
PORTS {COM1, COM5, } / {COM1, COM5, } => {}
PORTS {COM1, COM5, } / {COM1, COM5, } => {}
PORTS {COM1, COM5, } / {COM1, COM5, } => {}
PORTS {COM1, COM5, } / {COM1, COM5, } => {}
PORTS {COM1, COM5, } / {COM1, COM5, COM24, } => {COM24, }
Found upload port: COM24

COM23 is the ProMicro (normal use), COM24 is the ProMicro's bootloader. In the first line COM23 is still visible, in the next lines it has disappeared due to the reset. Eventually it notices COM24 ({COM1, COM5, COM24, }) and finds the bootloader ( => {COM24, }).

If I would have selected COM5 (a SparkFun RedBoard), the proMicro will not react on the reset but double tapping the reset on the ProMicro will invoke the ProMicro's bootloader and you will get COM24.

ABSOLUTELY FABULOUS!

It worked!

Thank you very much!

Next question

Will this procedure be needed everytime, or will it work "directly" now once it is loaded?
I guess I will find out.

Thanks!

EDIT: Second upload just required a double reset, the com port was readily available in the IDE.

Thanks again :slight_smile:

It should not even require that. Try doing an upload without any manual reset.

Please enable the verbose output during upload in file -> preferences in the IDE and post the part of the output that I also showed you. You can select using the mouse or keyboard in the output window, copy and next paste here. Also indicate what Windows device manager shows (see screenshots below).

The double reset should not be needed every time. As @in0 pointed out, your sketch can break the USB functionality that is part of the uploaded code; this is a bug in YOUR sketch. Try to load the blank example (not blink) a few times in succession.

Select the correct port (the one that shows in device manager while your sketch is running).
image

Not this one (!!)
image

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