STM32wb55 HAL_Delay() Function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2019-07-27 8: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2019-08-05 5: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-10-17 3: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();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-10-21 6: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-10-21 7: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-10-22 5: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-11-03 8:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-11-06 1:38 AM
Hello,
Great to read you were able to fix that issue.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-02-08 4: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-02-14 5:16 PM
any news? @Imen Ezzine @Christophe Arnal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-02-24 10:44 PM
Fixed by selecting a different toolchain.
Using the cube, under Code Generator,
output format GPDSC Toolchain --- failed
But using MDK Toolchain. ----- worked
Using H7
TJ.
