0
votes

Implicit declaration of function 'HAL_GetTick'. Can you tell me or give me a link for library, where I can find declaration of this function.

1
I usually find the function declared as _weak in the stm32f7xx_hal.c for an stm32f7. Of course it depends on the stm32 you are using. - Marech
Mine is STM32F10x - Aster
Then it the __weak declaration should be in stm32f1xx_hal.c - Marech
@Marech no - never in .c file. .c files are not for include - 0___________

1 Answers

0
votes

The function is nearly the same at every device I am currently working on an F4 so I will provide the definition I have :

/**
  * @brief Provides a tick value in millisecond.
  * @note This function is declared as __weak to be overwritten in case of other 
  *       implementations in user file.
  * @retval tick value
  */
__weak uint32_t HAL_GetTick(void)
{
  return uwTick;
}

The obvious question is what the hell is uwTick? it is just a volatile uint_32 that get incremented whenever the HAL_IncTick is called. The Hal_IncTick is called from the SysTickHandler that is called as an interrupt.