• When saving, Espruino takes what's in RAM, compresses it, and writes it into flash memory somewhere. Loading is the opposite (and Espruino checks to see if it has code just by checking for a magic byte at the end of that memory area).

    First, you need to find some free pages somewhere on the EP8266's flash memory. I don't know enough about it to help there - is there actually some kind of filesystem?

    But as above, once you know that you stick the address and size of memory you can allow into the .py file, then you need to implement:

    • jshFlashGetPage
    • jshFlashErasePage
    • jshFlashRead
    • jshFlashWrite

    Docs in jshardware.h - the design is such that it should work with must types of flash memory. The bonus there is it allows other Espruino code to access flash memory too - for instance for fake eeproms.

    And that's it - everything else should be handled.

    Wasn't this something @aplikatika had done previously? I think his github page mentioned something.

    The saving code did change - because I wanted to make it easier to port to new platforms - but you should be able to crib the relevant bits of his work quite easily.

About

Avatar for Gordon @Gordon started