2022-11-16 02:41 PM
I'm using a STM32F407-Disc1 board, and my polled HAL_UART_Receive() is stuck waiting for the RXNE flag to get set in the UART Status register. Ironically, when using the STM32CubeIDE debugger and looking at the SFR registers for my UART, it looks like data does arrive at the DR register, but the RNXE does not assert.
I can transmit in Polled mode, I just can't receive. Any thoughts?
2022-11-16 09:11 PM
post the HAL_UART_Receive() function call you're waiting for it to timeout.
2022-11-16 10:43 PM
Close the debugger view of UART registers. When it's open, the debugger repeatively reads the data from UART's DR and this way RXNE flag gets cleared, so your program gets stuck.