Hi All,
We need to use DMA for LPUART in S32K324. There are no examples for this.
We are not getting how can we make Transfer configuration, And in Interrupt handler they are not checking the Status of Interrupts, simply calling the handlers with events.
There is no separate callbacks for LPUART0 and LPUART1. The Callback has to shared b/w the Instances also.
Let me know how can we manage these.
Thanks in advance..!
Regards,
Harish G
#s32k324 #s32k3xx #lpuart #dma
@danielmartynek @Dinesh_Guleria It seems that the discussion is ongoing and hasn't reached a conclusion yet. I am also currently facing similar challenge and would appreciate some assistance from your end. Please help me understand how to identify data reception and suggest the appropriate callback to use, along with when it will be triggered?
Hi @Dinesh_Guleria,
I understand that you are working on this.
Can you update the thread?
BR, Daniel
I have already shared the UART code using DMA.
hen interrupt used UART status register is read :--
When using The interrupt mode, LPUART status read is done in this sequence in ISR code of UART :---
ISR(LPUART_UART_IP_0_IRQHandler) ---> Lpuart_Uart_Ip_IrqHandler() --> Lpuart_Uart_Ip_ErrIrqHandler() --> Lpuart_Uart_Ip_GetStatusFlag()
Lpuart_Uart_Ip_GetStatusFlag() read the UART STAT register to get following error of UART:--
LPUART_UART_IP_STATUS_TIMEOUT
LPUART_UART_IP_STATUS_TX_UNDERRUN
LPUART_UART_IP_STATUS_RX_OVERRUN
LPUART_UART_IP_STATUS_ABORTED
LPUART_UART_IP_STATUS_FRAMING_ERROR
LPUART_UART_IP_STATUS_PARITY_ERROR
LPUART_UART_IP_STATUS_NOISE_ERROR
LPUART_UART_IP_STATUS_DMA_ERROR
When DMA used for UART where in code UART status register is read, following is DMA handler flow code:--
ISR(Dma0_Ch16_IRQHandler) ---> IrqHandler(3U, 0U, 16U) ---> Dma_Ip_ErrorIrqHandler() or Dma_Ip_IntIrqHandler() is callled
Dma_Ip_IntIrqHandler() -----> LocChState->LogicChId->IntCallback() which is this function : Lpuart_6_Uart_Ip_DmaRxCompleteCallback(void)--> Lpuart_Uart_Ip_CompleteReceiveUsingDma(6);
Dma_Ip_ErrorIrqHandler() -----> LocChState->LogicChId->ErrIntCallback();
@danielmartynek
I am not able to get when DMA is used in that case where we are reading the UART status register ? Please can you suggest on it ?
Regards,
Dinesh
Client is asking when they Enable DMA with UART & do async receive :--
Lpuart_Uart_Ip_AsyncReceive(UART_LPUART_INTERNAL_CHANNEL, (uint8_t*)rx_data, 50);
Only way we can check the recived bytes:--
Lpuart_Uart_Ip_GetTransmitStatus(UART_LPUART_INTERNAL_CHANNEL, &remainingBytes);
if i am correct DMA will call the UART callback once all the data is received, right ?
Is there any other way to get an notification ? :--
Buffer is half full
Also If i am correct then UART will trigger the DMA on every correct reception of data, if some error is there in reception of data on UART DMA will not be rigged, right ?
If UART is configured to receive using DMA, and i call this function Lpuart_Uart_Ip_AsyncReceive() to receive the 50 bytes on UART, when will first time this DMA IRQ will be called, on first byte of reception on UART or when all the 50 bytes are received :--
Dma0_Ch0_IRQHandler()