As it's the "sdcard_fat_single_disk" example, I would tend rule out the possibility of failure at the SYS_FS level due to the possible need to prefix the path with the mounted device path, e.g. "/mnt/myDrive/" if the SD card is not the current drive (you could call SYS_FS_CurrentDriveSet() first, in this case).
Without reproducing your error scenario, it looks possible that the error is arising out of a failure in create_chain() in the FAT file system implementation in framework/system/fs/fat_fs/src/file_system/ff.c that gets called from f_mkdir().
This would cause f_mkdir() to fail with FR_DISK_ERR ( 1 = "Hard error occurred in the low level disk I/O layer ) and aliasing to SYS_FS_ERROR_DISK_ERROR in SYS_FS_DirectoryMake().
This can be failing for several reasons such as the file system not being recognised as FS_FAT12, FS_FAT16 or FS_FAT32 or underlying FAT chaining functions failing, such as get_fat() failing to get the next cluster of the chain or put_fat() failing to link the next cluster or a sector read failure inside move_window().
Is the disk somehow set to be read-only (even if SD card is being reported as writeable by the write-protect pin)?
Is the file system full - i.e. no free clusters left in the FAT to form a chain?
Are you sure of the integrity of the file system on the card - does it flag any errors with chkdsk or file system utilities when mounted on another platform (Linux, Windows or Mac OS X)?
Does the issue reproduce if you use different physical media (just to rule out a defective SD card)?
Sounds silly, but can you check for stack corruption due to dubious pointer dereferencing elsewhere, totally unrelated to the file system, as I had a similar obscure file system problem at the low-level that turned out to have nothing to do with the FS, it just got clobbered!
post edited by Hologram - 2016/01/12 02:48:25