cancel
Showing results for 
Search instead for 
Did you mean: 

How to check the UART Serial Buffer If They Are Available using HAL Library

CDolo.1
Associate II

I am using STM32F429 in my project which connects to an ATmega2560 thru UART. In arduino, there is a function Serial.Available() to check if the serial buffer is empty or not.

Is there a function in STM32 that is similar to Serial.Available() in Arduino?

BTW, I am using HAL libraries in STM32CubeIDE and HAL_UART_Receive(huart, pData, Size, Timeout) to read the contents of UART buffer.

Please help. Thanks!

PS. I've read the documentation in HAL library but I'm not sure if there is one. I've looked into HAL_UART_GetState but Im not sure.

10 REPLIES 10

>>But I feel this is not very efficient

Right you've got a lot of depth from compound statements, you really need to flatten this, and manage sequence/flow via states

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..