esp32-s3 reboot after some writes to sd card
Posted: Tue Jul 11, 2023 9:49 am
Hello everyone!
I use esp32-s3-mini-1 and SD card (one wire dat0). I have big programm with few tasks, and in main_app I write files to SD (every 2,5-3 sec, about 269-275 bytes)on maximum speed. And after some write cycles esp32 reboots with error.
I have two cards and two devices and test all variables, and problem with using sd card? but I don't undarstand where.
When I use first SD card = 16Gb (14910 Mb), 40MHz, esp reboots always after 171 (~ 8 minutes) cycles of writing with error:
Always on the same place of code, where I use fprintf() to file.
And once it reboots with same error on line with fopen()
Then I tried anothe SD card = 4Gb (3840 Mb), 20MHz, esp reboots always after 89 cycles (~ 4 minutes) of writing with same error. But! on another place on snprintf() function (a little before first place).
I thought, that problem was with main_app stack size (was 4095, watermark was ~1100+) and added 1024 bytes to stack. Now watermark is about 2500 bytes. But it still reboots.
And if I started device without SD card - all work and try to write (but not write) more than hour without problems.
What to do? Where problem can be?
I use esp32-s3-mini-1 and SD card (one wire dat0). I have big programm with few tasks, and in main_app I write files to SD (every 2,5-3 sec, about 269-275 bytes)on maximum speed. And after some write cycles esp32 reboots with error.
I have two cards and two devices and test all variables, and problem with using sd card? but I don't undarstand where.
When I use first SD card = 16Gb (14910 Mb), 40MHz, esp reboots always after 171 (~ 8 minutes) cycles of writing with error:
Code: Select all
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x400556d5 PS : 0x00060d30 A0 : 0x8202805d A1 : 0x3fcf3ab0
A2 : 0x00000000 A3 : 0xfffffffc A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x00000000 A9 : 0x3fcf3ab0
A10 : 0x00060d23 A11 : 0x00000000 A12 : 0x00060d20 A13 : 0x00000000
A14 : 0x3fce3218 A15 : 0x3fce9b40 SAR : 0x0000000c EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x400556d5 LEND : 0x400556e5 LCOUNT : 0xffffffff
Backtrace:0x400556d2:0x3fcf3ab0 |<-CORRUPTED
And once it reboots with same error on line with fopen()
Code: Select all
Backtrace:0x40375c2e:0x3fcf39b00x4037bb19:0x3fcf39d0 0x403828fa:0x3fcf39f0 0x40376ec3:0x3fcf3a60 0x403770c6:0x3fcf3a80 0x42027f35:0x3fcf3aa0 0x42027fd8:0x3fcf3ad0 0x4202808d:0x3fcf3b00 0x4200e3d2:0x3fcf3b20 0x4200ba24:0x3fcf3b40 0x42006acb:0x3fcf3b80 |<-CORRUPTED
I thought, that problem was with main_app stack size (was 4095, watermark was ~1100+) and added 1024 bytes to stack. Now watermark is about 2500 bytes. But it still reboots.
And if I started device without SD card - all work and try to write (but not write) more than hour without problems.
What to do? Where problem can be?