Solved
hi everyone, why UART using DMA stops receiving data suddenly in IDLE MODE
..
..
What exactly display_function do? I faced the same problem when I was doing some operation before enabling the IDLE interrupt again. I resolved by just coping the received data to Main buffer and then enable the interrupt and then call your display function. In your case,
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
{
if(huart->Instance == USART1)
{ // Check if it is an "Idle Interrupt"
__HAL_UART_CLEAR_IDLEFLAG(&huart1);
memcpy(MainBuf,RxBuf,Size);
}
__HAL_UART_ENABLE_IT(&huart1, UART_IT_IDLE);
HAL_UARTEx_ReceiveToIdle_DMA(&huart1,RxBuf,RxBuf_SIZE);
__HAL_DMA_DISABLE_IT(&hdma_usart1_rx,DMA_IT_HT);
display_function(MainBuf); // Pass the Size too here. if it is zero then just return.
}Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.