I have upgraded ESP32 library in my Arduino, from version 2.x to 3.0 (formally, 3.0 is based on ESP-IDF 5.1).
And I have issues with spi_flash_xxxx functions.
I find by myself that functions was upgraded and names was changed to "esp". For example, now there are esp_flash_read instead spi_flash_read.
Also, esp_flash_t *chip parameter was added.
Code: Select all
esp_err_t esp_flash_read(esp_flash_t *chip, void *buffer, uint32_t address, uint32_t length)https://docs.espressif.com/projects/esp ... index.html
My old code working good for 2 years. Part to which the question relates are very simple. I have RAM array:
Code: Select all
uint8_t FLASH_Buffer[4096];Code: Select all
esp_flash_read(0x003FF000, (uint32_t*)FLASH_Buffer, 4096);I reading from main SPI FLASH (the same that contain ESP32 executable code), so I don't call esp_flash_init function. Because ESP32 initializes this memory (and SPI) by itself at startup.
But in 3.0 version, I have to include esp_flash_t *chip parameter.
I try NULL or esp_flash_default_chip, but without success.
Code: Select all
esp_flash_read(esp_flash_default_chip, 0x003FF000, (uint32_t*)FLASH_Buffer, 4096);The same errors for other flash functions (write, erase sector, etc).Compilation error: invalid conversion from 'int' to 'void*' [-fpermissive]
I need to obtain at least compilable code.
What I'm doing wrong, and how to fix it?