I have found a GitHub project that ports the library to ESP32, but I'm 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");
- "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
I can provide more code and documentation if someone has any idea of what might be happening.
Thanks in advance!