UART interrupt handler callback is called twice, if bus idle happens at "dma pos"="half dma buffer size"
STM32CubeL4, v1.17.2 in function HAL_UART_IRQHandler() at line 2524.
When handling bus ideal situation, there is no condition to prohibit calling the callback if nb_remaining_rx_data = huart->RxXferSize/2. So, both Dma half transfer complete and bus ideal situations call the callback function. Then, the callback is called twice with the same "pos", and therefore, the user code in the callback routine may think a whole dma length is recieved and dma buffer pos is wrapped back to the same "pos". This causes data corruption.
Adding the condition above to the already existing condition for dma full transfter complete fixes the problem.
possible fix:

