Skip to main content
Junde
Senior III
February 27, 2023
Solved

How to enable the HAL_UARTEx_RxEventCallback function.

  • February 27, 2023
  • 2 replies
  • 6439 views

Hi, I am using cubeMx generate the STM32F302VE project, which for receiving the usart1 date by DMA circual mode.

My config as below:

  1. enable DMA, but disable DMA interrupt;
  2. enable USART1, and enable UART_IT_IDLE;

Now, the project can enter the "USART1_IRQHandler()", but can't run to "__HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_IDLEF);", because "huart->ReceptionType != HAL_UART_RECEPTION_TOIDLE". Details can refer the attachment and the following picture.

0693W00000aHiFSQA0.png

This topic has been closed for replies.
Best answer by Junde

Hi, I already know what's the reason of this question.

I shoud call HAL_UARTEx_ReceiveToIdle_DMA() which is declaration in "stm32f3xx_hal_uart_ex.h" replace the HAL_UART_Receive_DMA().

2 replies

Junde
JundeAuthorBest answer
Senior III
February 27, 2023

Hi, I already know what's the reason of this question.

I shoud call HAL_UARTEx_ReceiveToIdle_DMA() which is declaration in "stm32f3xx_hal_uart_ex.h" replace the HAL_UART_Receive_DMA().

Junde
JundeAuthor
Senior III
February 27, 2023

.