Skip to main content
AKetc
Associate III
July 27, 2019
Solved

STM32wb55 HAL_Delay() Function

  • July 27, 2019
  • 20 replies
  • 5863 views

Hi everyone,

I have been stuck at a problem. I have been trying to configure HAL_Delay function to work in STM32 BLE_Server example in the STM32WB SDK. However, for some reason, the code gets stuck inside the HAL_Delay() Function. I have searched over the internet and tried the solution to increase Systick interrupt priority. Still there's no solution to my problem. Please help me out.

This topic has been closed for replies.
Best answer by Christophe Arnal

​Hello,

In all BLE Applications, the HAL_Delay() was not used so in order to save power ( avoiding the systick periodic interrupt timer), it was decided to disable the systick.

As long as the systick is not enabled, the HAL_Delay() cannot exit anymore.

In main.c, the two following weak functions have been overloaded with empty function

This prevents the HAL to enable the systick.

/**
 * This function is empty to avoid starting the SysTick Timer
 */
HAL_StatusTypeDef HAL_InitTick( uint32_t TickPriority )
{
	return (HAL_OK);
}
 
/**
 * This function is empty as the SysTick Timer is not used
 */
void HAL_Delay(__IO uint32_t Delay)
{
	return;
}

In order to get back the systick, you need to remove these two implementations from main.c

In the next release v1.3.0, the HAL_Delay() will be available by default as the lost of power consumption is marginal versus the fact it is a friendly service to be used in the appplication

Regards.

20 replies

Lep
Senior
July 11, 2022

I also have this problem, can you tell me how to solve it?