cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7xx ThreadX with HAL, bug in HAL_InitTick

ElsomaUwe
Associate

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.

3 REPLIES 3
Souhaib MAZHOUD
ST Employee

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.

ElsomaUwe
Associate

Hello Souhaib,

here it is. Thank you for your kind support!

best regards

Uwe

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.