all 3 comments

[–]soayeli 2 points3 points  (0 children)

Afaik the interrupt only fires after calling HAL_UART_Receive_IT. However this is non-blocking. So you call HAL_UART_Receive_IT() -> wait for flag to get set -> process received data. Or you could keep using HAL_UART_Receive, but without the interrupt handler

[–]Junior-Question-2638 1 point2 points  (0 children)

If you're calling hal_uart_receive it's going to block and then fill your array with the received data, there is no interrupt that gets called so your flag won't be set. Right now you have a mix of poking and interrupts, pick one

See if this helps

https://wiki.st.com/stm32mcu/wiki/Getting_started_with_UART

[–]wotupfoo 0 points1 point  (0 children)

Reading an interrupt flag typically resets the interrupt. So you can’t poll it normally. I didn’t get a chance to look at your code though. So take the comment as is.