atmega2560 self programming by accessing external flash

hello everyone,
recently, i'm trying to do something, that seems like no one tried before (hope to be wrong).
i'm trying to build a new bootloader that check if a new version of software is available on an external flash and self-program it (after sending the new program to be programed as bytes, not .hex file, to the external flash within the current "running" software).
i've read the 109 file of self programing but hope that someone could make my life easier with a reference code to this method.
if someone ever did such thing or similar and can help me with:

  1. recommended external flash chip.
  2. example sketch that reads bytes from serial port and saves it into external flash (with CRC).
  3. example of a bootloader that checks a "flag" in the external flash and if it's "newer" saves the current version to the external flash and "burn" the new one to the internal flash (with a check that the programming went well and backup the "old" software if not.

i can't believe that no one ever tried something similar or some people that deed parts that can me integrated to comply this.

  • i'm using the Atmega2560

snir. :slight_smile:

You may be interested in this thread:,99837.0.html

thank you!
my first step is also uploading the sketch from a uSD, but this thread says almost nothing about my configuration of arduino mega 2560 and sparkfun micro-sd shield (only for the ethernet shield) also i could find anything about doing the same with external 500kb flash (chip not sd...) on a breadboard.

also the two friends in that thread that started doing something in that direction didn't reposted again in the past year... so it's not so updated... i've posted there also, so thank you again, i hope some here could help me with doing it with uSD in the above HW config and also with external flash.