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
Solved! Go to Solution.
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.
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.
-------------------------------------------------------------------------------
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.
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.
-------------------------------------------------------------------------------
Hi Robin.
This issue is resolved.
Thank you for your support.
BRs.
Hyunung Park
Hi
I currently use s32k144 chip.
I don't understand the response which you send me
BRs
Hyunung Park