I'm interested in how to program (via UART) a atmega8 and/or atmega328 that has the arduino boot-loader installed.
Let's say that my code jumps to the boot-loader section when it receives a specific uart command or the fuses are programmed so that on reset the boot-loader section runs first.
Is there a way to send a hex file over to the UART Rx (at slow baud rate) and for the arduino boot-loader to write the code to the application section of the flash memory?
As an example: 1. PowerOn 2. Bootloader loads/runs and waits (a second or two) for a specific UART byte that tells it to program the next bytes (the hex file) into the application section of memory. 3. Hex file is sent via UART (at slow baud rate) 4. Specific UART byte tells the boot-loader that it's the end of the hex file. 5. Atmega resets
I've looked at the Atmega8 bootloader here https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/bootloaders/atmega8/ATmegaBOOT.c but it's a bit too complicated for me.
Thanks for any input!