Skip to main content
Associate
September 3, 2025
Question

STM32H7xx ThreadX with HAL, bug in HAL_InitTick

  • September 3, 2025
  • 2 replies
  • 311 views

function HAL_InitTick() in generated code from STM32Cube IDE does not register the TimeBase_TIM_PeriodElapsedCallback after HAL_TIM_Base_Start(&htim6). it just returns the result if Timer Start.
setting up the callback is done after this but never reached when HAL_TIM_Base_Start() worked fine. As a result, the tick does not count.

 if(HAL_TIM_Base_Init(&htim6) == HAL_OK)
 {
 /* Start the TIM time Base generation in interrupt mode */
 return HAL_TIM_Base_Start_IT(&htim6);
 }

 HAL_TIM_RegisterCallback(&htim6, HAL_TIM_PERIOD_ELAPSED_CB_ID, TimeBase_TIM_PeriodElapsedCallback);

 /* Return function status */
 return HAL_ERROR;
}

Edited to apply source code formatting - please see How to insert source code for future reference.

2 replies

Technical Moderator
September 3, 2025

Hello @ElsomaUwe 

Could you please attach your IOC file in order to investigate the issue?

KR,

Souhaib

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.
ElsomaUweAuthor
Associate
September 3, 2025

Hello Souhaib,

here it is. Thank you for your kind support!

best regards

Uwe

Technical Moderator
September 3, 2025

Hello @ElsomaUwe 

Thank you for reporting this issue. The CubeMX team is aware of this problem and will implement a fix in the upcoming releases (Ticket 207319 This is an internal tracking number and is not accessible or usable by customers).

KR,

Souhaib

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.