How can I write to SiPy flash memory?

  • I need persistent storage for my application and intend to use the internal flash memory. The spec sheet says that there is 4MB flash but I can't find any documentation for using the flash. We are not designing another pcb and intend to just use the sipy board with a power supply for a demo. Without having the ability to use onboard flash memory, the application isnt much use when the power resets which would happen periodically.

  • @jmarcelino Thank you for sharing this. To add to this question, are there code example of we can persist an array of structs to the file system? I have a clear idea of how I want to implement a simple persistent database but I cant find micropython examples of doing so. The btree library would have been great but I realised I couldnt use it in this version of the port.

  • You can write files to the onboard /flash filesystem, there's about 512Kb available

    (the stated 4MB includes the space taken up by two copies of MicroPython and some system storage area)

    See this existing topic on how to read/write to files:

  • more info about my Sipy
    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    mode:DIO, clock div:1
    ho 0 tail 12 room 4
    entry 0x4009fc9c
    MicroPython v1.8.6-724-g2b9ed601 on 2017-07-28; SiPy with ESP32
    Type "help()" for more information.

    import os
    (sysname='SiPy', nodename='SiPy', release='1.7.8.b1', version='v1.8.6-724-g2b9ed601 on 2017-07-28', machine='SiPy with ESP32', sigfox='1.0.

Pycom on Twitter