running a program from flash versus running from sd



  • What are the considerations to take into account when defining the directory tree for the LoPy to run software? does it matter where the main program runs? Is it better to execute the main program from the flash directory than from the memory card, or the other way around?

    For example, in the tree below main.py located in flash would call main_program.py

    /sd
      lib/
      other/
      main_program.py
    /flash
      boot.py
      main.py
    

    is this somehow more robust than

    /sd
      lib/
      other/
     
    /flash
      boot.py
      main.py
      main_program.py
    

    ? why?

    Thanks!



  • Thank you all. I am mostly interested in a stability and reliability. Then on performance and power consumption.

    From your responses and other threads, as well as documentation I gather that memory management can be an issue. However, it seems that there are no obvious practical implications (within some limits?) of running either of the options above, as both external flash memory and external RAM are cached to internal RAM.

    pycom_system_block_diagram_annotated.pdf



  • uSD usually uses a lot more energy when writing/reading. Even if not mounted, the uSD card waste some tens/hundreds of uA in deepsleep.

    Depending on the requirements, EEPROM or FRAM memories (8 can be connected by I2C) can be better : more writing cycles, less power, etc.



  • @brauliob Writing speed on SD card is faster. Read times are more or less the same of flash and SD. Both use single bit fast SPI. Code is always executed from RAM, unless you freeze it in flash. Then loading time is very fast, and it does not use RAM for the byte code.



  • Better in which way?

    The SD card needs additional power, is not as fast connected as the interal flash and can rattle out of its slot, but it is replaceable if worn out.

    If you test your stuff in different pycom devices, it may be more comfortable to exchange only the sd card than flashing multiple devices.


Log in to reply
 

Pycom on Twitter