readdir cause panic on 16MB spi flash board

gongli
Posts: 10
Joined: Fri Dec 21, 2018 2:56 am

readdir cause panic on 16MB spi flash board

Postby gongli » Fri Dec 21, 2018 3:30 am

Hi,
I have an ESP32-WROVER-B module with 16MB flash partitioned as follows:

Code: Select all

nvs,      data, nvs,     0x9000,  0x4000,
otadata,  data, ota,     0xd000,  0x2000,
phy_init, data, phy,     0xf000,  0x1000,
factory,  0,    0,       0x10000,  2M,
ota_0,    0,    ota_0,   0x210000, 2M,
ota_1,    0,    ota_1,   0x410000, 2M,
storage,  data, spiffs,  0x610000, 0x9F0000,
The lart part is a spiffs partition and was formatted automatically at first boot. And my app can write file to it without error. However, when doing a dir list, it causes panic like follows:

Code: Select all

Guru Meditation Error: Core  0 panic'ed (Cache disabled but cached memory region accessed)
Core 0 register dump:
PC      : 0x400d7110  PS      : 0x00060034  A0      : 0x40084e30  A1      : 0x3ffb0690  
A2      : 0x3ffb1144  A3      : 0x3ffc2350  A4      : 0x3ff42000  A5      : 0x40095754  
A6      : 0x00000000  A7      : 0xffffcffb  A8      : 0x800855d1  A9      : 0xe0020c00  
A10     : 0xe0020800  A11     : 0x00000000  A12     : 0x8008f4e5  A13     : 0x3ffcb880  
A14     : 0x00000000  A15     : 0x3ffcb8b0  SAR     : 0x00000017  EXCCAUSE: 0x00000007  
EXCVADDR: 0x00000000  LBEG    : 0x40098b10  LEND    : 0x40098b3e  LCOUNT  : 0x00000000  
Core 0 was running in ISR context:
EPC1    : 0x4008f67a  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x400d7110

Backtrace: 0x400d7110:0x3ffb0690 0x40084e2d:0x3ffb06b0 0x4008f677:0x00000000

CPU halted.
My code running there was calling

Code: Select all

readdir(...)
. From the core dumps above, it seems panic happens running inside

Code: Select all

esp_rom_spiflash_read_data
The app runs the code without error on 4MB flash module (with partitions properly laid for 4MB size). I was wondering how the 16MB flash case fails. Any help will be highly appreciated!

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: readdir cause panic on 16MB spi flash board

Postby ESP_igrr » Fri Dec 21, 2018 3:46 am

Hi gongli, thanks for reporting this. Could you please use idf_monitor (or gdb) to decode the rest of the call stack?

https://docs.espressif.com/projects/esp ... -backtrace

The exception seems to happen inside an interrupt, so perhaps you have some interrupt handler which calls a function which is not in IRAM, and at the same time the interrupt handler is registered with ESP_INTR_FLAG_IRAM.

gongli
Posts: 10
Joined: Fri Dec 21, 2018 2:56 am

Re: readdir cause panic on 16MB spi flash board

Postby gongli » Fri Dec 21, 2018 6:57 am

Indeed, there is one simple wraper function missing IRAM decorator actually called by my ISR. Thus cause the panic. Though, it works pretty well on my 4MB board.

Thank you sir, igrr, for help me find it out.

Who is online

Users browsing this forum: No registered users and 73 guests