AnsweredAssumed Answered

HAL_GetTick() function of STM32F0 driver is blocking SPI interrupts

Question asked by Gates on Sep 15, 2015
Latest reply on Sep 17, 2015 by Gates

I have a problem with "HAL_GetTick()" that is blocking the SPI interrupt.

In my program, I use the "HAL_SPI_Transmit_IT" function from STM32F0 HAL driver library to initiate a SPI transmission.

After a while, a SPI interrupt occurs and the following functions are called:


In the last called function ("HAL_StatusTypeDef SPI_WaitFifoStateUntilTimeout" function of "STM32F0xx_HAL_Driver\Src\stm32f0xx_hal_spi.c" file), the following instruction is blocking my program:

if((Timeout == 0) || ((HAL_GetTick()-tickstart) >= Timeout))

The tick value is always the same (217) and the program can’t run out of this function until this condition is true.

First, I put a breakpoint in function " GetTick()" (from " STM32F0xx_HAL_Driver\Src\stm32f0xx_hal.c" file but nothing happened: the function was never called.

In the UM1785 (STM32F0 driver datasheet), I saw the following note for the "HAL_InitTick" function:

Care must be taken if HAL_Delay() is called from a peripheral ISR process, The the SysTick interrupt must have higher priority (numerically lower) than the peripheral interrupt. Otherwise the caller ISR process will be blocked.

Following this note, I configured all the other interrupts with a lower priority in my STM32CubeMx project:


Unfortunately, this didn’t change anything.


Does someone have another idea to solve this issue?


Note: the firmware package library I’m currently using is version 1.3.0.