DSPI Slave Mode with DMA in S32DS with NXP5744P

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

DSPI Slave Mode with DMA in S32DS with NXP5744P

613 Views
pierre_theron
Contributor III

Hi

I am using DSPI slave mode with the drivers supplied with S32DS. The problem I have is that it takes quite long to set up the Slave transfer when DMA is used. I optimized the driver for my use as I am only using receive and not transmit, and disabled setting up of the DMA transmit channel using the EDMA_DRV_ConfigMultiBlockTransfer() and EDMA_DRV_StartChannel() . I also install the receive callback function during initialization as this is always the same function. This is all working. I tried to optimize the driver further by configuring the source and destination addresses for the DMA channels during initialization, but the SPI stops working after if I don't initialize the source and destination addresses in the EDMA_DRV_ConfigSingleBlockTransfer() function. The micro gets an Assert if I do this. The source and destination buffers never change, to me it does not make sense to have to set up the DMA for every SPI transfer. The driver clears all the DMA register for the channel and set it up again for every SPI transfer. Is there a way where I can set up the DMA channel only once and initiate an SPI transfer by just starting the DMA channel and the starting the SPI transfer? All the examples I looked at set up the DMA and then does only 1 transfer. I need to do periodic transfers with minimal setup when initiating the transfer.

Regards,

Pierre

Labels (1)
0 Kudos
1 Reply

549 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Pierre,

SDK drivers are always about a compromise - it's user friendly and there's an advantage of graphical user interface for configuration but there's relatively high software overhead and the drivers will never cover 100% of features.

If you configure the DMA directly, you will be able to perform desired operations without software intervention. DMA is very powerful tool which allows a lot of tricks. But that's possible either in bare board project without SDK or by changing of SDK code - which is not supported by us.

To answer your question - I can't see clear way how to do such optimization using original SDK functions.

Regards,

Lukas

0 Kudos