AnsweredAssumed Answered

USART gets overrun error non-stop

Question asked by ernie on Feb 19, 2016
Latest reply on Feb 19, 2016 by ernie
I'm using STM32L4 with CubeMx.  I want to use USART3 to implement an RS232 console echo.

My CubeMX is configured like this photo (and I have "USART3 global interrupt" checkboxed as enabled.

 mxcube.png

After auto-generating the code, which initializes the USART3 module, I run my custom application code, which I'm trying to just echo console characters RS232 style.

void test_usart(void)
{
    uint8_t byte;
    HAL_StatusTypeDef ret;
    
    while(1)
    {
        while( HAL_OK != HAL_USART_Receive_IT(&husart3, &byte, 1) )
        {
            osDelay(1);
        }
        
        while( HAL_OK != HAL_USART_Transmit_IT(&husart3, &byte, 1) )
        {
            osDelay(1);
        }
    }
}


The issue is that in the ISR, I always get the overrun error and I can never get characters from the console host to the STM32L4.  However, I am not transmitting or receiving anything at that point.  Any clue as to what I might be doing wrong?

Outcomes