That info would have to be persisted in the save() area
I'm not sure I understand this? You mean that when you update firmware you don't want to overwrite it?
Really good documentation on the memory layout though - I need one of those for Espruino boards :)
I think if we added int jshGetFreeFlashAreas(uint32_t **addressAndLength, int maxAreas) to jshardware.c then the process.memory implementation could just use that, and report each area back as addr and length?
I guess probably returning a set of ranges (from + length) would be best, as otherwise you're going to get swamped with data items if you ask how many pages are in the 4MB parts :)
... other option is to just have JsVar *jshGetFreeFlashAreas() and let each platform return its own array of data (I guess then some platform-specific hints could be added).
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.
I'm not sure I understand this? You mean that when you update firmware you don't want to overwrite it?
Really good documentation on the memory layout though - I need one of those for Espruino boards :)
I think if we added
int jshGetFreeFlashAreas(uint32_t **addressAndLength, int maxAreas)
tojshardware.c
then theprocess.memory
implementation could just use that, and report each area back asaddr
andlength
?I guess probably returning a set of ranges (from + length) would be best, as otherwise you're going to get swamped with data items if you ask how many pages are in the 4MB parts :)
... other option is to just have
JsVar *jshGetFreeFlashAreas()
and let each platform return its own array of data (I guess then some platform-specific hints could be added).