ESP Flash Erase Block

Kumaresan
Posts: 8
Joined: Thu Oct 13, 2022 8:09 am

ESP Flash Erase Block

Postby Kumaresan » Sun Oct 16, 2022 5:33 pm

Hi Team,
In my project,
Application start with 0x30000 with 1MB size
Backup application start with 0x130000 with 1MB.
Here, During my Implementation, I try to erase 13th block start of backup application, Once I triggered this erase command from bootloader after system continues reset. Even chip full erase after as well not possible to recover.
1. Which cause that reset happen once erased the 13th block. How to recover this(even i tried full chip erase after as well contnous reset)
2. As per my understanding every block size 64KB, so 13th block start address 0x130000.

ESP_Sprite
Posts: 9739
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP Flash Erase Block

Postby ESP_Sprite » Mon Oct 17, 2022 12:10 am

Where do you specify this 'block', as in, what do you mean with it? Erase blocks (as in: the minimum amount of bytes that must be erased simultaneously) on SPI NOR chips as used with the ESP32 is 4K, not 64K.

Kumaresan
Posts: 8
Joined: Thu Oct 13, 2022 8:09 am

Re: ESP Flash Erase Block

Postby Kumaresan » Mon Oct 17, 2022 8:03 am

In Customized bootloader, The below test code
esp_err_t err = esp_rom_spiflash_erase_block(0x13);
if(ESP_ROM_SPIFLASH_RESULT_OK == err)
{
ESP_LOGI(TAG, "flash erase successfull");
}
{
ESP_LOGI(TAG, "flash erase not not successfull");
}
err = esp_rom_spiflash_write(0x130000, data, strlen(data));

Why the above test code execution after not possible to recover the board. Always reset the board with watchdog reset(here, the board up and bootloader code executed and code jump to application code but after sometime watchdog reset).

Kumaresan
Posts: 8
Joined: Thu Oct 13, 2022 8:09 am

Re: ESP Flash Erase Block

Postby Kumaresan » Mon Oct 17, 2022 1:39 pm

Our hardware: eSP32-S3-FN8

ESP_Sprite
Posts: 9739
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP Flash Erase Block

Postby ESP_Sprite » Wed Oct 19, 2022 3:17 am

Is your ESP-IDF project configured to the correct size of flash? (Should be under 'serial flasher config'). I think the bootloader should also report if there's a discrepancy between the amount of flash detected and configured.

If not, is there any way you can read back the flash after you initially program it, and after it breaks? It would be useful to see what the difference is, as in, what region actually got erased.

Who is online

Users browsing this forum: No registered users and 112 guests