2020-08-16 07:14 AM
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.
2020-08-16 12:26 PM
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.
2020-08-16 11:47 PM
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.