cancel
Showing results for 
Search instead for 
Did you mean: 

FatFS and FreeRTOS error f_write().

AKuzn
Associate

Good day.

I am having difficulty with FatFS while working with FreeRTOS.

The problem is of the following nature. Mounting the distka goes well. There is no problem to create a file either. But when trying to write to a file, the f_write () function always returns FR_DISK_ERR.

2 REPLIES 2

Would recommend instrumenting the DISKIO layer to understand the interaction and failure.

Print out the fault codes from the SDIO/SDMMC layer.

Remember that the SDIO/SDMMC doesn't multi-task, you'll need some mutex or semaphore to gate ownership, and handle interrupts in a timely fashion.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
AKuzn
Associate

Semaphore has already been created by CubeMX. DMA interrupt priority is lower than RTOS. Mounting a disk, creating a file and reading from a file goes well, but writing always returns FR_DISK_ERR.