2022-09-04 10:50 PM
Hi,
I'm using the UART functionality in NUCLEO-H745ZI-Q board. I want to transmit with UART polling and receive with interrupt. Every time I am able to transmit the characters on to the putty but sometimes receive interrupt is not working. I'm using HAL coding and UART4 & UART5. We can observe that sometimes the receive interrupt is working and characters are coming to the buffer and sometimes no response. We never did any modifications. Can somebody tell me why it is behaving like this???
PLEASE HELP...
2022-09-07 01:40 AM
Hi @Mr. AK ,
I'd suggest to check all the I2C registers flags and also the handle state before calling the HAL function to set the reception. There may be some pending flags which prevent the correct reception. Observe the flags state before and after the HAL_UART_Receive_IT() call and also the return value.
You should find the problem cause easily, it's not hard to make it work reliably.
Rgds,
J
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-09-07 01:42 AM
Check and clear any noise, framing or overrun type errors.
2022-09-08 02:11 PM
@Mr. AK What version of the STM32H7 HAL library do you use?
The HAL library once was notoriously bad in handling UART data overrun, and the symptom is exactly this. No RX. The latest library version could have it fixed, I have not checked. Developed a habit to write my own UART handling code.
2022-09-30 05:03 AM
Thank you all for the reply. I still cannot get it to working all the time with HAL but I tried with Low Layer (LL) API for the UART and I'm having a stable result all the time. I used polling at UART_tx and IT at UART_rx and modified the BRR value of the UART peripheral and is working all the time.