diff options
| author | Ha Thach <[email protected]> | 2020-05-07 16:19:13 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-05-07 16:19:13 +0700 |
| commit | 286ff03ffa3ef563f54797e61617b5ded69a2f21 (patch) | |
| tree | 561bd6b1bcd3ff3731cf55b3659b5c26789be721 | |
| parent | 04c20ff74c89a6169cb544b6909b1602d912b9e0 (diff) | |
| parent | 615369a6eb28c9203d33549c8b944d35539de1b9 (diff) | |
Merge pull request #391 from kasjer/kasjer/stm32l476disco-clock-configuration
stm32l476disco clock configuration
| -rw-r--r-- | hw/bsp/stm32l476disco/stm32l476disco.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/bsp/stm32l476disco/stm32l476disco.c b/hw/bsp/stm32l476disco/stm32l476disco.c index 2d4a4e3de..b18846685 100644 --- a/hw/bsp/stm32l476disco/stm32l476disco.c +++ b/hw/bsp/stm32l476disco/stm32l476disco.c @@ -86,14 +86,19 @@ static void SystemClock_Config(void) RCC_OscInitTypeDef RCC_OscInitStruct; RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; - /* Enable the LSE Oscilator */ + /* Enable the LSE Oscillator */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE; RCC_OscInitStruct.LSEState = RCC_LSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; HAL_RCC_OscConfig(&RCC_OscInitStruct); /* Enable the CSS interrupt in case LSE signal is corrupted or not present */ HAL_RCCEx_DisableLSECSS(); + /* Set tick interrupt priority, default HAL value is intentionally invalid + and that prevents PLL initialization in HAL_RCC_OscConfig() */ + HAL_InitTick((1UL << __NVIC_PRIO_BITS) - 1UL); + /* Enable MSI Oscillator and activate PLL with MSI as source */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI; RCC_OscInitStruct.MSIState = RCC_MSI_ON; |
