Hello guys, I have been researching an idea lately. Here is the basis behind my idea.
On the Arduino 2560 there is the ATmega 2560 and the ATmega16u2.
The 2560 needs a custom boot loader to accept I2C communication from a I2C master to download and flash program code.
The 16u2 needs to be able to flash this custom boot loader into the 2560, however once I install my custom I2C based boot loader into the 2560, the 16u2 will be unable to communicate to the 2560 over USB anymore, so effectively if my I2C program has any bugs, the board is soft-bricked (ICSP will still work of course).
My idea is to use the ICSP headers for programming the 2560. I will reprogram the 16u2 to reflash the 2560 over ICSP. Connect the ICSP headers together and use the 16u2 to provide the signals to the 2560 for in-circuit programming. I have seen tutorials for using a second Arduino as an ICSP, but I want to use the onboard 16u2 as the second 'Arduino', has anybody ever seen or though about this idea?
Using DFU programming on the 16u2 seems like a possible way to upload my new firmware to the 16u2, but I'm not entirely sure.
Thanks for the help guys!