2025-02-08 10:19 AM
Hi
I have doubt ,How HAL_UART_TRANSMIT function TIMEOUT works in free rtos thread,
1.which timer it will use ?
2 timeout can lead to dead lock.?
please clarify it
Thanks Regards
Rajeshkumar V R
2025-02-08 11:15 PM
Blocking functions like HAL_UART_Transmit should not be used with RTOS. Use HAL_UART_Transmit_IT or HAL_UART_Transmit_DMA. Actually HAL_UART_Transmit will operate almost OK, just the timeout will depend on what's happening in the system, HAL_UART_Receive will either fail or spoil the operation of others if there is > 1 UART used and >1 running thread.
2025-02-08 11:26 PM
when you create your project with STM32CubeMX, it will urge you to choose two different timers, one for the RTOS (SysTick) and another one you can choose for HAL. STM32CubeMX will also take care of useful priorities.
hth
KnarfB