Page 1 of 1

Getting external flash to work - many questions!

Posted: Thu May 02, 2024 6:35 pm
by kevinevans
Hi all, I'm having some trouble understanding some of the documentation on getting an external flash module to work on an ESP32-S3. I have a ton of questions!

When the docs reference "external memory", is that referring to just off-chip memory? or off-module memory? I have an ESP32-S3-WROOM-1-N8. Is that 8 MB flash within the module can the "external memory?"

In my project, I'd like to attach a 256 MB SPI flash to the ESP32-S3-WROOM-1-N8. I have minimal writes and it's mostly going to be used as RO memory with rare updates (think like 10 writes, 10k reads). I don't really need a full-on file system here (if there's much overhead) and mostly just need to random-access the data.

What SPI bus am I supposed to use? I assume SPI0 and SPI1 are off limits here since there's already memory on those buses. Should I use SPI2 here? Do I need to set up anything in `menuconfig` or should I initialize the memory in code? Do I need to do anything with the partition table?

Can I even use the `esp_partition_*` functions if I'm not defining memory in the partition table? Do I have to use the lower level `esp_flash_*` functions for this project?

Are there any examples for doing something like this? I looked in esp-idf/examples and there doesn't seem to be anything directly using the esp_partition/esp_flash functions. Should I be using SPIFFS here?

Any pointers would be very appreciated!
Thank you!

---

Here's the memory chip that I'm intending to use: https://www.digikey.com/en/products/det ... tdetail_US

Re: Getting external flash to work - many questions!

Posted: Mon May 06, 2024 1:59 pm
by ESP_rrtandler
Hi kevinevans,

You can use ESP IDF examples/storage/ext_flash_fatfs as a starting point to learn, how to let external SPI based flash work with filesystems supported in the ESP IDF.