What is the secret programing "with_bootloader" hex file over ICSP

Hello

I am trying to use an USBasp programmer to upload a sketch of my ATmega32U4 board.

I have used the Arduino IDE "Export compiled binary" option which generates two hex files:

rgb_leds.ino.leonardo.hex

rgb_leds.ino.with_bootloader.leonardo.hex

I am able to successfully program the board using:

avrdude -Cavrdude.conf -v -patmega32u4 -cusbasp -Pusb -Uflash:w:rgb_leds.ino.leonardo.hex:i (leds flash)

but

avrdude -Cavrdude.conf -v -patmega32u4 -cusbasp -Pusb -Uflash:w:rgb_leds.ino.with_bootloader.leonardo.hex:i

verifies okay but the sketch does not run (the leds do not flash)

As far as I can tell, there is no way to program the "with_bootloader" version using the IDE directly.

What is the secret sauce that I'm missing?

Thanks

Upload normally through bootloader, dump the contents via avrdude.

Compare to the with_bootloader hex of same sketch

That might give some hint

Thank you for the suggestion. I took a quick look but ended up using a work around instead:

  1. Burned the bootloader via the ICSP using a USBasp programmer
  2. Uploaded the sketch via the USB serial port
  3. Dumped the flash to a flash.hex file using avrdude, via the USB serial port (dumping the flash to a hex file using the USBasp did not work but for some reason dumping to a raw bin file seemed to)
  4. Used the avrdude and the flash.hex file to program other boards via the ICSP using a USBasp programmer

This solved my problem but does not answer my initial question.

If others have been able to successfully use an exported binary with_bootloader, I would be interested to hear about it. My impression is that it is not an actively used feature that has a bug in its implementation.

Thanks Again