2018-04-08 11:38 PM
Hello everyone
I use stm32f746 discovery board. I implemented emwin,Free rtos and Fatfs for the SDcard(using SDIO interface). In my application after pressing a button, a value(as a string) is saved in the SDcard. Everything works fine.but after an unspecified time, pressing 'save button' makes the application go to handle to the idle task(this function: void vApplicationIdleHook(void)) and about 30 seconds everything is stopped. after this time f_close function returns FR_DISK_ERROR. This happens exactly the moment disk_write function is executed.(disk_write in f_sync or f_close functions) Is there a way to prevent this happening? Any Help please ? Thank you2018-04-09 07:08 AM
I would avoid calling FATFS/SDIO from an asynchronous interrupt, the routines are unlikely thread-safe, and at the SDIO level need to have access serialized.
Suggest you flag a deferred operation, and keep the FATFS/SDIO code in a singular thread.
2018-04-09 10:55 PM
Hello clive
Thanks for your fast reply.
I used just one thread that's why this problem is occured.
I have to add another thread for FATFS functions.I hope the problem is resolved.
But I can't understand what you mean by this '
flag a deferred operation
'.