ESP32 and SD Card ?

Posted on
  • In a project some data should be stored for later use.
    My decision is to use an SD Card, to be open for a lot of data.
    Problem is E.connectSDCard, I get an error message.
    Somewhere in my mind is a feedback like "you have to build your own binary"
    After some jumping through sources, I could see FLASHFS and FILESYSTEM.
    This is where some confusions starts with different boardfiles for ESP32
    First is ESP32.py having both set
    Next is ESP32_IDF4.py where both are commented
    And for different boards
    ESP32C3_IDF4.py, both are commented
    ESP32S3_IDF4.py, only FLASHFS is commented

    What is the reason for different handling.
    What should I do to build a version which supports SD Cards and runs on a standard ESP32 ?
    I could use ESP32 WROVER oder WROOM and would prefer the WROVER with additional memory

  • I think you need FILESYSTEM but not FLASHFS.

    FLASHFS was added in https://github.com/espruino/Espruino/commit/a167bd3eeb3fcdd3667562a96e8a8aba44e68d93
    to allow some of the flash memory to be used by turning it into a FatFS filesystem.

    At the time the Storage module didn't handle multiple files well so @Wilberforce wanted wanted a way to expose it, but I believe doing so uses FatFS so it can't be used for other stuff (at least in the current implementation).

    Personally I'd like to remove FLASHFS totally now. I don't know what others think but IMO it's a bit confusing having two different filesystems, one of which appears in the IDE one of which doesn't. For instance the second post on the forum right now is https://forum.espruino.com/conversations/400842/#comment17584054 where this exact thing has happened

    We could remove FlashFS and change the partitions so we have a great big area for Storage - and because of the way Storage stores data it's all memory-mapped, so if you write something to it (for example an image) it can be used in Espruino straight from Flash without ever loading it into RAM.

  • Flashfs needs to be disabled to have E.connectSDCard running (see jswrap_file.c)
    Comparing the comfort of having a file system for flash memory (storage), and not having the chance to use an SD Card, my winner is SD Card.
    Last not least looks to me Flashfs being a special function for ESP32 only.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

ESP32 and SD Card ?

Posted by Avatar for JumJum @JumJum

Actions