LPUART_DRV_CompleteReceiveDataUsingInt is not called.

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

LPUART_DRV_CompleteReceiveDataUsingInt is not called.

跳至解决方案
1,102 次查看
HyunungPark
Contributor III

Hi.

I implement that the data send and receive through UART.

But there is an issue.

LPUART_DRV_CompleteReceiveDataUsingInt is not called after all data is received like the attached file.

below is the code which I implement.

but LPUART_DRV_GetReceiveStatus doesn't exits because LPUART_DRV_CompleteReceiveDataUsingInt is not called in the below code 

what do I resolve this issue?

==========================main=============================

LPUART_DRV_Init(INST_LPUART_1, &lpUartState2, &lpuart_2_InitConfig0);
/* Install the callback for rx events */
LPUART_DRV_InstallRxCallback(INST_LPUART_1, rxCallback, NULL);

while (1)
{

LPUART_DRV_ReceiveData(INST_LPUART_1, buffer, 1U);

/* Wait for transfer to be completed */
while(LPUART_DRV_GetReceiveStatus(INST_LPUART_1, &bytesRemaining) == STATUS_BUSY);

/* Check the status */
status = LPUART_DRV_GetReceiveStatus(INST_LPUART_1, &bytesRemaining);

}

========================api===============================

/* UART rx callback for continuous reception, byte by byte */
void rxCallback(void *driverState, uart_event_t event, void *userData)
{
/* Unused parameters */
(void)driverState;
(void)userData;

/* Check the event type */
if (event == UART_EVENT_RX_FULL)
{
/* The reception stops when newline is received or the buffer is full */
if ((buffer[bufferIdx] != '\n') && (bufferIdx != (BUFFER_SIZE - 2U)))
{
bufferIdx++;
/* Update the buffer index and the rx buffer */
LPUART_DRV_SetRxBuffer(INST_LPUART_1, &buffer[bufferIdx], 1U);
}
}else if(event == UART_EVENT_END_TRANSFER){

}
}

BRs.

Hyunung Park

0 项奖励
回复
1 解答
1,069 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Hyunung Park,

Did you change the value of BUFFER_SIZE according to your needs? Otherwise the LPUART_DRV_SetRxBuffer in rxCallback will trigger continuous reception without enter LPUART_DRV_CompleteReceiveDataUsingInt.

LPUART_DRV_SetRxBuffer.png

Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,070 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Hyunung Park,

Did you change the value of BUFFER_SIZE according to your needs? Otherwise the LPUART_DRV_SetRxBuffer in rxCallback will trigger continuous reception without enter LPUART_DRV_CompleteReceiveDataUsingInt.

LPUART_DRV_SetRxBuffer.png

Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复
1,061 次查看
HyunungPark
Contributor III

Hi Robin.

This issue is resolved.

Thank you for your support.

BRs.

Hyunung Park

0 项奖励
回复
1,085 次查看
HyunungPark
Contributor III

Hi

I currently use s32k144 chip.

I don't understand the response which you send me 

BRs

Hyunung Park

0 项奖励
回复