-
Bug
-
Resolution: Fixed
-
Medium
-
TI Device Drivers
-
TIDRIVERS-4068
-
TIDRIVERS_4_30_01
-
TIDRIVERS_5_10_00
-
Issue:
If there (for any reason really) happens to be a starvation for the ADC DMA channel or the ADC ISR, the ADC could end up overflowing the internal FIFO.
As the overflow/underflow flags are part of the the combined ADC_IRQ event, this would cause the ADCBuf driver to get stuck in an forever Hwi loop as the ADCBuf driver do not handle these events. In order for the ADC_IRQ to be cleared again, the driver need to flush the FIFO following an overflow/underflow.
How to reproduce:
Run the ADCBuf example from the SDK, put a breakpoint down inside the callback function. After hitting the breakpoint, the callback will not be invoked again and the serial port will be silent. Stepping into the driver one can see it spins around the Hwi function.
Possible solution:
**Check for overflow/underflow events, and when needed, flush the ADC FIFOs before continuing, e.g:
/* Was there an ADC overflow? */
int32_t status = AUXADCGetFifoStatus();
if (status & AUXADC_FIFO_OVERFLOW_M)
Another option would be to abort with an error (but there is no good way of doing this as of today).