About spi_flash_emulation

nekomiya
Posts: 1
Joined: Thu Nov 16, 2023 9:10 am

About spi_flash_emulation

Postby nekomiya » Thu Nov 16, 2023 9:18 am

Hello, I'm a beginner with ESP32, and I have a board called esp32-s3-lcd-board. Currently, I am running the flashdb demo example for ESP32. I noticed that the code uses functions from spi_flash_emulation for SPI read and write operations, but judging by the file names, it seems like this is an official simulation of SPI FLASH, not the actual hardware FLASH. If I want to store data in the real SPI FLASH on the development board, do I need to rewrite the read and write functions, or does spi_flash_emulation ultimately call into the hardware SPI FLASH?
Attachments
flashdb_s3_5.1-main.zip
(53.56 KiB) Downloaded 201 times

pacucha42
Posts: 23
Joined: Fri Mar 29, 2019 12:56 pm

Re: About spi_flash_emulation

Postby pacucha42 » Wed Nov 22, 2023 1:46 pm

Hi @nekomiya,
there is no (actively used) SPI flash emulation in ESP IDF now, the only emulated component for storage needs is esp_partition (ie it compiles on Linux and emulates the SPI flash memory by mmaped file. For instance see https://github.com/espressif/esp-idf/tr ... n_api_test - use idf.py --preview set-target linux, compile and run the ELF file).
Host testing is the only scenario using emulation, I don't see the point to do so when porting FlashDB or whatever similar project to ESP32. Anyway, esp_partition APIs should provide all the interfaces needed, no matter whether on host-side or on chip.

If you need further pointers, please let me know.

Who is online

Users browsing this forum: No registered users and 298 guests