I\'m trying to figure out how to use this new HAL driver. I want to receive data using the HAL_UART_Receive_IT()
which sets up the device to run an interrupt functi
I had to face the same problem in my project.
What I did is start reading 1 byte with HAL_USART_Receive_IT()
right after the peripheral initialization.
Then I wrote a callback on transfer complete which puts the byte in a buffer, sets a flag if command is complete and then calls HAL_USART_Receive_IT()
again for another byte.
It seems to work nice for me since I receive commands trough the USART whose first byte tells me how many bytes more the command is going to be long. Maybe it could work for you too!