cancel
Showing results for 
Search instead for 
Did you mean: 

In Rx Polling Mode, HAL_UART_Receive() is stuck in UART_WaitOnFlagUntilTimeout() waiting for the RXNE flag to get set in the UART's Status Register.

RJepp.1
Associate II

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?

2 REPLIES 2
Karl Yamashita
Lead II

post the HAL_UART_Receive() function call you're waiting for it to timeout.

If you find my answers useful, click the accept button so that way others can see the solution.
gbm
Lead III

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.