Blocking vs non-blocking UART using an RTOS
Hello there!
I've been setting up the UART peripheral on my STM32H5 and everything works great! However, there is one thing I can't completely understand:
Using an RTOS to call HAL_UART_Transmit or HAL_UART_Transmit_IT, what's the advantage of one over the other?
AFAIK, the blocking option will use more CPU cycles, and due to the preemptive nature of the RTOS I'm using (freeRTOS), it might take longer to execute in case there are higher priority tasks trying to run.
On the other hand, the HAL_UART_Transmit_IT might sound like a better option (since it is non-blocking) but it also introduces a (or several) ISR call(s), which will run over the RTOS.
On the STM FAQ about the UART peripheral, I noticed the HAL_UART_Transmit is only for low baud rates, why is that? Is due to its blocking nature?
Could anyone explain what would be the best approach here? I'm leaning towards the non-blocking option (and might even add the DMA peripheral) due to its non-blocking behaviour, even it adds a few more ISRs.