I'm on Arduino Zero and I'm using FatFs 0.14b + SerialFlash library to write on a Winbond SPI Flash W25Q128FV.
The creation of the file system with f_mkfs() returns FR_OK, so far so good. Then I try creating, writing and reading a test file.
The first f_open() for writing returns FR_OK, but after closing the file, the next f_open() for reading the created file returns FR_NO_FILE.
If I do a memory dump, I can see the contents of the file ("my test" in ASCII) at a certain address. So something has actually been written...
FATFS fs;
FRESULT res = f_mount(&fs, "", 1);
// res = 0, OK FIL test;
res = f_open(&test, "TEST.DAT", FA_CREATE_ALWAYS | FA_WRITE);
// res = 0, OK
char* buff = "my test";
uint wr;
res = f_write(&test, buff, strlen(buff), &wr);
// res = 0, OK
res = f_close(&test);
// res = 0, OK
res = f_open(&test, "TEST.DAT", FA_READ);
// res = FR_NO_FILE, KO!!!
Has anyone ever had this kind of issue with FatFs?