例如
uint32_t SysClockFreq;
int main(void)
{
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
SysClockFreq= HAL_RCC_GetSysClockFreq();
while(1)
{
//用户代码
}
}