STM32F091 - Problem with USART2 and RXNE flag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-03-12 5:08 AM
In USART2 interrupt service routine ISR is read
isrval = USART2->ISR​;
Stopping at breakpoint just before this statement, Keil debugger shows ISR value 0x000000F8.
Stepping one step (to read this ISR), value in ISR changes to 0x000000D8.
But, what ist this: 'isrval' is also 0x000000D8!!!.
This means RXNE flag is lost(!), in ISR AND in isrval and cannot further be evaluated.
Any suggestions
Solved! Go to Solution.
- Labels:
-
STM32F0 Series
-
UART-USART
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-03-12 5:14 AM
> This means RXNE flag is lost(!), in ISR AND in isrval and cannot further be evaluated.
Yes, of course.
The debugger is not a magic device.
It updates the RDR register view, too, and thereby clears the RXNE flag.
The only solution - don't single-step through the evaluation, set a breakpoint afterwards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-03-12 5:14 AM
> This means RXNE flag is lost(!), in ISR AND in isrval and cannot further be evaluated.
Yes, of course.
The debugger is not a magic device.
It updates the RDR register view, too, and thereby clears the RXNE flag.
The only solution - don't single-step through the evaluation, set a breakpoint afterwards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-03-12 5:43 AM
​Oh yes, thank you, understood (and your suggestion works...)
