Skip to main content
RJepp.1
Associate
November 16, 2022
Question

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.

  • November 16, 2022
  • 2 replies
  • 895 views

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?

This topic has been closed for replies.

2 replies

Karl Yamashita
Lead III
November 17, 2022

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

If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source
gbm
Lead III
November 17, 2022

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.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice