The Storage library uses the flash memory areas that are reserved for saving your code - internally saved code now also uses the storage module, so effectively the storage is being split automatically between saved code and your own data. The FlashEEPROM just tries to find an area of memory that isn't used for anything else - so yes, you should be able to run both at the same time without problems.
I'd definitely say use Storage for your second copy of the code. It should be pretty straightforward to use - and actually if you just eval(require("Storage").read(...)) then it'll be pretty efficient.
All I'd say is watch out if you then delete the second copy of the firmware - doing the eval as above will actually leave the function code in flash memory, so if you then erase flash all the code for the functions in RAM will disappear. If you want to avoid that then you can do eval(require("Storage").read(...)+"") to force the code to be loaded right into RAM though.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The Storage library uses the flash memory areas that are reserved for saving your code - internally saved code now also uses the storage module, so effectively the storage is being split automatically between saved code and your own data. The FlashEEPROM just tries to find an area of memory that isn't used for anything else - so yes, you should be able to run both at the same time without problems.
I'd definitely say use
Storage
for your second copy of the code. It should be pretty straightforward to use - and actually if you justeval(require("Storage").read(...))
then it'll be pretty efficient.All I'd say is watch out if you then delete the second copy of the firmware - doing the eval as above will actually leave the function code in flash memory, so if you then erase flash all the code for the functions in RAM will disappear. If you want to avoid that then you can do
eval(require("Storage").read(...)+"")
to force the code to be loaded right into RAM though.