Page 1 of 1

ESP32 Wrover SPI flash erase and write function fail under Arduino IDE

Posted: Mon Dec 30, 2019 9:36 am
by chief23c
I am using a ESP32 Wrover which has 4MB SPI flash and 8MB PSRAM with Arduino IDE ,
I had include the https://github.com/espressif/arduino-es ... pi_flash.h into my program and use the
esp_rom_spiflash_erase_sector(0);
esp_rom_spiflash_write(0, FLASH_Display_Memory, 4096);
esp_rom_spiflash_read(0, PSRAM_Display_Memory, 4096);

to do write an read the SPI flash but it only worked when "dest_addr" of esp_rom_spiflash_write() and "sector_num" of esp_rom_spiflash_erase_sector() are both '0'. if I put "dest_addr" or "sector_num" other than '0' it won't work and the chip will down and cannot be reset, I had to re-upload the program to make it run again.
If I run "esp_rom_spiflash_erase_block(0)" or "esp_rom_spiflash_erase_chip()" before esp_rom_spiflash_write(0, FLASH_Display_Memory, 4096); even the "dest_addr" of esp_rom_spiflash_write() is '0', chip will hang as description above.