I'm getting a crash whenever I re-read a file on my SPIFFS partition on my ESP32 and have been going crazy trying to figure out why.
I'm closing the file when I read it the first time.
And I just noticed that a completely unrelated variable is being assigned a value, which makes me suspect a memory leak or some other memory issue.
I've been using the Arduino IDE, and have the ESP Exception Decoder tool installed. Here's what it says on the crash:
PC: 0x00000000
EXCVADDR: 0x00000000
Decoding stack results
0x400da6a2: buildDB_from_fs() at C:\Users\wrybread\Documents\Arduino\fide1/fide1.ino line 2029
0x400db139: loop() at C:\Users\wrybread\Documents\Arduino\fide1/fide1.ino line 905
0x400e5415: loopTask(void*) at C:\Users\wrybread\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32\main.cpp line 19
0x4008e84d: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143
I don't imagine anyone has any idea?
And/or is there some way to monitor the memory usage?
Ok.
The first line tells that 82% of program memory is used. If the running sketch uses program memory
I can't tell. If it would, that could be worth looking closer at.
The second line tells that 26% of dynamic memory is used and that must be safe.
Attache the code in the same way as the info given earlier. Hopefully the best knowing helper will see something.
Program storage is completely irrelevant as it's only written at sketch upload time (exception jffs). Dynamic memory is more relevant but the number you got is only that part of the memory you use for global variables and constant strings.
You still failed to post the relevant information: your code. Everything you posted yet is irrelevant to debug your problem.