I would need 3 USARTs for a project (I am using stm32f103vct6 microcontroller). One USART is already functional properly which is USART1. I am trying same with USART2. Transmit is working fine but but RXNE flag is falsely setting up here and hence its giving garbage Rx character. I tried same code using arm-none-linux-gcc compiler in which its working fine (no false RXNE flag setting), hence i thought it could be compiler related issue. I am posting my code for reference.