Skip to main content
Explorer
April 3, 2024
Solved

HAL_UART_Receive Not Working in STM32 netxduo.c Thread

  • April 3, 2024
  • 1 reply
  • 864 views

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

 

 

    This topic has been closed for replies.
    Best answer by Pavel A.

    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. 

    1 reply

    Pavel A.Answer
    Super User
    April 3, 2024

    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.