Go Down

Topic: How to design a PCB that allows firmware updates. (Read 4 times) previous topic - next topic

pnewmancalgary

We have a small project to collect water well data in the field, basically a PCB with an ATmega2560, SD card and a bunch of sensors.  The current version works well, but over the past few months, we had to change the firmware a few times.  Bit of an issue, take laptop to field, connect and reload.  Can be done but.

I would like to put a new file on the SD card and have the PCB load the new firmware and run.

My thoughts are to add another microcontroller to a new board that runs after reset and checks for a new version for the ATmega and loads as required.  Similar (I think to the way the Uno and Mega boards currently work)

The problem I'm having is I'm new to this embedded electronics thing and have been have troubles locating any info.

Could someone point me in the right direction and any other help would be greatly

Thanks

CrossRoads

This question is asked now & again. The bootloader as currently written checks to see if anyone is sending sketch-load commands after a reset, and starts the sketch load process if there is, otherwise the loaded sketch starts.

What would need to be done for Option 1 is to write a bootloader that checked for a sketch file on the SD card, if one existed then load that sketch up. If no sketch file found, check if anyone is sending sketch-load commands, and if neither, the loaded sketch runs.

For Option 2, the current bootloader just runs normally, not really caring who is providing the data.

I am pretty sure Option 2 has been done before, I recall reading about an art installation or similar where someone had a sketch that loaded new sketches into installed Arduino's.
In fact, that sounds a lot like what Optiloader does:
http://arduino.cc/forum/index.php/topic,68183.0.html

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.


Chagrin


Option 1 maybe?
http://baldwisdom.com/bootdrive/


That's option 2. Option 1 would be hacking the bootloader, which normally only looks at the UART to see if a new program is being uploaded, to check a digital pin or such for a flag that says it should start reading from a flash chip at a predefined location.

It would be kinda neat and magical but would make the bootloader larger. I nominate Crossroads to begin work immediately.

CrossRoads

Nah, you need a real programmer for this. Someone that has made bootloaders before.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Go Up