SDMMC BlockDevice - Nucleo F746ZG


I am working on interfacing micro SD card with Nucleo-F746ZG through SDMMC peripheral. The SDMMC Block device is created as in 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

I know that my answer is no going to solve your problem, but there is PR for SDMMC in mbed so it looks like this block device will be added soon

Thank you for the reply,

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.

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;
… do the file operations…
delete FS;

(In pseudocode).