Hello,
Please help me.
I am using the DMA interrupt for I2S communication with the RT595. However, when I read the data transferred by the RX DMA interrupt, sometimes it has not been updated yet. If I wait a little and try again, the data is updated.
What is the trigger for the interrupt? Is it not triggered by the completion of transferring the specified amount of data from the FIFO to memory?
Also, even if I reconfigure I2S and DMA, the XFERCOUNT in the XFERCFG does not appear to be reinitialized.
Is there no way to reset it?
Dear @Gavin_Jia
Referring to
SDK_2_15_000_EVK-MIMXRT595\boards\evkmimxrt595\driver_examples\i2s\dma_record_playback
from the SDK, I tried using I2S_TxTransferSendDMA() and I2S_RxTransferReceiveDMA() while setting the following within the interrupt handler:
s_TxTransfer.data
s_TxTransfer.dataSize
s_RxTransfer.data
s_RxTransfer.dataSize
So far, no issues have occurred.
Is there a problem with the functions:
I2S_TransferInstallLoopDMADescriptorMemory()
I2S_TransferInstallLoopDMADescriptorMemory()
I2S_TransferSendLoopDMA()
I2S_TransferReceiveLoopDMA()
Or is it simply incorrect usage?
Best regards
Hi,
Glad to hear that you got the example in the SDK to run successfully. In the examples of the SDK, only simple double buffered DMA transfers are used. For the usage you want it is recommended to refer to this thread: https://community.nxp.com/t5/MCUXpresso-SDK/Purpose-of-I2S-TransferSendLoopDMA-and-I2S/td-p/1911687
Although the I2S driver does not use a similar approach, you can port it yourself using the routine under DMA examples.
Best regards,
Gavin
Hi @adc_6_6 ,
Thanks for your interest in NXP MIMXRT series!
1. Your understanding is correct. However, the phenomenon you describe may be due to some problem with the logic in the IRQ, can you test it using the example in the SDK?
2. It is recommended to try the I2S_TransferAbortDMA function, as XFERCOUNT is a hardware auto-managed value.
Best regards,
Gavin
Dear Gavin_Jia
Thank you for your reply.
The processing differs from the example provided in the SDK, so I cannot confirm the occurrence of the same phenomenon.
I am using the following functions:
I2S_TransferInstallLoopDMADescriptorMemory()
I2S_TransferInstallLoopDMADescriptorMemory()
I2S_TransferSendLoopDMA()
I2S_TransferReceiveLoopDMA()
Therefore, I will try referencing the dma_record_playback example in the SDK.
Additionally, I have already used the I2S_TransferAbortDMA function.
Best regards