cancel
Showing results for 
Search instead for 
Did you mean: 

I am using the stm32H743 and have added USB OTG FS and FatFS to my project. A function is generated in Main() : static void MX_TIM8_Init(void) and the last thing this function calls is: HAL_TIM_MspPostInit(&htim8); But this file is NOT generated. Why ?

PSwin.1
Associate

I am using the stm32H743 and have added USB OTG FS and FatFS to my project.

A function is generated in Main() : static void MX_TIM8_Init(void)

and the last thing this function calls is: HAL_TIM_MspPostInit(&htim8);

But this file is NOT generated. Why ?

1 REPLY 1
TDK
Guru

Are you sure? I just generated a project like that and it generated fine for me. The function is in stm32h7xx_hal_msp.c.

void HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim)
{
  GPIO_InitTypeDef GPIO_InitStruct = {0};
  if(htim->Instance==TIM8)
  {
  /* USER CODE BEGIN TIM8_MspPostInit 0 */
 
  /* USER CODE END TIM8_MspPostInit 0 */
  
    __HAL_RCC_GPIOC_CLK_ENABLE();
    /**TIM8 GPIO Configuration    
    PC6     ------> TIM8_CH1 
    */
    GPIO_InitStruct.Pin = GPIO_PIN_6;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    GPIO_InitStruct.Alternate = GPIO_AF3_TIM8;
    HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
 
  /* USER CODE BEGIN TIM8_MspPostInit 1 */
 
  /* USER CODE END TIM8_MspPostInit 1 */
  }
 
}

If you feel a post has answered your question, please click "Accept as Solution".