Can not upload program to Arduino Pro Micro 16MHz

Hello I have problem with uploading program to Arduino Pro Micro.

When I hit upload it ends with error, I have problem with uploading in Arduino IDE too (Tryied to instal SparkFun board and select the Pro Micro 16MHz).

My platformio.ini is now like this:
[env:32u416m]
platform = atmelavr
board = 32u416m
framework = arduino
board_build.usb_product = “32u416m”
monitor_speed = 115200
lib_deps =
adafruit/Adafruit GFX Library@^1.10.13
paulstoffregen/Encoder@^1.4.1
adafruit/Adafruit BusIO@^1.11.2
thomasfredericks/Bounce2@^2.71

When I downloaded the program in board was “leonardo” but the program should be for Pro Micro. I tried also change board to “micro”. Always same result.

I am new to Platformio so maybe I did something wrong.

Thank you very much for your help.

When I am uploding it from VS Code I recieve this error:

Processing 32u416m (platform: atmelavr; board: 32u416m; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/32u416m.html
PLATFORM: Atmel AVR (5.1.0) > Microduino Core USB (ATmega32U4@16M,5V)
HARDWARE: ATMEGA32U4 16MHz, 2.50KB RAM, 28KB Flash
DEBUG: Current (simavr) External (simavr)
PACKAGES:
 - framework-arduino-avr @ 5.2.0
 - tool-avrdude @ 1.60300.200527 (6.3.0)
 - toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 15 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Adafruit GFX Library @ 1.12.0
|-- Encoder @ 1.4.4
|-- Adafruit BusIO @ 1.17.0
|-- Bounce2 @ 2.72.0
|-- Adafruit NeoPixel @ 1.10.4
|-- EEPROM @ 2.0
|-- Keyboard @ 1.0.3
|-- Mouse @ 1.0.1
|-- SPI @ 1.0
|-- Wire @ 1.0
|-- Adafruit SH110X @ 2.1.5
Building in release mode
Checking size .pio\build\32u416m\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [====      ]  39.5% (used 1012 bytes from 2560 bytes)
Flash: [========= ]  88.4% (used 25352 bytes from 28672 bytes)
Configuring upload protocol...
AVAILABLE: avr109
CURRENT: upload_protocol = avr109
Looking for upload port...
Using manually specified: COM11
Forcing reset using 1200bps open/close on port COM11
Waiting for the new upload port...
Uploading .pio\build\32u416m\firmware.hex

Connecting to programmer: .avrdude: butterfly_recv(): programmer is not responding

avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = "F"; type = @
    Software Version = \xc6.u; Hardware Version = \x93.\xf0
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader

avrdude done.  Thank you.

*** [upload] Error 1
========================================================================================= [FAILED] Took 138.71 seconds =========================================================================================

Before uploading, try to get the board into bootloader mode first. You then have 8 seconds to upload.

This is described in https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/troubleshooting-and-faq#ts-reset. You have to touch the RST pin to GND two times to enter bootloader mode. Best to solder a cable a button, but it can also be achieved by just using cable carefully.

I did that and the result is the error i recieved as mentined before.

In the page you send there is that board is “modified version of the [Arduino Leonardo]”
So that mean that in my platformio.ini in board I should have leonardo? That I leaved there and the result was the same.

If I do not push the RST button then i get this error:

Processing 32u416m (platform: atmelavr; board: 32u416m; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/32u416m.html
PLATFORM: Atmel AVR (5.1.0) > Microduino Core USB (ATmega32U4@16M,5V)
HARDWARE: ATMEGA32U4 16MHz, 2.50KB RAM, 28KB Flash
DEBUG: Current (simavr) External (simavr)
PACKAGES:
 - framework-arduino-avr @ 5.2.0
 - tool-avrdude @ 1.60300.200527 (6.3.0) 
 - toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 15 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Adafruit GFX Library @ 1.12.0
|-- Encoder @ 1.4.4
|-- Adafruit BusIO @ 1.17.0
|-- Bounce2 @ 2.72.0
|-- Adafruit NeoPixel @ 1.10.4
|-- EEPROM @ 2.0
|-- Keyboard @ 1.0.3
|-- Mouse @ 1.0.1
|-- SPI @ 1.0
|-- Wire @ 1.0
|-- Adafruit SH110X @ 2.1.5
Building in release mode
Checking size .pio\build\32u416m\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [====      ]  39.5% (used 1012 bytes from 2560 bytes)
Flash: [========= ]  88.4% (used 25352 bytes from 28672 bytes)
Configuring upload protocol...
AVAILABLE: avr109
CURRENT: upload_protocol = avr109
Looking for upload port...
Using manually specified: COM11
Forcing reset using 1200bps open/close on port COM11
Waiting for the new upload port...
Error: Couldn't find a board on the selected port. Check that you have the correct port selected. If it is correct, try pressing the board's reset button after initiating the upload.
*** [upload] Explicit exit, status 1
========================================================================================== [FAILED] Took 6.65 seconds ==========================================================================================

I can see that the board is really the leonardo, but shouldn’t the be “Arduino Micro”?

Can you additionally set

board_upload.use_1200bps_touch = false
board_upload.wait_for_upload_port = false

In the platformio.ini, then press the “Build” button again, then do the reboot into bootloader sequence (RST double-tapped to GND), and then press the upload button. With an only 8 second window, this migiht be a bit tricky. But with that, it should not try to do the “reset to bootloader”, it should use the COM port as-is.

I looked in to the device manager and if I push RST button two times it is not seen on any com port (my 11) and is in “other devices” with exclamation mark. After arround 8 seconds it is then back connected in COM 11.

I did try that and the result is this error:

Processing 32u416m (platform: atmelavr; board: 32u416m; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/32u416m.html
PLATFORM: Atmel AVR (5.1.0) > Microduino Core USB (ATmega32U4@16M,5V)
HARDWARE: ATMEGA32U4 16MHz, 2.50KB RAM, 28KB Flash
DEBUG: Current (simavr) External (simavr)
PACKAGES:
 - framework-arduino-avr @ 5.2.0
 - tool-avrdude @ 1.60300.200527 (6.3.0)
 - toolchain-atmelavr @ 1.70300.191015 (7.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 15 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Adafruit GFX Library @ 1.12.0
|-- Encoder @ 1.4.4
|-- Adafruit BusIO @ 1.17.0
|-- Bounce2 @ 2.72.0
|-- Adafruit NeoPixel @ 1.10.4
|-- EEPROM @ 2.0
|-- Keyboard @ 1.0.3
|-- Mouse @ 1.0.1
|-- SPI @ 1.0
|-- Wire @ 1.0
|-- Adafruit SH110X @ 2.1.5
Building in release mode
Checking size .pio\build\32u416m\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [====      ]  39.5% (used 1012 bytes from 2560 bytes)
Flash: [========= ]  88.4% (used 25352 bytes from 28672 bytes)
Configuring upload protocol...
AVAILABLE: avr109
CURRENT: upload_protocol = avr109
Looking for upload port...
Using manually specified: COM11
Uploading .pio\build\32u416m\firmware.hex
avrdude: ser_open(): can't open device "\\.\COM11": Syst\xe9m nem\xf9\x9ee nal\xe9zt uveden\xfd soubor.



avrdude done.  Thank you.

*** [upload] Error 1
========================================================================================== [FAILED] Took 0.98 seconds ==========================================================================================

Then you don’t have the Atmel FLIP program installed which has the driver for the DFU bootloader device: https://www.microchip.com/en-us/development-tool/flip (“FLIP 3.4.x for Windows (Java Runtime Environment included)”), plus how to install the driver. You could maybe try to burn the bootloader again for the Pro Micro 16:

https://github.com/sparkfun/Arduino_Boards/blob/main/sparkfun/avr/bootloaders/caterina/Caterina-promicro16.hex

On the other hand, did you try treating it as just an Arduino Leonardo in the Arduino IDE and try to upload normally?

I did install the “Flip 3.4.x for Windows (Java Runtime Enviroment included)” and then tryied to instal the driver but that did NOT instal the driver. But after restart and two times push RST I saw it disappear from COM11 but reappear on COM port 13 called bootloader. After that i did try upload the code to the device and it did work.
Thank you very much.