LPUART DMA + IDLE Interrupt isue

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPUART DMA + IDLE Interrupt isue

1,027 次查看
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 项奖励
6 回复数

1,006 次查看
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 项奖励

983 次查看
kalvin
Contributor I

hi Peter,

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

0 项奖励

964 次查看
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 项奖励

938 次查看
kalvin
Contributor I

Hi Peter,

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

0 项奖励

960 次查看
kalvin
Contributor I

Hi Peter,

Please check the private message.

0 项奖励

1,004 次查看
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 项奖励