AnsweredAssumed Answered

UART Receive Buffer Clear

Question asked by mattoo.anuj on Sep 3, 2016
Latest reply on Aug 27, 2017 by masoud shahrabi
I am working on STM32F0. I am little confused between
USART1_IRQHandler 
and 
HAL_UART_RxCpltCallback
HAL_UART_RxHalfCpltCallback
HAL_UART_TxHalfCpltCallback
HAL_UART_TxCpltCallback

Is it necessary to use Callback when UART is setup as interrupt.
What does Callback do?

I am sending a string for example "1234" to STM32. The string is stored in buffer using
HAL_UART_Receive_IT

When I send another string for example "ABCD". the Buffer is filled up like this "1234ABCD".
But both are separate strings, how can I clear previous buffer so that everytime I send string it do not add up with previous one. Is callback necessary for this.


Kindly help please!

Outcomes