2016-01-04 09:38 AM
Hello there!
I'm trying to communicate with the STM spwf01sa wifi module via UART. At first, it works for about 10-15 minutes, then the software stucks, right after the HAL_UART_Receive, in theUART_WaitOnFlagUntilTimeout function. What is actually happening, is that it never quits the while loop, because, for some reason, the HAL_GetTick()'s value wont change (HAL_Init gets called up uppon software start).static HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, uint32_t Timeout)
{
uint32_t tickstart = 0;
/* Get tick */
tickstart = HAL_GetTick();
/* Wait until flag is set */
if(Status == RESET)
{
while(__HAL_UART_GET_FLAG(huart, Flag) == RESET)
{
/* Check for the Timeout */
if(Timeout != HAL_MAX_DELAY)
{
if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout))
{
/* Disable TXE, RXNE, PE and ERR (Frame error, noise error, overrun error) interrupts for the interrupt process */
See, because the last IF condition never recieves true value, the whole wait cycle wont quit this way.
My question is that, is it a known issue, a bug in the Cube lib? Or can I bypass it somehow? Also, why does not work the HAL_GetTick function?
Thanks for the help in advanced!
#uart #irq #clive1 #uartwait
2022-02-16 02:48 AM
Disable overrun. That solves it. This bug is still in the most recent version.
2022-08-30 06:30 AM
Hi, how do i disable overrun?
2022-10-17 01:37 AM
Sorry, don't know this for HAL, but for LL it's: LL_USART_DisableOverrunDetect(USARTx)
2023-02-09 06:40 PM
I was able to solve my issue by updating the stm32f4xx_hal_msp.c. Make sure the peripherals are being enabled correctly.