2021-02-14 04:14 PM
When I setup the UART i activated both DMA TX and RX, and I turned on the UART Interrupt in the MX program.
Looking at the code in stm32f4xx_hal_uart.h Around line 680
/* Callbacks Register/UnRegister functions ***********************************/
#if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
HAL_StatusTypeDef HAL_UART_RegisterCallback(UART_HandleTypeDef *huart, HAL_UART_CallbackIDTypeDef CallbackID, pUART_CallbackTypeDef pCallback);
HAL_StatusTypeDef HAL_UART_UnRegisterCallback(UART_HandleTypeDef *huart, HAL_UART_CallbackIDTypeDef CallbackID);
#endif /* USE_HAL_UART_REGISTER_CALLBACKS */
So how do you do an idle_line interrupt using the HAL?
I am using STM32F446.
Solved! Go to Solution.
2021-02-14 04:38 PM
It appears looking in the code in stm32F4xx_hal_uart.c Around line 3037
if the USE_HAL_UART_REGISTER_CALLBACKS != 1
/*Call legacy weak Rx complete callback*/
HAL_UART_RxCpltCallback(huart);
But it will only call that routine if if (--huart->RxXferCount == 0U) or you are done receiving data. (Around line 3023)
2021-02-14 04:38 PM
It appears looking in the code in stm32F4xx_hal_uart.c Around line 3037
if the USE_HAL_UART_REGISTER_CALLBACKS != 1
/*Call legacy weak Rx complete callback*/
HAL_UART_RxCpltCallback(huart);
But it will only call that routine if if (--huart->RxXferCount == 0U) or you are done receiving data. (Around line 3023)