Skip to main content
Visitor II
September 18, 2020
Question

The STM32 HAL library serial port cannot receive and receive at the same time.

  • September 18, 2020
  • 2 replies
  • 1097 views

The problem appears in the serial port receiving interrupt function, the serial port is locked, but the latter sentence has been unlocked, but why is it still locked?

I have consulted the manual of the STM32HAL library. The manual says that the serial port is dual-locked for sending and receiving data, which makes it impossible to send and receive data through the serial port at the same time. Friends, how should I solve this problem so that the serial port of the HAL library can send and receive data at the same time 0693W000004GSWyQAO.png

    This topic has been closed for replies.

    2 replies

    Super User
    September 18, 2020

    There's no problem here. An interrupt cannot pre-empt itself, so it'll be unlocked the next time the interrupt runs.

    Graduate II
    September 18, 2020

    If you find the HAL UART code to be bloated and dysfunctional you can always replace it..

    Here it just locks ownership while multiple related values need to be changed together