Issue UART_RETRY_TIMES

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

Issue UART_RETRY_TIMES

1,628 Views
Transidico
Contributor III

Good evening,

I am using LPUART1 in LPUART_WriteBlocking and LPUART_ReadBlocking mode. I need it to exit the wait mode if my UART does not receive anything within a certain number of seconds. I have noticed that there is a parameter called UART_RETRY_TIMES that can be used to set a timeout. However, when I set this parameter, I notice that a timeout is not set, but the UART no longer works correctly. Could you tell me how I can exit blocking mode with a timeout?

Thank you.

Best regards

 

0 Kudos
Reply
3 Replies

1,573 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @Transidico 

May I ask which chip you are using?

BR

Harry

0 Kudos
Reply

1,561 Views
Transidico
Contributor III

Hi Harry,

thanks for reply. The chip that i use is MCXC242.

Do you have some suggestions?

Thanks in advice.

 

Best regards

0 Kudos
Reply

1,546 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @Transidico 

LPUART_ReadBlocking() and WriteBlocking() of MCXC242 do not support timeout exit.
UART_RETRY_TIMES is only used internally for the 'retry check flag' and is not a timeout mechanism.
If you want UART to exit blocking after a few seconds of no data, I think you can use LPUART_ReadBlocking combined with a software timer.

BR

Harry

0 Kudos
Reply