2021-06-23 03:22 AM
I am continuously calling HAL_UART_Receive_IT(), until i get some specified value in receiver buffer. But after some time HAL_UART_Receive_IT() return BUSY and after that it is not receiving any further interrupts and seems like the code is dead.
How can i get out of from BUSY state and receive further interrupts.
Please help me..
Thanks,
Jestina
2021-06-25 10:11 PM
Awesome! I'm glad I was able to help out.
2022-06-02 10:24 AM
For those who encountered a similar issues where HAL_UART_Receive_IT returns HAL_BUSY (without spending too much time in interrupt), I have following findings. My code uses the HAL_UART_Receive_IT() and in a main loop (not under interrupt) I write some data to the same UART using HAL_UART_Transmit() each time I receive something on the UART. Increasing the data throughput on transmit side, increases the probability to run into a HAL_BUSY state on HAL_UART_Receive_IT(). Reason for this is that HAL_UART_Transmit() uses a LOCK mechanism to setup some parameters. When an incoming byte is received when this LOCK is set, HAL_UART_Receive_IT will return HAL_BUSY, hence reception will stop. To avoid this you can write "myHAL_UART_Transmit()", which is a copy from HAL_UART_Transmit(), and remove the LOCK mechanisme.