AnsweredAssumed Answered

Curious behaviour of USART2 interrupt

Question asked by stokic.srdjan on Sep 26, 2014
Latest reply on Sep 26, 2014 by fm
Hello all,

I have a situation where USART2_IRQHandler is being continuously triggered.

I have two control bits set, RXNIE and TXNIE, all others are set to 0.

When interrupt triggers I'm checking the reason for the interrupt by checking the flags USART_GetITStatus( USART2, USART_IT_TXE ) and USART_GetITStatus( USART2, USART_IT_RXNE ).

It turns out that neither one is the reason for interrupt. Upon closer inspection of registers, USART2_SR bits are all set to 0, but interrupt still fires.

How can I know what is really causing the interrupt to trigger? Let me give you a little background for the problem. I had a Bluetooth module connected to UART which was working fine, and then I upgraded to a new version of the module. This module is not working any more, and is causing this behavior. How can this be? When I investigated things using a oscilloscope, I can see that the data is exchanged in both directions properly, the MCU is sending AT commands, and the module is replying back with correct answers, but no data is being pulled in the interrupt routine, probably because the ISR is being fired continuously and the RXNE interrupt cannot be served properly.

Any advice?


Outcomes