SAI3 & EDMA on IMXRT1010

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SAI3 & EDMA on IMXRT1010

Jump to solution
1,037 Views
Syam_Krishnan
Contributor II
Hello,
I am trying to bring up SAI3 & EDMA on an IMXRT1010 custom board. To start with, I am using evkmimxrt1010_sai_edma_transfer example on IMXRT1010 EVK. I was able to run the demo with SAI 1. I can hear the stored tone. To check SAI3, I edited the code in evkmimxrt1010_sai_edma_transfer. I changed references of SAI1 to SAI3. The lines that I had edited are
 
Line 26,28, 29 in sai_edma_transfer.c : Changed references of macros from SAI1 to SAI3
41,43, 45 in sai_edma_transfer.c : Changed references of macros from SAI1 to SAI3
61 in sai_edma_tranfer.c : Changed references of macros from SAI1 to SAI3
138 & 142 : Changed references of MCLK output from SAI1 to SAI3
191, 192 & 193: Clock settings changed from SAI1 to SAI3
 
I am aware that the codec will not work in this case. However, I wanted to see the data transfer, with SAI3 taking in the data and completing the transfer. The code comiled and executed. However, the code gets stuck with 'kStatus_SAI_QueueFull' status message after 4 iterations. The MCU is not reaching the ISR for DMA. Code is not reaching  
WEAK void DMA0_IRQHandler(void)
{   DMA0_DriverIRQHandler();
}
in startup_mimxrt1011.c 
 
I had checked if the clock settings, NVIC settings ,  DMA settings & SAI3 settings are as per my understanding. I am unable to see anything amiss
 
CCM_CSCMR1: SAI3_CLK_SEL->SAI3_CLK_SEL_2
 
CCM_CS1CDR: SAI3_CLK_PRED->SAI3_CLK_PRED_3
 
TCD0_DADDR 0x401e8020 //this corresponds to the SAI3 TX register address.
TCR3 0x00010000 //this corresponds to the SAI3 TX en
 
I had spent ~ 2 days and i have ran out of possible solutions. Any leads on this will be highly helpful.
Attached is my modified sai_edma_transfer.c file. 
 
Thanks
Syam k
 
 
0 Kudos
Reply
1 Solution
1,020 Views
Syam_Krishnan
Contributor II

The catch was #define DEMO_SAI_MASTER_SLAVE kSAI_Slave defined in sai_edma_transfer.c  . With WM8960 Codec, the codec makes the BCLK and SAI accepts the clock. When i moved from SAI1 to SAI3, there is no BCLK to drive the SAI. When SAI3 was configured as master, I could see SAI3 taking in data and DMA generating interrupts. Now I will try this code in my custom board with TAS2780. 

View solution in original post

0 Kudos
Reply
1 Reply
1,021 Views
Syam_Krishnan
Contributor II

The catch was #define DEMO_SAI_MASTER_SLAVE kSAI_Slave defined in sai_edma_transfer.c  . With WM8960 Codec, the codec makes the BCLK and SAI accepts the clock. When i moved from SAI1 to SAI3, there is no BCLK to drive the SAI. When SAI3 was configured as master, I could see SAI3 taking in data and DMA generating interrupts. Now I will try this code in my custom board with TAS2780. 

0 Kudos
Reply