SPI + DMA

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

SPI + DMA

501 Views
JackChen2022
Contributor I

Currently, the s23k146 chip is used, and the compilers are S32 Design Studio for ARM Version 2018.R1 and S32SDK_S32K1xx_RTM_3.0.0. The hope is that SPI sends multiple packets of data, but only needs to trigger one DMA transfer at the end, and SPI receives all the data, reducing interruptions and CPU resources. Implementation of a single event trigger DMA read multi - byte SPI data.

0 Kudos
4 Replies

477 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi JackChen2022,

Would you please refer to the lpspi_dma_s32k144 example in S32SDK_S32K1xx_RTM_3.0.0?

LPSPI DMA S32SDK_S32K1xx_RTM_3.0.0.png

Best Regards,
Robin

0 Kudos

449 Views
JackChen2022
Contributor I

I'm very sorry, but I have another question to consult. How is DMA's periodic trigger pattern implemented, and can you provide sample code.for dmaController1Chn0_Config.enableTrigger = true.

0 Kudos

463 Views
JackChen2022
Contributor I

I've looked at the corresponding demo, but it doesn't help. The functionality I want to implement now is that SPI sends data every 1.3ms, 20 times; Via TX_DMA; Normally I should receive 20 packets of corresponding data, SPI_RX completion interrupt will trigger 20 times. At present, we do not want to trigger DMA receiving for the first 19 times of data. After the last 20 times of data sending is completed, the 20 times of data will be received once again, reducing the number of interruptions and corresponding CPU consumption. Whether this function can be implemented or provide the following ideas and routines.

0 Kudos

429 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

There is a non-SDK example that appears to implement similar functionality: Example S32K144 LPIT DMA LPSPI

Unfortunately, no SDK-based samples were found. You may need to read the Integration guideline of EDMA DriverEDMA_DRV_SetChannelRequestAndTrigger Configures the periodic trigger capability for the triggered DMA channel.

0 Kudos