LPUART_DRV_ReceiveDataBlocking: strange behaviour

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPUART_DRV_ReceiveDataBlocking: strange behaviour

1,333 Views
rolandzitzke
Contributor II

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

Labels (1)
0 Kudos
3 Replies

874 Views
adriancano
NXP Employee
NXP Employee

Hi,

Can you please share which device and IDE you are using?

Regards,

Adrian

0 Kudos

874 Views
rolandzitzke
Contributor II

Hi, I am using the MKL03Z32FG4 device with the KSDK_1.0.0-KL03Z SDK.

I created the project with Kinetis Design Studio KDS_1.1.1

I used Processor Expert to initialize the component and to select the LPUART SDK high level driver.

TIA, Roland

0 Kudos

874 Views
adriancano
NXP Employee
NXP Employee

Hi Roland,

You may find useful this threads:

Re: Re: Re: UART problem with FRDMKL03 (with KDSK + PE + FreeRTOS)

KL03: PE code generated for high level SDK LPUART component not working


Hope this information can help you.

Best Regards,
Adrian Sanchez Cano
Technical Support Engineer
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos