LPUART DMA + IDLE Interrupt isue

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

LPUART DMA + IDLE Interrupt isue

1,769 Views
kalvin
Contributor I

Now I have another problem, this is my modified demo implementation of LPUART DMA + IDLE Interrupt, the following is the problem:

kalvin_0-1668755090540.png

 

 

0 Kudos
Reply
6 Replies

1,748 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

which demo do you refer to? If DMA is updating your buffer with less bytes comparing previous transfer, a not overwritten bytes will be kept. You can clear buffer after reading it.

BR, Petr  

0 Kudos
Reply

1,725 Views
kalvin
Contributor I

hi Peter,

I just send you a private message, please check your message box.

0 Kudos
Reply

1,706 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I read that, but not sure what is the intention, rather send full project and describe desired functionality and present behavior (what is sent, received and what is desired result).

BR, Petr

0 Kudos
Reply

1,680 Views
kalvin
Contributor I

Hi Peter,

How's it going now that I sent you a private message the other day 

0 Kudos
Reply

1,702 Views
kalvin
Contributor I

Hi Peter,

Please check the private message.

0 Kudos
Reply

1,746 Views
kalvin
Contributor I

I don't know where to clear the rx buffer.

Reference:

/* Handle idle line interrupt */
if (LPUART_GetIntMode(base, LPUART_INT_IDLE_LINE))
{
if (LPUART_GetStatusFlag(base, LPUART_IDLE_LINE_DETECT))
{
lpuart_state_t * lpuartState = (lpuart_state_t *)s_lpuartStatePtr[instance];
lpuartState->rxCallback(lpuartState, UART_EVENT_RX_FULL, lpuartState->rxCallbackParam);
if (lpuartState->rxSize > 0U)
{
/* Set the source address and the number of minor loops (bytes to be transfered) */
EDMA_DRV_SetDestAddr(lpuartState->rxDMAChannel, (uint32_t)(lpuartState->rxBuff));
EDMA_DRV_SetMajorLoopIterationCount(lpuartState->rxDMAChannel, lpuartState->rxSize);

/* Now that this rx is set up, clear remaining bytes count */
lpuartState->rxSize = 0U;

/* Re-start the channel */
(void)EDMA_DRV_StartChannel(lpuartState->rxDMAChannel);
}
else
{
/* Stop the reception */
LPUART_DRV_StopRxDma(instance);

/* Invoke the callback to notify the end of the transfer */
if (lpuartState->rxCallback != NULL)
{
lpuartState->rxCallback(lpuartState, UART_EVENT_END_TRANSFER, lpuartState->rxCallbackParam);
}

/* Clear the flags */
LPUART_DRV_ClearErrorFlags(base);
}
LPUART_ClearStatusFlag(base, LPUART_IDLE_LINE_DETECT);
}
}

0 Kudos
Reply