Reprogramming Arduino from flash memory or sd card (for over the air firmware)

Ok so I can do this on an msp 430 but im not sure where to start with say a 328p

The idea is to have data flash memory or something to that effect on the project. then when sent sent a command (say over radio or gprs) it knows to start righting packets into data flash. (so far all easy stuff and the packets would contain the hex file needed to program the Arduino)

Then have a little boot load type program or function that can perhaps be copied from flash into ram and then read from the flash memory and start putting it into flash then enables the watchdog timer or something to that effect to reset the micro.

This would allow firmware updates over radio, blue tooth, xbee what not.

I have done this with MSP430's. wasn't too hard. however when looking at the actual bootload code and such the bits of code i need didnt just jump out at me. I may spend some hours in the data sheet. Im sure ill need to use the spi line to talk to data flash low level as in the data sheet and not a library but i have no problem with that.

any advice is greatly appreciated :slight_smile:

Have you looked at the Fio? It can do over the air transfers I believe.

Crossroads,

Good call, for most stuff that looks like a good solution. It looks like the DTR line from the xbee resets the micro and then it can load over uart with the original bootloader communicating over xbee to the ide.

I would kinda like to do a little more like what i was talking about if possible. Im sure atmel has some registers and so forth that i could use to write code into flash as long as i didn't write over my function i was using as a boot loader or if i could copy it to ram and call it from there. this was i can say update the firmware from sd cards, gsm, xbee, blue tooth just whatever i wanted to use for that specific project.

Also if i had a big enough data flash i could always read flash memory and have it back up its code to dump later. its more to see how easily it can be done for it would give lots of possibilities.

You need to read the datasheet some more:

The operation of Boot Program section and associated Boot Lock bits for
software protection are described in detail in ”Self-Programming the Flash, ATmega 48A/48PA” on page 261 and ”Boot Loader Support – Read-While-Write Self-Programming” on page 269. ”Memory Programming” on page 285 contains a detailed description on Flash Programming in SPI- or Parallel Programming mode.

There was also a topic recently on updating the bootloader to bring in a sketch from SD, see if you can find that.

rob40855:
Ok so I can do this on an msp 430 but im not sure where to start with say a 328p

The idea is to have data flash memory or something to that effect on the project. then when sent sent a command (say over radio or gprs) it knows to start righting packets into data flash. (so far all easy stuff and the packets would contain the hex file needed to program the Arduino)

Then have a little boot load type program or function that can perhaps be copied from flash into ram and then read from the flash memory and start putting it into flash then enables the watchdog timer or something to that effect to reset the micro.

This would allow firmware updates over radio, blue tooth, xbee what not.

I have done this with MSP430's. wasn't too hard. however when looking at the actual bootload code and such the bits of code i need didnt just jump out at me. I may spend some hours in the data sheet. Im sure ill need to use the spi line to talk to data flash low level as in the data sheet and not a library but i have no problem with that.

any advice is greatly appreciated :slight_smile:

I'm in the middle of modifying optiboot to support this function. Over in Microprocessors, Just started a new thread, and under "New, New Optiboot"

Chuck.

CrossRoads,

Your right thats my what i intend to do is to look through the data sheet if nothing else and im pretty sure iv seen the sd card discussion you mentioned.

Chuck,

I will gladly check out your thread thanks.

Hi all,

I was just wondering if anyone has considered using the XBee Flash for this OTA uploading scheme.

https://www.digi.com/resources/documentation/Digidocs/90002126/reference/r_about_gpm.htm?TocPath=Advanced%20application%20features|General%20Purpose%20Flash%20Memory|_____0

I couldn't help but wonder if obtiboot ( apparently is already the factory UNO bootloader? ) had an easy path for getting its arduino upload from XBee's Flash memory.

tgit23:
I was just wondering if anyone has considered using the XBee Flash for this OTA uploading scheme.

My mistake - Somehow "XBee 868LP RF Modules provide" skipped my attention on reading that the first time. Of which isn't the basic XBee S3B Module I was associating it to.