cancel
Showing results for 
Search instead for 
Did you mean: 

error: unknown type name 'TIM_HandleTypeDef';

MQi.1
Senior II

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?

6 REPLIES 6
TDK
Guru

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

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

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."

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Guru

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

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

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

TDK
Guru

CubeMX code can be used by Eclipse.

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