LPUART_DRV_CompleteReceiveDataUsingInt is not called.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPUART_DRV_CompleteReceiveDataUsingInt is not called.

ソリューションへジャンプ
1,101件の閲覧回数
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,068件の閲覧回数
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,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 件の賞賛
返信
1,060件の閲覧回数
HyunungPark
Contributor III

Hi Robin.

This issue is resolved.

Thank you for your support.

BRs.

Hyunung Park

0 件の賞賛
返信
1,084件の閲覧回数
HyunungPark
Contributor III

Hi

I currently use s32k144 chip.

I don't understand the response which you send me 

BRs

Hyunung Park

0 件の賞賛
返信