AnsweredAssumed Answered

how to Clear RxBuffer in HAL_UART_Transmit_IT

Question asked by mattoo.anuj on Sep 1, 2016
Latest reply on Sep 1, 2016 by Dowell.Sherman
I have been wokring on STM32F030  Discovery.I have initialized UART. Whenever I send data from my PC to STM32. It adds the data into previous data. For example if I send "123" and next time I send "456". The whole string would be like "123456", even though they both are different strings. How to clear the buffer? I tried clearing the buffer, but it clear everytime the UART interrupt occurs and clear everything and shows nothing.

Please help?

Here is my code

#define BUFFER_SIZE 9

void USART2_IRQHandler(void)
   uint8_t i;

  for (i=0;i<BUFFER_SIZE;i++)  
       ReceivedData[i]=0;      //clear Rx_Buffer before receiving new data