cancel
Showing results for 
Search instead for 
Did you mean: 

Free RTOS and HAL_UART_TRANSMIT TIMEOUT

10rajeshvr
Associate

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

2 REPLIES 2
gbm
Principal

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.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
KnarfB
Principal III

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