I am trying to use an Atmel ICE programmer and the Arduino IDE (version 1.8.13) to flash a bootloader onto a board via the ICSP header. The board is a Prusa 3d printer MMU board which has an ATmega32U chip on it and instructions from Prusa are to add their board definitions into the Arduino IDE, connect the programmer, and use the Tools->Burn bootloader command. However, they assume that the programmer is a usbasp, USBtiny, or an Arduino as ISP. I happen to own an Atmel-ICE.
I believe the hardware connections are all correct, I'm getting the correct LEDs from the ICE (left is green, showing target power is ok, middle is red, showing programmer power is ok, right is off, since the chip isn't running).
In the tools menu of the IDE, I have selected the correct board, under Programmer I have "Atmel-ICE (AVR)", and nothing in the Ports section, as it appears that this programmer doesn't create a serial port to attach to (in Windows device manager it appears under "Microchip Tools" as "Atmel-ICE Data Gateway", but not as a COM port).
However, the flashing itself fails. The error message is very long, so rather than posting it here in full I put it into a pastebin: Arduino: 1.8.13 (Windows 10), Board: "Original Prusa i3 MK3 Multi Material 2.0 u - Pastebin.com
From the looks of it, it seems that it is trying to program in JTAG mode, which is not supported by this board, it has to be done in ICSP mode. I don't see how the programmer mode can be selected in the Arduino IDE. I tried selecting other programmers, like the "Atmel JTAGICE3 (ISP mode)" but those fail in other ways - generally with just a "device not found"-type error. I know that I can change the mode between ICSP and JTAG in Atmel Studio, but I haven't found a way to do it in Arduino IDE.
Any advice would be appreciated,
Juliean.