AnsweredAssumed Answered

How can I configure multi-channel SAI using edma?

Question asked by Henrique Nogueira on Jul 10, 2019
Latest reply on Jul 12, 2019 by Henrique Nogueira

Hi!X

 

I'm trying to configure an imx RT1020 board to do an audio transfer from 1 input to 2 outputs. All lines are mapped to SAI1 and I'm using channel 0 for RX and channels 1 and 2 for TX.

 

I've been trying for some time now to use the SDK sai_edma workflow, based on the evkmimxrt1020_sai_edma_transfer example. I can successfully setup 1 channel in and 1 channel out, however things get more complicated when I try to include the second TX channel. It appears that the SDK isn't designed for multi-channel SAI edma transfers (e.g. in the function SAI_TransferTxCreateHandleEDMA there's a private handle (s_edmaPrivateHandle) that's used for each TX handle, so I shouldn't really be using 2 different handles. And if I try to manually change the handle.channel  value before calling SAI_TransferSendEDMA, I get weird behaviours in the outputs).

 

My guess is that I can't use a single edma handler for both channels, since each edma handler is naturally assigned to a dma channel.

 

My question is: is there a correct way to setup the SAI edma for multi-channel usage using the SDK or do I need to go around it?

 

Thank you for your time!

 

Henrique

Outcomes