If anyone is interested, I've written a bootloader which, besides interfacing normally with the IDE, also loads code from an SD Card. So now you can update code without being connected to the IDE.
It checks a pin on reset, and if it's low, then the bootloader pulls a hex file from the SD card and programs the flash.
I am interested too.
How much flash memory is left for the actual application (sketch)?
Can you choose what to load or it loads a default hex file?
Thanks.
The bootloader takes up less than 4K total. This means that you'll have 28K at your disposal (on the '328). I'm actually using the bootloader on one of our AVR boards - with an ATmega644P - which means I have 60K left for goodies.
Right now, you can only load a hex file named "sketch.hex". The file is in native hex format which is parsed inside the bootloader - so no fiddly changes - just copy onto the card and go.
Tw34kd: I needed to load code on a remote installation (maybe that's obvious). Specifically, they are for POP (point of purchase) units that play music and capture metrics.
I'll put together a page with the bootloader and other info in the next couple of days.
Yiehha, i am really interested.
Sounds damn cool. I read about all the questions and halftries in this Forum, and gave up hope that somebody enough skilled programmer has the need for this
I think we are all interested in seeing your work
Are you using any of the popular FAT libraries?
Does it handle verification? How does it handle verification (page by page or all at once at the end)? What does it do when there is a mismatch?
Awesome! I was looking for something like this back when I was playing with the Basic Stamp. I had Palm, and would have loved to be able to program the device out in the field. There wasn't a straight forward method to doing it though. Of course, at that time there wasn't anything like an XBee.
Now is there any way to edit a .pde file from a smart phone?
You might be able to edit a .pde file on your smart phone, but how would you compile it? You need to write the resulting .hex file to the SD card, to be loaded by the Arduino, not the edited .pde file.
That's what I was looking into some time ago. I was looking at an arduino doing the compiling and then programming another arduino.
I didn't get very far becuase I realised that that was rather out of my reach with limited knowledge (none) of the bootloader/chip architecture/arduino IDE etc.
I got as far as that you could make sketches to run on arduino but you would need something on the arduino to interpret it (bitlash or similar). Then you could change the code and run different programs at different times, create them on anything as long as you could save it as a text file on a microSD card (or any media that can be interfaced with an arduino). With the new arduino chips (on the mega etc) with a lot more space, bitlash (or similar) could be made so that it could run most commands that you would ever want to run on an arduino.
In theory, you could make your own program that could interpret C++ code and run it using a program on your arduino. Then you wouldn't need to compile it as a hex (or whatever the chip uses), you could have your arduino interpret it as it runs it. It would not be as fast as straight forward 'code' but for most things, that would not matter too much.
Anyone want to embark on a C++ interpreter version of bitlash with me?
It is a project on my list but I have been a bit busy recently and not had much chance to start on this (possibly massive) project.