deepsleep & memory



  • I've got a gpy program that wakes up pulls a cycle counter out of flash, sends some data on lte, increments the cycle counter by one, writes it back to flash then deepsleeps for 6 minutes, rinse & repeat. Can flash take 240 read-writes/day indefinitely? Is there a better way to do this? I read somewhere that there is some RTC memory preserved during deepsleep, is that accessible in the user space?

    I don't really understand what RTC memory is for? I have to resync the RTC after each awakening from deepsleep so why does it need memory?



  • From the pycom module documentation :
    "pycom.nvs_erase_all()
    Erase the entire NVRAM memory area."

    AFAIK, there is no way to see all of the contents of nvram on ESP32/Pycom boards.



  • @kjm Tried nvram as an alternative to flash.
    write

    pycom.nv_set('testlocn', 1234)
    

    read

    pycom.nv_get('testlocn')
    

    and clear

    pycom.nv_erase('testlocn')
    

    all work. But what happens if a location gets orphaned, say you forget it's name or some errant iterative code writes to a wrong name. Is there a cmd that erases ALL of the nvram? If not is there a way to see all of the contents of nvram, something like pycom.nv_dir()? Otherwise we risk an accumulation of nvram keys that can't be removed because they are unknown.



Pycom on Twitter