Yeah, it re-writes all of flash, so would eventually give you problems if you rewrite it every minute or so. Every hour might be Ok but it also ends up resetting your code each time, and if it failed to flash it could delete your code.
You're best off using the FlashEEPROM module. That still stores data in flash, but it does it by adding just the new data and then erasing only when needed - so realistically it'll make flash last long enough that you shouldn't have to worry... And it doesn't reset or risk changing your code.
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.
Hi Sven,
Yeah, it re-writes all of flash, so would eventually give you problems if you rewrite it every minute or so. Every hour might be Ok but it also ends up resetting your code each time, and if it failed to flash it could delete your code.
You're best off using the FlashEEPROM module. That still stores data in flash, but it does it by adding just the new data and then erasing only when needed - so realistically it'll make flash last long enough that you shouldn't have to worry... And it doesn't reset or risk changing your code.