RM0090
was stored internally when the overrun condition was detected, and this, to avoid data slot
de-alignment in the destination memory (refer to
The OVRUDR flag is cleared when bit COVRUDR is set in the SAI_xCLRFR register.
data
FIFO full
OVRUDR
Underrun
An underrun may occur when the audio block in the SAI is a transmitter and the FIFO is
empty when data needs to be transmitted (the audio block configuration (Master or Slave) is
not relevant). If an underrun is detected, the software must resynchronize data and slot.
Proceed as follows:
1.
Disable the SAI peripheral by resetting the SAIEN bit of the SAI_xCR1 register. Check
that the SAI has been disabled by reading back the SAIEN bit (SAIEN should be equal
to 0).
2.
Flush the Tx FIFO through the FFLUS bit of the SAI_xCR2 register.
3.
Re-assigned to the correct data to be transferred on the first active slot of the new
frame.
4.
Re-enabling the SAI peripheral (SAIEN bit set to 1).
The underrun event sets the OVRUDR flag in the SAI_xSR register and an interrupt is
generated if the OVRUDRIE bit is set in the SAI_xIM register. To clear this flag, set the
COVRUDR bit in the SAI_xCLRFR register.
Figure 294. Overrun detection error
Audio frame
sck
Slot 0 ON
Slot 1 ON Slot 1 ON Slot 0 ON
Figure
Example: FIFO overrun on Slot 1
Received data discarded
RM0090 Rev 18
Serial audio interface (SAI)
294).
Audio frame
Slot 1 ON
... ON
Data stored again in FIFO
COVRUDR = 1
Slot n ON
MS192348V2
945/1749
964
Need help?
Do you have a question about the STM32F405 and is the answer not in the manual?
Questions and answers