Mark,
I haven't tested this, but it seems like you should be able to write a file from an mbed program that has a more recent date than the other files on the internal "disk". You might have to set the system time to make this work.
If you can make that work, then here's one possible solution to your problem:
To make "prog_a" the current program:
1. Delete the file "current.bin".
2. Copy the file "prog_a.bin" to "current.bin" (read a block, write a block, repeat until done)
3. When the mbed restarts, it should run "current.bin", which is the same as "prog_a.bin".
To make "prog_b" the current program, substitute "prog_b" for "prog_a" in steps 2 and 3.
Regards,
-Mike
I'm wondering... I recall reading that the mbed determines which .bin file to run on startup based on whichever has the most recent date. Is there a way to have several .bin files, the mbed boots from the latest one, and somewhere in the program if needed the running program select another .bin file from the local filesystem and change it's date so it is the most recent and then reset the mbed to boot from the alternate .bin file? This could be useful for many reasons and I can't see any reason other than my limited experience with the mbed that it shouldn't work...
Any input would be great!
-mark