I am trying to implement a hardware timer for STM32F and read the value from it. So far, this is my implementation:

static TIM_HandleTypeDef s_TimerInstance = {.Instance = TIM7};

void vConfigureTimerForRunTimeStats()
{
__TIM7_CLK_ENABLE();;
HAL_TIM_Base_Start(&s_TimerInstance);

while (true)
{
__HAL_TIM_GET_COUNTER(&s_TimerInstance);
delay(100);
}
}


I am getting the following error:

Field '__HAL_TIM_GET_COUNTER(&s_TimerInstance)' could not be
resolved

Can anyone help me out on this?

• Can you trace back where the field above is defined? Dec 13 '18 at 15:33
• tracing back takes me to stm32f0xx_hal_tim.h header file, which is included in my include
– Nil
Dec 13 '18 at 15:35
• When you ask about a particular function in a library, it would be very helpful if you provided a link to that library.
– user103380
Dec 13 '18 at 15:52

#define __HAL_TIM_GET_COUNTER(__HANDLE__) \

Above is defined in stmf32f0xx_hal_tim.h, which is probably not enabled or included.
Fix that, or use TIM7->CNT.