I am programming a custom board that is essentially an Arduino Uno Rev3 with new Atmega 16U2 and 328P parts. Using the ICSP and avrdude, I can load the 16u2 with (12KB) but when I try to load it with (21KB) I get verification errors at random locations above 0x3000.
Using DFU and FLIP, I see a similar problem. FLIP tells me that the 21KB file address is out of range. Others have reported the same problem, but I have not seen a solution on line.
It would be nice to know what I am doing wrong, but I also wonder if there is a downside to using the 12 KB file? It does not provide DFU, but why would I ever want that if I can use serial communications from the Arduino IDE?
If you are using FLIP, that means you are using the DFU bootloader to upload a program. So, go ahead and use the Arduino-usbserial-atmega16u2-Uno-Rev3 file. The COMBINED file is the Arduino-usbserial-atmega16u2-Uno-Rev3 program plus the DFU bootloader combined into one file. You can't use FLIP to overwrite the DFU bootloader. In order to overwrite the DFU bootloader with another copy of the same DFU bootloader, you would have to use an ICSP programmer and avrdude, instead of using USB and FLIP.
So if I load Arduino-usbserial-atmega16u2-Uno-Rev3 using FLIP, I will still have the original DFU available?
Yes. When you upload to the ATmega16u2 via the bootloader, it loads the program and the bootloader remains there waiting for the next (perhaps different) program that you want to upload. In the case of that DFU bootloader, it runs when you briefly touch the reset pin of the ATmega16u2 to ground.