I'm working on a Android App able to update the content of my Arduinos. Start to work (reset the Arduino, communicate with STK500 protocol, get id of ATmega and so on). But I face a question about the two hex files produced by the compiler. Some FAQ, forum... give replies about the two, explaining: "the ino.hex file has only the code and the other as the code + the code of the bootloader". After having a look at the hex files, that's true: you can find in the "with_bootloader" the code of the bootloader.
The "why" gives the following answer: "that's because when the bootloader receive the code, it erases the flash so the installed bootloader destroy itself. So if you send without bootloader, you will not have a bootloader any more in the Arduino".
Problems:
1) In that case, in order to change the bootloader why use an ISP? Just add the HEX code of your new bootloader in the main HEX file, send it with AVRDUDE and that's all...
2) When you use the Arduino IDE with AVRDUDE in Verbose mode you'll see AVRDUDE send the file....
without the bootloader!
So the question is: when you want to update the content of the flash, sending "manually" the data using STK500 protocol, do you need to send the "ino.hex" or the "ino.with_bootloader.hex" file? And why?