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()

  while (true)

I am getting the following error:

Field '__HAL_TIM_GET_COUNTER(&s_TimerInstance)' could not be

Can anyone help me out on this?

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

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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.