I am using ESP32 with an SD card, which is preloaded with some data. I read a file line by line for the functioning of the application. It works fine most of the time, but around 1 out of 10 time, the card gets formatted and I have to reload all the data into the SD card.
I am using the following library,
#include "FS.h"
#include "SD.h"
#include "SPI.h"
I tried to learn the pattern of this issue by trying various combination of restart, abrupt power off etc. But couldn't establish any connection.
I read each line very frequently ~ 100 times per second, I believe this may be the issue.