This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

uVision simulator problem with interrupted IT instruction

I think I found an issue with the uVision simulator and would like to know if someone can confirm this.

A main program contains a loop where a global variable is tested and if not zero, call an error routine. The compiler translates this to an IT sequence:

1:  CMP     R0, #0x00
2:  IT      NE
3:  BLNE.W  errorFunc

This loop is interrupted and the interrupt handler returns using the following sequence:

1:  IT      NE
2:  BXNE    LR

If the interrupt occurs while in the main loop the IT instruction is executed (so the BLNE.W is the instruction to execute when the ISR returns), this BLNE.W is taken while the condition is false. I have checked this using instruction tracing and watching the concerning global variable.

It looks like a problem in the simulator but to be sure I would like to hear if someone can confirm this.