2019-07-27 08:50 AM
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.
Solved! Go to Solution.
2019-08-05 05:25 AM
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.
2020-10-17 03:26 PM
Stm32WB55CC with 1.8.0 pack has got the same problem. Systick is frozen. But solution from @Christophe Arnal not working... Also if I select Timebase Sourse = TIM1, program breaks somewhere in HAL_Init();
2020-10-21 06:12 AM
Hello,
The original problem was that HAL_Delay() was implemented empty in our earlier packages. Now, there is an implementation of HAL_Delay() in main.c which is slightly different compare to the default one from the HAL.
In which BLE example provided in v1.8.0 Cube Package did you notice the HAL_Delay() is not working as expected ?
Regards.
2020-10-21 07:52 AM
STM32CubeIDE 1.4.2 with 1.8.0 pack.
I generate new project for WB55CC in CubeIDE and try to do blink led:
I go to debug and do first step
I try to do second step, but prog going away.
This was "TIM1 problem". Next is about "Systick problem".
I select Timebase Sourse = SysTick, generate code. Debugger do all steps before while(1).
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_GPIO_TogglePin(Buz_GPIO_Port, Buz_Pin);
HAL_Delay(200);
}
But after HAL_Delay(200) prog is infinity wating. I pause via debugger and I can see
Look at attachment.
2020-10-22 05:37 AM
Hello,
I added the STM32CubeMX stamp as I believe the problem is not linked to either BLE or STM32WB but more on the way STM32CubeMX has generated the application.
From the time being, I would recommend to have a look to \Projects\P-NUCLEO-WB55.Nucleo\Examples\HAL\HAL_TimeBase_TIM which provide an .ioc with TIM17 used to generate the tick for HAL_Delay().
Regards.
2020-11-03 08:57 PM
2020-11-06 01:38 AM
Hello,
Great to read you were able to fix that issue.
Regards.
2021-02-08 04:08 PM
I got systick problem! I use all timers and:
void SysTick_Handler(void)
{
/* USER CODE BEGIN SysTick_IRQn 0 */
/* USER CODE END SysTick_IRQn 0 */
CubeMX forgot HAL_IncTick();
/* USER CODE BEGIN SysTick_IRQn 1 */
/* USER CODE END SysTick_IRQn 1 */
}
The joke is that in project "CC_testSystick" 1.5MB above no this problem. I think this is because in proj above I use only one timer at one time.
Pack v 1.10.1
2021-02-14 05:16 PM
any news? @Imen Ezzine @Christophe Arnal
2021-02-24 10:44 PM