AnsweredAssumed Answered

HAL 1.7.1 - SD driver sets DMA handles to NULL?

Question asked by Allan Bazinet on Jul 19, 2017

I've used the HAL SD driver in various versions up to and including 1.6.0.

 

Experimenting with the new 1.7.1 SD driver, it appears to get into situations where the DMA and the command response occurs out of order on a read, i.e., the DMA happens so quickly that the DMA complete callback occurs before the command response can be read. It's infrequent, but common enough, at least on the F437 we're using. I'd guess that a critical section with respect to the DMA completion interrupts needs to be established.

 

However, when this happens, the driver abort code nulls out the DMA handle pointers in the SD handle. As such, the next time the SD IRQ handler runs, it's now got a NULL handle, and will proceed to corrupt memory.

 

The documentation and examples do not speak to this change or provide a means to deal with reestablishing the destroyed linkage between the HSD and the HDMAs. Presumably, the application code is expected to handle the situation. Is there some new documentation or example that might indicate what is expected?

Outcomes