cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_UART_Receive Not Working in STM32 netxduo.c Thread

srikanthpalvai
Associate III

Description: I'm facing an issue with the HAL_UART_Receive function in an STM32 microcontroller application when used within the netxduo.c thread. Below are the details of the problem:

Overview: I'm using an STM32 microcontroller along with a SIM modem for communication purposes.

Issue: The HAL_UART_Receive function works correctly in the main thread, allowing me to receive responses from the SIM modem. However, when calling the same function from the netxduo.c thread, I'm not receiving any responses.

Application Hanging at HAL_UART_Receive

srikanthpalvai_1-1712160453195.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

This is because HAL_UART_Transmit and HAL_UART_Receive are blocking functions, not friendly to RTOS environment. Use non-blocking functions (interrupts, DMA). This is a very frequently asked question, please search in the forum and examples. 

View solution in original post

1 REPLY 1
Pavel A.
Evangelist III

This is because HAL_UART_Transmit and HAL_UART_Receive are blocking functions, not friendly to RTOS environment. Use non-blocking functions (interrupts, DMA). This is a very frequently asked question, please search in the forum and examples.