Hello,
I want to access the flash (external) connected with SPI0 bus. I need the APIs which I need to call in order to perform several flash operations(read,write, erase). If possible can anyone guide me using an example?
Accessing the Flash on SPI0 of esp32 -wroom-32
-
- Posts: 9708
- Joined: Thu Nov 26, 2015 4:08 am
Re: Accessing the Flash on SPI0 of esp32 -wroom-32
Thank you for your quick response, but I have gone through those API's mentioned in the doc but there is no such api for initializing SPI0 flash as it is the default flash that can be accessed. Lets say for example if I use " esp_err_tspi_bus_add_flash_device(esp_flash_t **out_chip, constesp_flash_spi_device_config_t *config)" then for this SPI0 default flash what should i wrote in the first argument?? and same for other api's.
Re: Accessing the Flash on SPI0 of esp32 -wroom-32
It is already initialized and you probably should use partition apis
https://github.com/espressif/esp-idf/tr ... tition_ops
https://github.com/espressif/esp-idf/tr ... tition_ops
Re: Accessing the Flash on SPI0 of esp32 -wroom-32
Ok. Thanks will try out and will get back with the status.
Re: Accessing the Flash on SPI0 of esp32 -wroom-32
My second question is what will be the user memory available in the external flash which is interfaced with SPI0(internally).
-
- Posts: 9708
- Joined: Thu Nov 26, 2015 4:08 am
Re: Accessing the Flash on SPI0 of esp32 -wroom-32
That depends on the partition layout you selected.
Re: Accessing the Flash on SPI0 of esp32 -wroom-32
Thanks. I got my code tested using the partition example you suggested. Now if suppose I need to store data in flah for different tasks so every time in order to write data at a location do I need to do
write "esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, "storage"); " every time? Or is there any alternative way ?
write "esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, "storage"); " every time? Or is there any alternative way ?
Re: Accessing the Flash on SPI0 of esp32 -wroom-32
I meant if I have a block of data say 512 bytes and I need to store 128 bytes at consecutive address location so for that in the for loop how will I get my next address to write?
Who is online
Users browsing this forum: No registered users and 133 guests