i.MXRT1060 LPSPI DMA_MUX Trigger Functionality

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

i.MXRT1060 LPSPI DMA_MUX Trigger Functionality

跳至解决方案
263 次查看
Aditya_Jadoun
Contributor I

My requirement is to send and receive some data of around 500 bytes with LPSPI in loop infinitely at fixed interval of 10ms, while performing other activities. As I am doing other activities as well in the code, I want minimum intervention of CPU for SPI transfer, So I am using it with EDMA.
I am using iMXRT1060 EVK with MCU Expresso IDE and "lpspi_edma_b2b_transfer_master" example code of MCU SDK.

I have some queries:

  1. Is It possible that DMA trigger and send/receive data itself over LPSPI infinitely without doing anything from code?

  2. I have gone through the RT reference manual EDMA section and understand that I can achieve my requirement using Channel linking (Chaining mechanism). Is my understanding is correct? If yes, Is there any reference document or sample code for the same?

  3. Is there any other method for achieving the same? Is DMAMUX Periodic trigger Mode can be used for this? If yes, Can I get some reference document or sample code for the same?

0 项奖励
1 解答
236 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @Aditya_Jadoun,

1. Yes. Of course, the initial configuration of the DMA has to be set up in order to enable the DMA, so there must be code to do this initialization. But once the initial configuration was set to "Always-enabled", no CPU intervention is needed. You can find more information about this mode on section "5.3.3 Always-enabled DMA sources" of the Reference Manual.

2. Yes, channel linking allows one channel to kickstart the process of another channel or restart its own process, allowing you you to generate looping DMA transfers. An example code for channel linking can be found on the MIMXRT1060-EVKB SDK, which can be downloaded from the SDK builder.

3. The Periodic Trigger mode can also be used for this, but it would require the use of a PIT as stated on section "5.3.1 Modes of operation" of the Reference Manual. Unfortunately we do not have an code in our SDK that exemplifies this mode, but this other community post might be useful for you for setup of this mode of operation: https://community.nxp.com/t5/i-MX-RT/Getting-PIT-to-trigger-SPI-DMA-transmit-to-a-DAC-i-mxrt-1060/td...

BR,
Edwin

 

在原帖中查看解决方案

0 项奖励
1 回复
237 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @Aditya_Jadoun,

1. Yes. Of course, the initial configuration of the DMA has to be set up in order to enable the DMA, so there must be code to do this initialization. But once the initial configuration was set to "Always-enabled", no CPU intervention is needed. You can find more information about this mode on section "5.3.3 Always-enabled DMA sources" of the Reference Manual.

2. Yes, channel linking allows one channel to kickstart the process of another channel or restart its own process, allowing you you to generate looping DMA transfers. An example code for channel linking can be found on the MIMXRT1060-EVKB SDK, which can be downloaded from the SDK builder.

3. The Periodic Trigger mode can also be used for this, but it would require the use of a PIT as stated on section "5.3.1 Modes of operation" of the Reference Manual. Unfortunately we do not have an code in our SDK that exemplifies this mode, but this other community post might be useful for you for setup of this mode of operation: https://community.nxp.com/t5/i-MX-RT/Getting-PIT-to-trigger-SPI-DMA-transmit-to-a-DAC-i-mxrt-1060/td...

BR,
Edwin

 

0 项奖励