2025-09-03 1:17 AM - last edited on 2025-09-03 1:28 AM by Andrew Neil
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.
2025-09-03 1:25 AM
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.
2025-09-03 1:33 AM
2025-09-03 2:13 AM
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.