On our KL27 device we have observed that SAI receive transfers will put the SAI peripheral in a certain state that it will not be able to transmit anymore.
We have to functions, play() and record() which make repeated calls to SAI_TransferSendDMA() and SAI_TransferReceiveDMA() respectively.
We are able to call play() repeatedly, and the audio is transferred to the codec.
We are able to call record() repeatedly, and the audio is received from the codec.
We are able to call record() after play(), but a play() following a record will not work. No DMA callbacks are invoked, and the FIFO Error Flag (
I2S0_TCSR:FEF) is set before initiating the transmission and cannot be cleared.
In our configuration TX is in Async mode, and RX is in Sync mode, which is the default configuration for that driver.
We have seen other similar discussions on the forums regarding SAI problems. One of them recommended clearing the FIFO error flag before every enable operation, but that did not solve the issue.
Any suggestions on how to resolve this issue would be gladly appreciated.