cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F091 - Problem with USART2 and RXNE flag

JuM
Senior

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 suggestions0690X0000087pANQAY.jpg0690X0000087pADQAY.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
AvaTar
Lead

> 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.

View solution in original post

2 REPLIES 2
AvaTar
Lead

> 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.

JuM
Senior

​Oh yes, thank you, understood (and your suggestion works...)