LINFLEXD_UART_DRV_ReceiveData(INST_LINFLEXD_UART3, OBD_Rxbuffer, 1U);
/* Wait for transfer to be completed */
while(LINFLEXD_UART_DRV_GetReceiveStatus(INST_LINFLEXD_UART3, &bytesRemaining) == STATUS_BUSY);
UART is configured to enable transmission between OBD chip and microcontroller. Even after receiving the data in the buffer, it is waiting for reception to complete and the status is busy.
Kindly help me, to find out how to come out of the while loop.
Hi,
after receiving single byte it should pass while loop.
Maybe you can refer to uart_pal_mpc5748g example. It continuously stores received bytes into wide buffer until it is full or special character is received.
RX callback is used and SetRxBuffer function is called to update buffer for continuous reception.
BR, Petr
Hi,
In this i am using LINFlexD module.
check the line number 84, in that loop ,Always it is waiting for reception to complete and the status is busy.
Kindly help me, to find out how to come out of the while loop.
Hi,
seems you are using rx callback as well, so did you enter OBDRxCallback when character is received?
I guess so as you wrote buffer is updated.
Do you use SetRxBuffer function in your code to update buffer for continuous reception? If yes simply do not call it again when you want to stop continuous reception. Refer to uart_pal example.
BR, Petr
Hi,
As you said , I have removed the SetRxBuffer function in callback function and placed before the 84 th line then it is not stucking in the while loop and it is transmitting continuously.
BUT the problem is, In the OBD_Rxbuffer I am not getting the data .
Then, I have modifed the SetRxBuffer size 1U to sizeof(OBD_Rxbuffer).
LINFLEXD_UART_DRV_SetRxBuffer(INST_LINFLEXD_UART3, &OBD_Rxbuffer[OBD_RxbufferIdx], sizeof(OBD_Rxbuffer));
Then , it is transmitting only one time and that one I am getting data in the OBD_Rxbuffer.
so what are the changes I have to made , to transmit continuously and I want data in the OBD_Rxbuffer.
kindly help me in this regard,
Polisetty Akhil.
Hi,
not sure how OBD data should be handled. If you want to receive data continuously you can do it in similar manner as is in uart_pal example, that is byte by byte reception. In callback you can determine if another byte should be received or not, SetRxBuffer is used to update buffer and so continuous reception is done. if not called reception is stopped. While loop can be changed to "if" statement, if you do not want to stop there. LINFLEXD_UART_DRV_ReceiveData is called to start new reception.
BR, Petr
Hi,
I have implemented what you said,
Now it is showing STATUS_UART_FRAMING_ERROR While I am receiving data form the OBD and it will display in the UART.
How to solve that problem ?
Hi,
looks similar like this
https://community.nxp.com/t5/MPC5xxx/UART-showing-framing-error-while-receiving-response-from-stn210...
BR, Petr