cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_Delay() and osDelay()

zhaojingyangchun
Associate II
Posted on June 13, 2016 at 09:00

If I want to run FreeRTOS with SDIO,I need to replace ''HAL_Delay()'' with ''osDelay()'' in source file ''stm32f1xx_hal_sd.c''.Otherwise,It will be blocked in HAL_Delay().

#hal_delay()-and-osdelay()
2 REPLIES 2
Walid FTITI_O
Senior II
Posted on June 13, 2016 at 14:59

Hi jyc.z,

By default, the STM32Cube HAL is built around a unique timebase source which is the ARM-Cortex system timer (SysTick).

However, HAL-timebase related functions are defined as weak so that they can be overloaded to use another hardware timebase source. This is strongly recommended when the application uses an RTOS, since this middleware has full control on the SysTick configuration (tick and priority) and most RTOSs force the SysTick priority to be the lowest.

Using the SysTick remains acceptable if the application respects the HAL programming model, that is, does not perform any call to HAL timebase services within an Interrupt Service Request context (no dead lock).

You can select a timer as a time base source. Check the “HAL_TimeBase� example in one of the STM32CubeFxx packages at this path : Examples\HAL\HAL_TimeBase

-Hannibal-

If I want to run FreeRTOS with SDIO,I need to replace ''HAL_Delay()'' with ''osDelay()'' in source file ''stm32f1xx_hal_sd.c''.Otherwise,It will be blocked in HAL_Delay().

zhaojingyangchun
Associate II
Posted on July 15, 2016 at 10:21

Thanks a lot