I am working on interfacing micro SD card with Nucleo-F746ZG through SDMMC peripheral. The SDMMC Block device is created as in GitHub - JojoS62/COMPONENT_SDIO: SDIO block device driver. The block device is functioning well and I am able to read the card details. The problem is trying to use FatFileSystem with block device. For instance the file is created and writing file returns successful but I cannot find anything written while reading in PC. The file size shows as 0kb. Repeating by formatting the SD card, often the mount returns an error (-22).
The guidance to solve this issue will be a great help.
Thank you
Actually I was able to work on it, the error code was because the SD card was not formatted properly. After formatting with SD card Formatter and everything was good. But still the issue on writing to the file is not solved and I have a new topic for it. https://forums.mbed.com/t/fatfilesystem-does-not-write-to-the-file-created/8087
Are you ejecting the card safely? I.e. has the file system been closed & deleted, before you take the card out?
Seems in Mbed OS you should create the filesystem dynamically, i.e. use
new FS;
FS.init();
… do the file operations…
FS.deinit()
delete FS;