I like the idea of loading it into RAM instead of FLASH, except that RAM is a lot smaller & the problems with relocatable code.
I have a similar concern about the endurance of our FLASH. What if this little board ends up in a small-scale product? If it were in a larger scale product, we would want to protect our code & would not want it to be reflashed every time power-up or reset happened. 10,000 minimum cycles can add up quickly in some products.
Currently:
When the mbed bootloader resets, it looks for files in the 2Meg drive. It selects the most recent *.bin file date, loads it into internal 512k FLASH and executes it. I believe it does this everytime it resets, using up the internal 512k FLASH endurance cycles. If no file is found in the 2Meg drive, the bootloader does not do anything we can see. The previous program that may have been loaded to the 512k FLASH is not executed.
Current FW Ver 141212
Loader 11972
Suggestion:
1. When the mbed bootloader resets, have it load the most recent *.bin from the 2Meg drive (as it does now).
2. User deletes the bin file from the 2Meg drive.
3. Upon reset, if there are no bin files in the 2Meg drive, execute the possible previous internal 512k bin. It won't require reflashing. It is also deeper inside the board and somewhat harder to access by hackers.
4. If we drag & drop a new file onto the 2Meg drive, have the bootloader erase the internal bin and replace it with the new one found in the 2Meg drive.
5. Give us a process to use the program protection system that the chip already has.
Wha-da-ya think?
-LarryB
So, one of the really cool things about another microcontroller....which I've used because it's cheap and pretty versatile....But I won't name here.... ;) Anyway, one cool feature it has is the ability to load a program to RAM and run it from there before having to write it to ROM... The first advantage I can say here is that it gives you the chance to take the shotgun programming approach and load, tweak, load, tweak... without wearing out the EEPROM from excessive writing, etc... (A feature that's fairly nice for those of us without a lot of experience....) =)
Anyway, just a thought... Not even sure if its feasible on the mbed.. But it'd be really cool!! =)