Feeding the next buffer to SAI DMA
Sorry if this has been answered elsewhere, but I'm not seeing it. For background, I do a lot of work with Nordic, and in their I2S implementation, you feed two buffers to the peripheral, then every time a buffer has been transmitted/received, it switches over to transmit/receive the second buffer automatically while you point it to the buffer to use when that one is done (usually the one that just got freed). In this way you never miss any data.
I'm currently trying to implement an I2S receiver using SAI on an STM32L476. I get the data via SAI in DMA mode fine, but then I have to kick off another DMA receive (HAL_SAI_Receive_DMA) when I get the interrupt from the previous one. My sampling clock is running around 3MHz, which doesn't leave much time to point the next buffer to the SAI. So my question is, is there a standard way of handling this? How do other people guarantee that the SAI DMA will have a pointer to the next buffer when it is done the current transfer? Do you somehow leverage the FIFO as well since you presumably have eight words worth of time to start a new receive? What happens if you have a few other interrupts to service in the meantime?
