Arduino EXEs?


I was working on a program somewhat like an esplora DS; the standard TFT screen on the esplora. I was making some programs and games for it when I wondered;

Is it even possible to have a program run off of a file on an SD card or other storage devices?

I mean, can you put a file (of whatever format) on a storage device and get the Arduino to run the raw AVR instructions contained on the file?

If not, don't worry; I can easily write up a simple shell script or something (I have had experience with shells before) :slight_smile: . But it would be really handy if that could be done.


PS: Let's assume that I can write ANY file, with ANY data to the SD card. I can't, but I could probably figure something out if needed.

I'm pretty sure the answer is "no", unless you count writing a bootstrapper that copies program code from SD into the AVR MCU's flash or something. No reason that shouldn't work. In fact, I'm sure it's been done many times, but it certainly wouldn't give you that "game cartridge" experience.

No, this can't be done. The AVR 8-bit architecture can only fetch instructions from program memory, not from RAM or from external flash. If you really want to make this work, you'd have to implement some sort of viritual machine on the AVR and have that VM fetch its instructions from the SD card. The programs on the SD card would be written in the language of the VM. This would be a complex task but I think it might be technically feasible.

Take a look at
"Bitlash: a programmable command shell for arduino"