Compiling sketch to 16U2

Hi, I want to use the 16U2 on the Arduino due, running a sketch developed by me. I know how to flash the 16U2 firmware from a .hex file. But how do I generate the .hex file for the 16U2? How do I compile a sketch for it?

Have a look at HoodLoader2: GitHub - NicoHood/HoodLoader2: 16u2 Bootloader to reprogram 16u2 + 328/2560 with Arduino IDE

The hoodloader2 is not compatible to the Arduino Due. At lease that's what the wiki pages says. Any other alternatives?

Hello,

Sorry, I misread something before.
Atmel Studio generate HEX Files which You can upload.

Regards,
Maverick