AnsweredAssumed Answered

LPUART - eDMA configuration

Question asked by Igol Logi on Jun 25, 2018
Latest reply on Jun 28, 2018 by Vlad Lionte

Hi, I'm working with the S32K144 evaluation board but I'm having some trouble using LPUART and eDMA modules. I want to implement something like that:

  1. LPUART receives a message
  2. eDMA transfers this message from LPUART peripheral to memory
  3. Step 1 and 2 are repeated for an established number of messages
  4. Once the last UART message has been moved to memory by the DMA, a callback function is called

I'm using the drivers provided by the S32K14x EAR 0.8.6 SDK. I generated all the code (processor code) for both eDMA and LPUART with the right configuration:

  • LPUART1 activated (which is connected to the OpenSDA USB interface permitting me to send messages from the PC)
  • LPUART1 transfer type = DMA
  • RX DMA channel and TX DMA channel are set
  • all peripherals are clocked

After eDMA and LPUART initialization, I call the function LPUART_ReceiveData provoking the following function call:

  • LPUART_DRV_StartSendDataUsingDma <-- so I'm using the DMA transfer
  • EDMA_DRV_ConfigMultiBlockTransfer <-- problem: it configures the number of block to 1 
  • EDMA_DRV_InstallCallback <-- this callback is called when the last block is transferred (This function would call also your LPUART end transfer callback, if you have installed it)
  • EDMA_DRV_StartChannel
  • LPUART_SetTxDmaCmd

 

So my questions are:

  1. I thought that LPUART_ReceiveData could be used to receive more than 1 block (i.e. UART message) before to call the callback function, but actually it seems able to accept only 1 block (i.e. 1 message) even if it activates the DMA transfer, loosing the only reason I have to use the DMA (I could use the normal interrupt if I can only transfer 1 byte). Is this true? If yes, there is any other function able to do that?
  2. If LPUART_ReceiveData can be used for this purpose (i.e. receive more than one message, transfer them in memory thanks to the DMA, call a callback function signaling the DMA transfer end) how do I have to install the callback function? Do I have to use driver function: LPUART_DRV_InstallRxCallback?

 

Thanks you all!

Bye.

Outcomes