Question
usb host fails to read/write data on usb drive due to error FR_DISK_ERR
Posted on November 05, 2015 at 12:34
hi,
i am working on usbh+fatfs code generated from STM32CcubeMX. sometimes USBh fails to read/write data on usb drive. f_read/f_write/f_open returns FR_DISK_ERRon going in little depth i found that data is written/read in while loop in msc layer. program will come out of this while loop only on completion of write/read process or if timeout(10sec) occurs. i found that sometimes timeout occurs and this causes FR_DISK_ERR.i have two questions:1). this write fail happens sometimes(not always). so what can be the reason that it happens sometimes. in what direction i should debug.2) how to recover from this FR_DISK_ERR, as after this no USB operation works.any ideas?? #fr_disk_err #fat #usb_otg_fs