I’m trying use the url=https://github.com/datalightinc/reliance-edge/Reliance Edge library to a project I’m developing with ESP32, which is a fail-safe file system for SD cards. I have found a https://github.com/lllucius/esp32_redflash GitHub project that ports the library to ESP32, but I am having some issues trying to persist a written file. My application is just initializing the port library, which initializes the file system. After that, I’m writing a .txt file and reading it right afterwards. The problem is that when I reprogram the board to just read those test files, I find out that they doesn’t persist in the SD card when I try to just read the file written last time. A section of my code is presented below:
test_setup(OPENFILES);
char *text = “Hello World!\r\n”;
write_test(MOUNT_POINT “/hello.txt”,text);
char *resp = read_test(MOUNT_POINT “/hello.txt”) /code
Some more information about the code above: OPENFILES is the max files I can open, defined as 4
MOUNT_POINT is another define (/redflash)
test_setup() doesn’t format the SD card at any moment
write_test() and read_test() are basically just fwrite() and fread() with appropriate fclose()
When I reprogram ESP, I comment lines 2 and 3 leaving just the reading section. The error occurs right after it tries to fread() a FILE pointer that is NULL by fopen(). I can provide more code and documentation if someone has any idea of what might be happening. Thanks in advance!
[ed. note: tony.questad@datalight.com last edited this post 3 years, 5 months ago.]