Skip to main content
marcus2
Associate II
December 1, 2016
Question

UART responding to wrong baudrate: HAL_UART_Receive() receives symbols, but HAL_UART_Receive_IT() no interrupt

  • December 1, 2016
  • 3 replies
  • 843 views
Posted on December 01, 2016 at 11:45

Hi,

I found that a uart (standard configuration RX/TX, no flow ctrl) may receive some (wrong) symbols in polling mode but there is no interrupt at all in interrupt mode. Both mechanisms, of course, work fine if correct baudrate is configured.

Why the difference?

Regards

Marcus

#uart-interrupt-polling-baudrate
This topic has been closed for replies.

3 replies

aaron239955_stm1_st
Senior
December 5, 2016
Posted on December 05, 2016 at 20:28

Doctor, doctor!  When I drink my coffee and leave the spoon in, it hits me in the forehead and I get a Headache!!

Doctor replies:  Don't leave the spoon in your coffee when you drink it!.

Why are you asking : 'if I run the component out of spec in two different ways, I get two different results.  But if I run it in spec everything works fine.'

How about- don't run it out of spec?

Tesla DeLorean
Guru
December 6, 2016
Posted on December 06, 2016 at 04:11

Is it possible that polling mode code clears framing errors, or others, that would stop an RXNE interrupt?

You'd want to review the USART status register bits and configuration in the failing state.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
marcus2
marcus2Author
Associate II
January 10, 2017
Posted on January 10, 2017 at 09:24

This what happens: depending on the baudrate RXNE is sometimes set, sometimes not - which is probably due to framing errors. In the latter case, there is no interrupt. Clive, thanks for your hint.