After I connected the two boards using the wires, where do I enter the following commands to backup the Amega32u2 and flash a new firmware? I opened a command prompt on Windows 11 but it does not recognize what avrdude is.
You can determine the path to the installation of the AVRDUDE tool on your computer that is used by Arduino IDE by performing an upload in Arduino IDE and then examining the command Arduino IDE generated. I'll provide instructions you can follow to do that:
Plug the USB cable of the Arduino board you are using as an "Arduino as ISP" programmer into your computer.
Select File > New Sketch from the Arduino IDE menus.
Select Tools > Board > Arduino AVR Boards > Arduino Uno from the Arduino IDE menus.
Select your board's port from the Tools > Port menu.
Disconnect the USB cable of the Arduino board from your computer. β This will cause the upload to fail, but that is OK because we only want Arduino IDE to generate an upload command for us, and don't actually need (or want) the sketch to be uploaded.
Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open.
Check the box next to "Show verbose output during: β upload" in the "Preferences" dialog.
Click the "OK" button.
The "Preferences" dialog will close.
Select Sketch > Upload from the Arduino IDE menus.
Wait for the upload to fail.
Scroll up the black "Output" panel at the bottom of the Arduino IDE window until you see the avrdude command that was generated for the upload.
Possibly its an older version of` avrdude that did not have support for that MCU yet. What version of the IDE do you have installed?
Sadly avrdude does not seem to have a flag to show its version number to confirm and no longer seems to list part numbers it supports like it once did, but you could try just typing:
avrdude -c avrisp
(i.e. omitting the -p flag) and see whether the version you have outputs one.
In any case you can download a recent version of avrdude from here.
I also went to the link you provided to download the latest version of the software. I extracted it to windowsβ desktop. I see there is an arvdude.exe but trying to right-click to run it even as an administrator showed nothing. So what shall I do next?
I went to that directory from Command Prompt and then executed:
Its a command line program, so does not open a GUI. It needs to be run from a command prompt or powershell.
Sounds like something already has the port open. Make sure Serial Monitor is closed within the IDE, or even better shut down the IDE completely. Failing that, unplug the UNO, wait a few seconds and plug it in again, then try avrdude again.
BTW, if you prefer a GUI, then try avrdudess which is a GUI wrapper for avrdude.
C:\Users\user1\Desktop\avrdude-v8.1-windows-x64>avrdude -p m32u2 -F -P COM9 -b 19200 -c avrisp -U flash:w:DFU-hoodserial-combined-PrusaMK3-32u2.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m
OS error: file DFU-hoodserial-combined-PrusaMK3-32u2.hex is not readable: No such file or directory
Avrdude done. Thank you.
So after I set the high fuse bits, I tried to fetch and flash the firmware. Then, it reported that the .hex is not readable. Maybe I need to install wget to continue?
Sounds like the first avrdud step worked. The wget program is a download tool that is common on Linux or Unix systems. There is a Windows version, but you can just download the file from their firmware Github using your browser. Then retry the second avrdude step which seems to have failed because the file did not get downloaded in the previous one.
Processing -U flash:w:DFU-hoodserial-combined-PrusaMK3-32u2.hex:i
Reading 7418 bytes for flash from input file DFU-hoodserial-combined-PrusaMK3-32u2.hex
Writing 7418 bytes to flash
Writing | ################################################## | 100% 8.60 s
Reading | ################################################## | 100% 4.67 s
7418 bytes of flash verified
Processing -U lfuse:w:0xFF:m
Reading 1 byte for lfuse from input file 0xFF
Writing 1 byte (0xFF) to lfuse, 1 byte written, 1 verified
Processing -U hfuse:w:0xD9:m
Reading 1 byte for hfuse from input file 0xD9
Writing 1 byte (0xD9) to hfuse, 1 byte written, 1 verified
Processing -U efuse:w:0xF4:m
Reading 1 byte for efuse from input file 0xF4
Writing 1 byte (0xF4) to efuse, 1 byte written, 1 verified
Avrdude done. Thank you.
I connected the prusa machine to Pi and:
[ 10.651634] Bluetooth: RFCOMM socket layer initialized
[ 10.651645] Bluetooth: RFCOMM ver 1.11
[ 3500.459409] usb 3-2: USB disconnect, device number 2
[31848.788635] usb 3-2: new full-speed USB device number 3 using xhci-hcd
[31848.981851] usb 3-2: New USB device found, idVendor=2c99, idProduct=0002, bcdDevice= 1.00
[31848.981861] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[31848.981864] usb 3-2: Product: Original Prusa i3 MK3
[31848.981866] usb 3-2: Manufacturer: Prusa Research (prusa3d.com)
[31848.981869] usb 3-2: SerialNumber:
[31849.232938] cdc_acm 3-2:1.0: ttyACM1: USB ACM device
Is it the end or I have to continue with "Building the DFU Bootloader and Hoodserial for the MK3 Einsy"?
Seems to me that they provide the ready made file that you downloaded from their site and have now successfully uploaded to your 32u2.
I think the Building the DFU Bootloader and Hoodserial for the MK3 Einsy section is optional information should someone for any reason need to build the .hex file from the sourcefiles. I don't think its a necessary step.
I think you now have the firmware programmed on to your 32u4 chip so can probably proceed to testing it with the 3D printer.