AnsweredAssumed Answered

LPUART_DRV_ReceiveDataBlocking: strange behaviour

Question asked by Roland Zitzke on Dec 5, 2014
Latest reply on Dec 16, 2014 by Adrian Cano

Hi, I have a simple task of sending a byte to a remote device and waiting for a one byte answer.

So, for receiving data i use (code simplified to the bare minimum)

The rx line of my UART is totally disconnected so I should not receive anything but get timeouts.

 

uint8_t dummyByte;

lpuart_status_t status;

status = LPUART_DRV_ReceiveDataBlocking(FSL_LPUARTCOM1,&dummyByte, 1, 20);

// Now status shows timeout as expected on a disconnected UART

 

status = LPUART_DRV_AbortReceivingData(FSL_LPUARTCOM1);

// status is now 0 (success) as expected

 

status = LPUART_DRV_ReceiveDataBlocking(FSL_LPUARTCOM1,&dummyByte, 1, 20);

// Status is now 0 - successful again, why???

By the way, transmitting data works just fine.

 

For this code I would expect both receives to fail with a timeout.

If I omit the

status = LPUART_DRV_AbortReceivingData(FSL_LPUARTCOM1);

call then all subsequent invocations of the receive function return a BUSY status.

 

Any hints or solutions/

TIA, Roland

Outcomes