Restart SPI DMA Transmit without Reconfiguration

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

Restart SPI DMA Transmit without Reconfiguration

404 Views
ygtcbs
Contributor I

Hi, I'm developing a project with S32K116 and using NXP SDK version 4.0.1.

I want to send 16 bit data with FLEXIO SPI. But with the FLEXIO_SPI_DRV_MasterTransfer function it takes a very long time. The function takes around 20-30us in polling and interrupt mode(I'm using 48MHz HIRC).

But in the project, I need to do this as soon as possible. That's why I decided to use DMA. But the FLEXIO_SPI_DRV_MasterTransfer function takes 150us in DMA Mode. because it reconfigures DMA in every call. I moved the configuration to a separate function (includes EDMA_DRV_ConfigMultiBlockTransfer functions). I call EDMA_DRV_StartChannel and FLEXIO_SetShifterDMARequest to start communication in the loop, and call EDMA_DRV_StopChannel and FLEXIO_SetShifterDMARequest functions in FLEXIO_SPI_DRV_MasterEndDmaTransfer to stop communication. I don't disable or clear FLEXIO Shifters (do I need to?).

But I could not communicate in this way. Do you have a suggestion to shorten the transmit time? Or can you share a documentation or sample code link just for my use case of DMA?

0 Kudos
Reply
1 Reply

364 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @ygtcbs 

A truly apology for the late response.
There are some examples related to the DMA, SPI and FLEXIO included in the S32K1xx SDK RTM v4.0.1.

...\nxp\S32_SDK_S32K1xx_RTM_4.0.1\examples\S32K116\driver_examples\communication

VaneB_0-1669745639414.png

The example documentation can be found in the S32 SDK documentation at Examples and Demos section. 

...\nxp\S32_SDK_S32K1xx_RTM_4.0.1\doc\Start_Here.html

 

B.R.

VaneB

 

0 Kudos
Reply