I'm developing a product that uses a ESP32-WROVER-E(M213EH6464PH3Q0) Module (ESP32-D0WD-V3, 3.3V 64Mbit PSRAM, 8 MB SPI flash).
I can't figure why when I write on a custom partition in flash, when I read back the data it appear to be corrupted.
this is my partition table:
Code: Select all
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 32K
otadata, data, ota, , 8K
phy_init, data, phy, , 2K
factory, app, factory, , 1536K
ota_0, app, ota_0, , 1536K
ota_1, app, ota_1, , 1536K
myappdata, data, 0x87, , 1536K
Code: Select all
int fs_write(const void *data, void *addr, u32 size)
{
const esp_partition_t* part;
part = esp_partition_find_first(
ESP_PARTITION_TYPE_DATA,
0x87,
NULL);
if (part != NULL)
{
if (esp_partition_write(part, (size_t)addr, data, (size_t)size) == ESP_OK)
{
...
Code: Select all
if(esp_partition_read(part,(size_t)addr + c,(void*)tmp,toread) == ESP_OK)
{
if(memcmp((const void*)&dataptr[c], tmp, toread) != 0)
{
..
Code: Select all
spi_flash: Write at offset 0x4b4014 requests 0x48d766fe but will write 0x40850000 -> 0x40850000␛[0m
or similar:
spi_flash: Write at offset 0x4b4000 requests 0x00000001 but will write 0x00000000 -> 0x00000000␛[0m
spi_flash: Write at offset 0x4b4004 requests 0x89abcdef but will write 0x00000000 -> 0x00000000␛[0m
spi_flash: Write at offset 0x4b4008 requests 0x01234567 but will write 0x00000000 -> 0x00000000␛[0m
And yes, when I call esp_partition_read I will read 0x40850000.
the write offset (0x4b4014) seems good because myappdata starts at 0x493800 as partition table
Why this happens?!
Can someone help me with this issue?
Have a nice day,
Thank you in advice