HAL_UARTEx_ReceiveToIdle_DMA() => No reaction on IDLE event
I'm trying to make use of the HAL_UARTEx_ReceiveToIdle_DMA() functionality.
So far no reaction on an IDLE event. The corresponding HAL_UARTEx_RxEventCallback
gets called when a certain amount of bytes has been received, but not on an IDLE event.
The development board I use: NUCLEO-L031K6
The UART of interest:USART2
So here's my setup:




I added the following code:
...
/* USER CODE BEGIN PFP */
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t size);
/* USER CODE END PFP */
...
/* USER CODE BEGIN 2 */
HAL_UARTEx_ReceiveToIdle_DMA(&huart2, rx_buf_usart2, rx_buf_size);
__HAL_DMA_DISABLE_IT(&hdma_usart2_rx, DMA_IT_HT);
/* USER CODE END 2 */
...
/* USER CODE BEGIN 4 */
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t size)
{
if (huart->Instance == USART2)
{
HAL_GPIO_TogglePin(LD3_GPIO_Port, LD3_Pin);
HAL_UARTEx_ReceiveToIdle_DMA(&huart2, rx_buf_usart2, rx_buf_size);
__HAL_DMA_DISABLE_IT(&hdma_usart2_rx, DMA_IT_HT);
}
}
/* USER CODE BEGIN 4 */
...
rx_buf_size is set to 16. And exactly after 16 bytes the RxEventCallback gets executed.
What am I missing?
As you can see in my setup, the USART2 global interrupt ist set.
Could somebody point me in the right direction to look for the problem?
Thanks.

