Get SPI flash unique ID

redpanda
Posts: 13
Joined: Thu Feb 04, 2021 8:42 am

Get SPI flash unique ID

Postby redpanda » Thu Aug 19, 2021 4:25 am

Is there any code example that is able to read SPI flash unique ID?

Trying out ESP-IDF example https://github.com/espressif/esp-idf/bl ... ple_main.c but it said

Code: Select all

E (450) example: Failed to initialize external Flash: ESP_ERR_INVALID_RESPONSE (0x108)
I tested the code on ESP32-WROVER module with 4MB SPI flash.

In the sample code, esp_flash_read_id() is the API to get the flash ID but how can I get the esp_flash_t* ext_flash of the ESP32 module default SPI flash? Any recommendation?

Victoria Nope
Posts: 75
Joined: Fri Dec 04, 2020 9:56 pm

Re: Get SPI flash unique ID

Postby Victoria Nope » Thu Aug 19, 2021 6:10 am

redpanda wrote:
Thu Aug 19, 2021 4:25 am
In the sample code, esp_flash_read_id() is the API to get the flash ID but how can I get the esp_flash_t* ext_flash of the ESP32 module default SPI flash? Any recommendation?

Pass NULL to the chip parameter of the esp_flash_read_id function call. That will read ID of the default flash chip. Just when mentioning unique ID, maybe you are rather interested in the esp_flash_read_unique_chip_id function.

Who is online

Users browsing this forum: No registered users and 189 guests