Skip to main content
Visitor II
June 12, 2020
Question

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

  • June 12, 2020
  • 1 reply
  • 576 views

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 ?

    This topic has been closed for replies.

    1 reply

    Super User
    June 13, 2020

    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 */
     }
     
    }