2014-12-17 08:42 AM
Platform: STM32F429I-Discovery and Discovery-WiFi connected to UART1
Tools: IAR EWARM (eval until we get the license) Situation: If I pull power from the WiFi board and plug it back in,. this apparently results in an overrun in the UART. Not too surprising as the other board powers up while the STM32F429I-Discovery tries to read/write. This is configured by HAL for interrupt driven input. In the procedurevoid HAL_UART_IRQHandler(UART_HandleTypeDef *huart)
in
stm32f4xx_hal_uart.c
the following code exists to handle overrun interrupts:tmp1 = __HAL_UART_GET_FLAG(huart, UART_FLAG_ORE);
tmp2 = __HAL_UART_GET_IT_SOURCE(huart, UART_IT_ERR);
/* UART Over-Run interrupt occurred ----------------------------------------*/
if((tmp1 != RESET) && (tmp2 != RESET))
{
__HAL_UART_CLEAR_OREFLAG(huart);
huart->ErrorCode |= HAL_UART_ERROR_ORE;
}
I've stepped through the code and it steps over
__HAL_UART_CLEAR_OREFLAG(huart).
As aresultthe interrupt does not get cleared.
Status flags in 'huart' areHAL_UART_STATE_READY for State and forHAL_UART_ERROR_ORE. What's the best way to fix this? I'm, inclined to copy this ISR into a project file and tweak it as needed to solvethisproblem (doing whatever is needed to get my copy of the ISR linked to the interrupt.) But I'm open to suggestions if there is a better strategy. If we agree that this is a bug, is there an appropriate place to file a bug report? Thanks! #hal-uart-overrun2015-01-12 07:37 AM
Hi,
Please check the UART baud rate configuration, you should set the same baud rate configuration used by your WiFi board, If the baud rate gap between Discovery and WiFi Boards is higher, you will continue to receive the OVR error even after performing the clear using the macro:__HAL_UART_CLEAR_OREFLAG(huart)
Regards,
Heisenberg.
2015-01-13 11:52 AM
Hi Heisenberg,
Many thanks for the suggestion. I'm working on a different part of the project right now but hope to return to this soon. I will check the baud rate.This is the UART connection to the Discovery-WiFi, BTW, which runs at 921600 baud. :o It strikes me as a pretty high baud rate for character by character interrupts but I don't really have a good feel for how fast this processor is.best,hank2015-03-02 04:10 AM
Hi Hank,
I am having the same problem. Did you find a fix?2015-03-03 01:49 PM
Problem is easy to solve... take a look on your HAL Interrupt Handler for the U(S)ART. It is totally overloaded. Just clear everything out and keep a code that moves the usart received data to ur buffer and clear the interrupt flag. - nothing more else
2015-03-09 01:04 PM
Our 'fix' was to switch to SPI. At least the master doesn't hang waiting for data from the slave.