cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_SYSTICK_IRQHandler() call is missing in CubeMX v5 generated Systick_Handler.

Innomatic
Associate II

When STM32CubeMX v.5 generates project, it does not insert HAL_SYSTICK_IRQHander() inside SysTick_Handler(). As a result, your HAL_SYSTICK_Callback() no longer works. Previous versions of CubeMX used to generate following code for SysTick_Handler()

/**
* @brief This function handles System tick timer.
*/
void SysTick_Handler(void)
{
  /* USER CODE BEGIN SysTick_IRQn 0 */
 
  /* USER CODE END SysTick_IRQn 0 */
  HAL_IncTick();
  HAL_SYSTICK_IRQHandler();
  /* USER CODE BEGIN SysTick_IRQn 1 */
 
  /* USER CODE END SysTick_IRQn 1 */
}

In version 5. it becomes

/**
* @brief This function handles System tick timer.
*/
void SysTick_Handler(void)
{
  /* USER CODE BEGIN SysTick_IRQn 0 */
 
  /* USER CODE END SysTick_IRQn 0 */
  HAL_IncTick();
  /* USER CODE BEGIN SysTick_IRQn 1 */
 
  /* USER CODE END SysTick_IRQn 1 */
}

23 REPLIES 23
kurta999
Senior

For me it evern worse, entrie systick handler was removed by 5.0 after upgrading from 4.27.0 and re-generating an existing project.

Amel NASRI
ST Employee

Hello,

Please note that this issue is shared with our STM32CubeMX experts for farther check.

Thanks for highlighting this, and sorry for any inconvenience it may create for you.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Nawres GHARBI
ST Employee

Hi

a new implementation has been done on the 5.0 for the systick

the HAL_SYSTICK_IRQHandler is used for debug purpose and should not be called if you refer to Cube coding rules.

If needed you are still able to add it in the dedicated user sections

Innomatic
Associate II

> should not be called if you refer to Cube coding rules.

That would be o.k. if all the previous versions of CubeMX have followed THAT RULE. What other Cube coding rules are there, which haven't been observed so far but suddenly respected in the version 5? Are there any rules like consistency or compatibility across the versions?

where is Cube coding rules?

is it not a bug?​

GS1
Senior III

Hi, I have an even worse problem:

I updated my FreeRTOS project and now the system is halted in Hard Fault interrupt immediately after startup. I also have found that the complete handler for SysTick is missing. .. now trying to get my project to life again ...

Second issue: MXCube creates two file entries of file "system_stm32h7xx.c" in my Keil project (under Driver/CMSIS) and I have to delete one from the tree to get the project linked correctly.

P.S: The project was working without issues before converting to version 5.0 of CubeMX.

Nawres GHARBI
ST Employee

Hi @GS@S​ 

Could you attach your old project or ioc before migration please

Hi Nawres, sorry, but I am not allowed to add the project due to company restrictions.

But I assume it should easily be possible to reproduce the issue when creating a simple project with the old version for an STM32H743 (Activate FreeRTOS in standard configuration), generate code and then convert the project to the new release.