Feasibility check: programming Arduino MEGA 2560 with Arduino Uno, NO PC

I did some more tests, combining sketch hex and bootloader hex. It uploaded the combined hex fine but the program insisted that there is no bootloader and set the High fuse to run code from 0000. Stubborn program won't allow me to change high fuse from D9 (run from 0000) to D8 (run from 256K-8K), saying that I was going to disable SPIEN, no way. D enables it. No go.

I need the bootloader when I'm flashing manually with XLoader or arduino IDE.

I had to only flash the bootloader, no sketch and the program decided an HFuse=D8 by itself, good. I may have to think of other ways. Chopping this program may take too long. All its text interface is useless to me. I'm trying to programmatically flash firmware without human interaction. I'll see how this goes. I want the end result to be a function call flash_firmware(char * file_name). No need to mess with lock bits or fuse bits. The function recognizes which chip it is and flashes the firmware and then the right bootloader.

BTW, all my experience with x86 assembly from 1990's was not wasted. I was able to understand the intel HEX format and its CS:IP and 16 bit shift and addressing with a particular record type called start segment address, on wiki. Without all that background, I would have to spend a bit more time :slight_smile: