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

UART peripheral window corrupts interrupt flags

I am using uVision RealView MDK-ARM v4.14 toolchain with the STM32F100RB on the STM32VLDiscovery board and have run into a peculiar issue when debugging the USART2 peripheral.

The symptoms:
- after sending a character and upon entering the USART2 IRQ handler the RXNE flag is set in USART2->SR, valid character data is in the USART2->DR register and everything looks fine.
- with the USART2 peripheral watch window open after the first instruction within the ISR executes (even when stepping through the disassembly) the RXNE flag gets cleared without any code to do so.
- without the USART2 peripheral watch window open the RXNE flag apparently does not get reset until an appropriate event (either clearing with software or reading from the DR buffer)

Code:

void USART2_IRQHandler(void)
{
    portCHAR cRxChar = 0x00;
    portBASE_TYPE tempSR;

    tempSR = USART2->SR; /** RXNE is cleared by the time this line executes!! **/
    if( USART_GetITStatus( USART2, USART_IT_RXNE ) ) /** returns RESET when should be set **/
    {.../** Handle RXNE interrupt case **/

I have checked the interrupt enable bits and the rest of the USART2 settings and everything should work. The key indicator that this is perhaps a toolchain bug is that all I have to do to get proper operation (validated by checking tempSR in both cases) is to close the USART2 peripheral watch window.

Does anyone have insight into what might be happening in this case?

0