STM32G491 LPUART OVERRUN(ORE) ERROR




void rs485_gelen()
{
memset(dnm,0,0);
HAL_GPIO_WritePin(DNM_EN_GPIO_Port, DNM_EN_Pin, 0);
HAL_UARTEx_ReceiveToIdle_IT(&hlpuart1, dnm, 100);
}
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
{
if(huart->Instance == LPUART1)
{
memset(dnm,0,0);
HAL_UARTEx_ReceiveToIdle_IT(&hlpuart1, dnm, 100);
}
}void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart)
{
if(huart->Instance == LPUART1)
{
if (huart->ErrorCode & HAL_UART_ERROR_ORE) {
HAL_UARTEx_ReceiveToIdle_IT(&hlpuart1, dnm, 100);
}
}
}
Hi everyone, I have a problem about UART_ReceiveToIdle_DMA. I receive data with baud rate 500000bits/s. I checked the reference manuel, it says stm allows to baud rate up to USART Clock/3 and my clock is 150Mhz.
Here is my problem;
1) ReceiveToIdle_DMA does not detect Idle. I enabled NVIC and DMA settings and used RxEvent Callback. Even though there is Idle in data, it keeps receiving and writes to all buffer.
2) When I use UART Error Callback, it just receive 1 or 2 bytes. I check error flags and it almost every time gives ORE.
I searched about it and check RXNE and IDLEF flags in error call back, these are 1 every time. I don't know what to do exactly but tried to clear flags in error callback but it also does not work. Anyone have any idea?
