2024-03-07 07:57 AM
Hello community,
I am using STWINKT1B board and trying to implement basic accelerometer datalogging from scratch. I don't want to use HSDatalog because I don't need so many functionnalities.
I am using FATFS functions, able to use mount, mkfs, mkdir, open and write functions to create this file DATA/data_000.TXT.
When I add the f_stat (after mount and mkfs) function with the path "DATA/data_000.TXT" and restart the board, I always get a FR_NO_FILE error.
If I put the SD card in my laptop I can see the file in DATA/data_000.TXT:
Here is my code:
Any idea about what could cause the issue ?
Thank you
Solved! Go to Solution.
2024-03-11 10:13 AM
The reason of creating a new volume is your program calling f_mkfs().
How to solve: do not call f_mkfs unconditionally. If the storage is already formatted, f_mount is enough.
2024-03-09 02:23 PM
It looks like the change caused by f_mkfs() has not been flushed to the medium. The local program then sees the volume as empty (just created) so your file is not found. But the file actually remains on the medium and can be seen when mounted on another system.
2024-03-11 08:08 AM
Yes it is possible. By debugging the f_mkfs() function it seems it is creating a new volume. What could be the reason? How to solve this ?
2024-03-11 10:13 AM
The reason of creating a new volume is your program calling f_mkfs().
How to solve: do not call f_mkfs unconditionally. If the storage is already formatted, f_mount is enough.