i.MXRT1060 LPSPI DMA_MUX Trigger Functionality

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

i.MXRT1060 LPSPI DMA_MUX Trigger Functionality

Jump to solution
246 Views
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 Kudos
1 Solution
219 Views
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

 

View solution in original post

0 Kudos
1 Reply
220 Views
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 Kudos