On my main board I have a STM32F103ZET6 and I use HAL library V1.6 in order to program it.There is also a sensor board which is connected to my main board and this sensor sends me data through UART continuously. In order to get sensor data, I use RXNE interrupt. There are some commands that I can send to this sensor in order to change some setting of this sensor. when I want to command this sensor and send some data to it, If I use HAL_UART_Transmit() (send data without using TXE interrupt) I get overrun error in some times. But when I use HAL_UART_Transmit_IT() (send data by using TXE interrupt) it seems that I get no error. why does it happen?
In reference manual RM0008, on page 794 we have USART block diagram. Although it shows that we have separated RDR and TDR but it seems that we have only one DATA Register that is shared by TDR and RDR and we have direct access to only DR. when we want to transmit data we should write in DR and and when some data received it is put in DR too. Now consider , meanwhile we are sending data and put some data in DR, there is a data which is being received and triggered interrupt. what would happen? Does this cause an Over run Error?