Skip to main content
Graduate II
July 6, 2021
Question

error: unknown type name 'TIM_HandleTypeDef';

  • July 6, 2021
  • 5 replies
  • 3483 views

I met these error:

stm32g4xx_hal_timebase_tim_template.c:56:1: error: unknown type name 'TIM_HandleTypeDef'; did you mean 'EXTI_HandleTypeDef'?

how to fix it?

    This topic has been closed for replies.

    5 replies

    Super User
    July 6, 2021

    Template files are there for you to edit and customize for your application.

    But generally this error is because you haven't included the top-level header file.

    #include "stm32g4xx.h"

    Or your HAL configuration file doesn't include the timer peripheral. Ensure the following line exists and is not commented out of stm32g4xx_hal_conf.h.

    #define HAL_TIM_MODULE_ENABLED

    MQi.1Author
    Graduate II
    July 7, 2021

    In this file:"stm32g4xx_hal_conf_template.h"(system-->include-->stm32g474xx-->)

    I found this words:"This file should be copied to the application folder and renamed to stm32g4xx_hal_conf.h."

    Graduate II
    July 7, 2021

    Yes, so do that, and modify the line to enable the TIM module to be pulled.

    Super User
    July 7, 2021

    If you're new or don't know how to set up HAL manually, use CubeMX to generate the starting point for your project.

    MQi.1Author
    Graduate II
    July 9, 2021

    Could the starting point for your project generated by CubeMX be used in eclipse?

    Super User
    July 9, 2021

    CubeMX code can be used by Eclipse.