2016-02-18 05:17 PM
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. 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? #usart-rs232-uart-stm32l42016-02-19 10:52 AM
The problem ended up being that CubeMX automatically changed my USART settings to ''Synchronous'' rather than my original setting of ''Asynchronous''. After changing things back to Async, it worked fine and auto-generated function names with UART* rather than USART*.