Return Code of API Functions

Most of API functions return common result code as enum type FRESULT. When an API function succeeded, it returns zero (FR_OK), otherwise it returns non-zero value indicates type of error.

FR_OK (0)
The function succeeded.
FR_DISK_ERR
An unrecoverable hard error occured in the lower layer, disk_read, disk_write or disk_ioctl function.
Note that if once this error occured at any operation to an open file, the file object is aborted and all operations to the file except for close will be rejected.
FR_INT_ERR
Assertion failed. An insanity is detected in the internal process. One of the following possibilities is suspected. Note that if once this error occured at any operation to an open file, the file object is aborted and all operations to the file except for close will be rejected.
FR_NOT_READY
The storage device cannot work due to a failure of disk_initialize function due to no medium or any other reason.
FR_NO_FILE
Could not find the file.
FR_NO_PATH
Could not find the path.
FR_INVALID_NAME
The given string is invalid as the path name.
FR_DENIED
The required access was denied due to one of the following reasons:
FR_EXIST
Name collision. An object with the same name is already existing.
FR_INVALID_OBJECT
The file/directory object is invalid or a null pointer is given. There are some reasons as follows:
FR_WRITE_PROTECTED
A write mode operation against the write-protected media.
FR_INVALID_DRIVE
Invalid drive number is specified in the path name. A null pointer is given as the path name. (Related option: _VOLUMES)
FR_NOT_ENABLED
Work area for the logical drive has not been registered by f_mount function.
FR_NO_FILESYSTEM
There is no valid FAT volume on the drive.
FR_MKFS_ABORTED
The f_mkfs function aborted before start in format due to a reason as follows:
FR_TIMEOUT
The function was canceled due to a timeout of thread-safe control. (Related option: _TIMEOUT)
FR_LOCKED
The operation to the object was rejected by file sharing control. (Related option: _FS_LOCK)
FR_NOT_ENOUGH_CORE
Not enough memory for the operation. There is one of the following reasons:
FR_TOO_MANY_OPEN_FILES
Number of open objects has been reached maximum value and no more object can be opened. (Related option: _FS_LOCK)
FR_INVALID_PARAMETER
The given parameter is invalid or there is an inconsistent for the volume.

Return