6 years, 11 months ago.

How can i find reference to the error messages from mbed os FAT File System?

I have written a block device wrapper for the BSP_DISCO_F746NG. I'm trying it out with the FATFileSystem and mbed os. When i try formatting an SD card I get -5 error code. I've tried to search but haven't found a reference to what these error codes mean, is there a specification?

Thanks!

1 Answer

6 years, 11 months ago.

I think the error codes are in the source file. This might be it. Error 5 is, can't find the path.

https://github.com/ARMmbed/mbed-os/blob/master/features/filesystem/fat/FATFileSystem.cpp

Here is a link to the Block Device class I've tried to wirte. It uses the BSP_DISCO_F746NG and I have gotten write and program to work when I access them directly, but for some reason I cannot get FATFileSystem to work. I can mount a file system without error, but I cannot format and when I try to read file names or file content I get nothing.

https://os.mbed.com/users/Lightsource/code/BD_DISCO_F746NG/

An odd thing is that the BSP librarys SD-card functions return 1024 bytes block size and corresponding number of blocks, which from what I know no SD-cards have. If I use the retrieved block size like this: _blocksize = _currentCardInfo.BlockSize; I cannot mount the file system at all, but if I hard code 512 bytes for the block size, I can atleast mount the file system. Any help on how to get forward would be very much appreciated! :)

Thanks!

posted by Olle Sköld 14 Dec 2017