I've met following problem.
In my project, I am working with SD cards(using BF547M), writing a lot of data to SD.
Besides SD activity I have a lot of data moving through DMA with different channels and directions.
And sometimes I am getting SDH TX_FIFO_UNDERFLOW error in SDH PID driver(catch it in adi_sdh_InterruptHandler).
In adi_sdh_InterruptHandler there is a workaround for that case(repeat operation 1 time on reduced frequency), and sometimes it helps, but not always.
If such error happens(and workaround doesn't help) FSS/FSD/SDH driver ususally hangs. This happens because Data semaphore timeout in FSD is set to ADI_SEM_TIMEOUT_FOREVER by default, and in case of fifo error this semaphore is not posted any way. If I am changing timeout to some adequate value(1-2 sec, for example, lower is dangerous, SD operations can be long sometimes) driver doesn't hangs but I'v got 2 seconds pause, waiting for semaphore timeout. After that SDH driver and apropriate DMA channel are in strange condition(DMA doesn't completed and doesn't stopped). If I am trying to repeat operation it can cause an unpredictible behaviour.
I've made changes to my app to reduce bus load and TX FIFO errors are gone, but I think if it will happen someday, I will not have a robust decision for that.
So, my question is - how we can change SDH driver behaviour in error cases? It would be great to receive failed result code without semaphore timeout waiting(error interrupt is generated and we should post semaphore somehow, without DMA complete event). It would be great to have driver in normal condition to have ability to repeat opertion.