Hello,
I reported this before here, but since it hasn't been fixed in the latest SDK, I wanted to report it again.
Chip: i.MXRT with multi-channel SAI port
SDK version: SDK_2_12_1_EVK-MIMXRT1060.zip
fsl_sai_edma.h version: 2.5.0
The problems:
There are three separate problems:
1) the TCE field of TCR3 is currently being set to 1 << handle->channel, which only works for single channel operation. it needs to be set to handle->channelMask
2) the RCE field of RCR3 must be set to handle->channelMask, same as #1
3) in the RxSetConfig, saiConfig->fifo.fifoCombine *must* be set to 0b10 or 0b11, however, the enums for kSAI_FifoCombineModeEnabledOnRead is incorrect for the SAI4 RCR FCOMB, it is only correct for SAI1 TCR4 FCOMB. So, you need to change the assert statement to be kSAI_FifoCombineModeEnabledOnWrite instead of kSAI_FifoCombineModeEnabledOnRead, for the RCR4 assert.


The mode we want on TCR4 is mode 0b10, and the mode we want on RCR4 is mode 0b10. So, we *always* want 0b10.
However, the enum is defined like this, which is correct ONLY for TCR4 mode.
typedef enum _sai_fifo_combine
{
kSAI_FifoCombineDisabled = 0U, /*!< sai fifo combine mode disabled */
kSAI_FifoCombineModeEnabledOnRead, /*!< sai fifo combine mode enabled on FIFO reads */
kSAI_FifoCombineModeEnabledOnWrite, /*!< sai fifo combine mode enabled on FIFO write */
kSAI_FifoCombineModeEnabledOnReadWrite, /*!< sai fifo combined mode enabled on FIFO read/writes */
} sai_fifo_combine_t;
So, we must change the fsl_sai_edma.c with the following change:
***************
*** 439,441 ****
(saiConfig->channelNums <= 1U) ||
! ((saiConfig->channelNums > 1U) && ((saiConfig->fifo.fifoCombine == kSAI_FifoCombineModeEnabledOnWrite) || (saiConfig->fifo.fifoCombine == kSAI_FifoCombineModeEnabledOnReadWrite))));
--- 439,441 ----
(saiConfig->channelNums <= 1U) ||
! ((saiConfig->channelNums > 1U) && ((saiConfig->fifo.fifoCombine == kSAI_FifoCombineModeEnabledOnRead) || (saiConfig->fifo.fifoCombine == kSAI_FifoCombineModeEnabledOnReadWrite))));
I have included a patch that fixes the issues.