Monthly Archives: October 2021

STM32duino Clock Frequency

  • #define F_CPU SystemCoreClock
  • WEAK void SystemClock_Config(void)
  • uint32_t HAL_RCC_GetSysClockFreq(void)
  • uint32_t HAL_RCC_GetHCLKFreq(void)
  • HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
  • HAL_RCC_GetClockConfig

STM32G474RE


__attribute__((constructor(101))) void premain() .platformio\packages\framework-arduinoststm32\cores\arduino\main.cpp
WEAK void init(void) .platformio\packages\framework-arduinoststm32\cores\arduino\board.c
void hw_config_init(void) .platformio\packages\framework-arduinoststm32\libraries\SrcWrapper\src\stm32\hw_config.c
WEAK void SystemClock_Config(void) .platformio\packages\framework-arduinoststm32\variants\STM32G4xx\G473R(B-C-E)T_G474R(B-C-E)T_G483RET_G484RET\variant_NUCLEO_G474RE.cpp

HAL_InitTick()

/* using SysTick */
__weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
{
  [...]
}
/* using TIM6 */
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
{
  [...]
}

[...]

void TIM6_DAC_IRQHandler(void)
{
  HAL_TIM_IRQHandler(&TimHandle);
}
__weak void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)