AngryCockroach wrote: 28 Dec 2024, 18:22
Oh, thank you very much and sorry for not replying earlier.
Before I test it: Is there a way to do a backup of my controller in case it does not work anymore after the flash?
Well, typically when you buy a Pro Micro, it arrives blank (other than the bootloader). So I'm a little confused about this question, since you would have had to flash whatever firmware is running on it right now yourself after receiving it, which would imply you have a copy of whatever firmware it has already stashed away somewhere. (Unless you bought a completely assembled controller from somebody who flashed it with some firmware for you before shipping it to you?)
But if you unzip the file I linked to with the Vial firmware, and change into the "flash-util" directory (where the "avrdude" program is located) at a command line, you can run the following command to dump whatever firmware is currently stored in flash memory to a file called "firmware-backup.hex":
Code: Select all
avrdude.exe -p atmega32u4 -c avr109 -P usb:2341:0037 -n -U flash:r:firmware-backup.hex:i
You can also run the following command to make a backup of the EEPROM, which typically contains at least some amount of configuration state, to a file called "config-backup.hex":
Code: Select all
avrdude.exe -p atmega32u4 -c avr109 -P usb:2341:0037 -n -U eeprom:r:config-backup.hex:i
You can of course rename these files to whatever you want; these are just examples.
Before these commands will work, the Pro Micro has to be put into bootloader mode. This is usually accomplished by shorting the "RST" and "GND" pins together for a second or so, then removing the short. (Whatever firmware you are already running might also provide some method for kicking over to bootloader mode in software and/or with some key combo, but since I have no idea what you are running, I couldn't tell you what that would be.) Once the controller is in bootloader mode, you only have 10 seconds to run those commands before the controller re-boots the existing firmware! So if you want to dump both flash and EEPROM, it's easiest to do it twice, and run only one of the dump commands each time.
If you are absolutely certain that the controller is going into bootloader mode but you can't manage to get the commands to work, and instead you see a message to the effect of "avrdude warning: -P usb:2341:0037 is not connected", it could be that your particular Pro Micro's bootloader uses a different USB VID+PID combo to identify itself to the host. Besides VID 2341 / PID 0037, the other common one that I'm aware of is 1B4F / 9205. So try replacing the block of text after the "-U" part of the command with "usb:1B4F:9205" and see if that works for you instead.