From 4494720dbc6444f31f29000c0c39c49180d591b6 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 10 Jan 2020 15:10:16 +0700 Subject: [PATCH] clean up HSE_VALUE for stm32 --- hw/bsp/feather_stm32f405/feather_stm32f405.c | 4 ++-- hw/bsp/pyboardv11/pyboardv11.c | 4 ++-- hw/bsp/stm32f207nucleo/stm32f207nucleo.c | 4 ++-- hw/bsp/stm32f407disco/stm32f407disco.c | 4 ++-- hw/bsp/stm32f411blackpill/stm32f411blackpill.c | 4 ++-- hw/bsp/stm32f411disco/stm32f411disco.c | 4 ++-- hw/bsp/stm32f412disco/stm32f412disco.c | 4 ++-- hw/bsp/stm32f767nucleo/stm32f767nucleo.c | 4 ++-- hw/bsp/stm32h743nucleo/stm32h743nucleo.c | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/hw/bsp/feather_stm32f405/feather_stm32f405.c b/hw/bsp/feather_stm32f405/feather_stm32f405.c index e8b15b513..16036750c 100644 --- a/hw/bsp/feather_stm32f405/feather_stm32f405.c +++ b/hw/bsp/feather_stm32f405/feather_stm32f405.c @@ -67,7 +67,7 @@ static void all_rcc_clk_enable(void) * APB1 Prescaler = 4 * APB2 Prescaler = 2 * HSE Frequency(Hz) = 12000000 - * PLL_M = 12 + * PLL_M = HSE_VALUE/1000000 * PLL_N = 336 * PLL_P = 2 * PLL_Q = 7 @@ -95,7 +95,7 @@ static void SystemClock_Config(void) RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 12; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; RCC_OscInitStruct.PLL.PLLN = 336; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLQ = 7; diff --git a/hw/bsp/pyboardv11/pyboardv11.c b/hw/bsp/pyboardv11/pyboardv11.c index 7452eef71..aa8301b44 100644 --- a/hw/bsp/pyboardv11/pyboardv11.c +++ b/hw/bsp/pyboardv11/pyboardv11.c @@ -56,7 +56,7 @@ static void all_rcc_clk_enable(void) * APB1 Prescaler = 4 * APB2 Prescaler = 2 * HSE Frequency(Hz) = 12000000 - * PLL_M = 12 + * PLL_M = HSE_VALUE/1000000 * PLL_N = 336 * PLL_P = 2 * PLL_Q = 7 @@ -84,7 +84,7 @@ static void SystemClock_Config(void) RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 12; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; RCC_OscInitStruct.PLL.PLLN = 336; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLQ = 7; diff --git a/hw/bsp/stm32f207nucleo/stm32f207nucleo.c b/hw/bsp/stm32f207nucleo/stm32f207nucleo.c index a09f26cfb..178c0e8c6 100644 --- a/hw/bsp/stm32f207nucleo/stm32f207nucleo.c +++ b/hw/bsp/stm32f207nucleo/stm32f207nucleo.c @@ -56,7 +56,7 @@ static void all_rcc_clk_enable(void) * APB1 Prescaler = 4 * APB2 Prescaler = 2 * HSE Frequency(Hz) = 8000000 - * PLL_M = 8 + * PLL_M = HSE_VALUE/1000000 * PLL_N = 240 * PLL_P = 2 * PLL_Q = 5 @@ -75,7 +75,7 @@ void SystemClock_Config(void) RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 8; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; RCC_OscInitStruct.PLL.PLLN = 240; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLQ = 5; diff --git a/hw/bsp/stm32f407disco/stm32f407disco.c b/hw/bsp/stm32f407disco/stm32f407disco.c index 42cb613c8..88d50efd5 100644 --- a/hw/bsp/stm32f407disco/stm32f407disco.c +++ b/hw/bsp/stm32f407disco/stm32f407disco.c @@ -55,7 +55,7 @@ static void all_rcc_clk_enable(void) * APB1 Prescaler = 4 * APB2 Prescaler = 2 * HSE Frequency(Hz) = 8000000 - * PLL_M = 8 + * PLL_M = HSE_VALUE/1000000 * PLL_N = 336 * PLL_P = 2 * PLL_Q = 7 @@ -83,7 +83,7 @@ static void SystemClock_Config(void) RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 8; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; RCC_OscInitStruct.PLL.PLLN = 336; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLQ = 7; diff --git a/hw/bsp/stm32f411blackpill/stm32f411blackpill.c b/hw/bsp/stm32f411blackpill/stm32f411blackpill.c index 63a7b4c70..1fc5bb566 100644 --- a/hw/bsp/stm32f411blackpill/stm32f411blackpill.c +++ b/hw/bsp/stm32f411blackpill/stm32f411blackpill.c @@ -53,8 +53,8 @@ static void all_rcc_clk_enable(void) * AHB Prescaler = 1 * APB1 Prescaler = 2 * APB2 Prescaler = 1 - * HSE Frequency(Hz) = 8000000 - * PLL_M = 8 + * HSE Frequency(Hz) = 25000000 + * PLL_M = HSE_VALUE/1000000 * PLL_N = 336 * PLL_P = 4 * PLL_Q = 7 diff --git a/hw/bsp/stm32f411disco/stm32f411disco.c b/hw/bsp/stm32f411disco/stm32f411disco.c index 9d9c30715..04e211f21 100644 --- a/hw/bsp/stm32f411disco/stm32f411disco.c +++ b/hw/bsp/stm32f411disco/stm32f411disco.c @@ -54,7 +54,7 @@ static void all_rcc_clk_enable(void) * APB1 Prescaler = 2 * APB2 Prescaler = 1 * HSE Frequency(Hz) = 8000000 - * PLL_M = 8 + * PLL_M = HSE_VALUE/1000000 * PLL_N = 336 * PLL_P = 4 * PLL_Q = 7 @@ -82,7 +82,7 @@ static void SystemClock_Config(void) RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 8; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; RCC_OscInitStruct.PLL.PLLN = 336; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; RCC_OscInitStruct.PLL.PLLQ = 7; diff --git a/hw/bsp/stm32f412disco/stm32f412disco.c b/hw/bsp/stm32f412disco/stm32f412disco.c index 10778bcfc..97291d8b3 100644 --- a/hw/bsp/stm32f412disco/stm32f412disco.c +++ b/hw/bsp/stm32f412disco/stm32f412disco.c @@ -56,7 +56,7 @@ static void all_rcc_clk_enable(void) * APB1 Prescaler = 2 * APB2 Prescaler = 1 * HSE Frequency(Hz) = 8000000 - * PLL_M = 8 + * PLL_M = HSE_VALUE/1000000 * PLL_N = 200 * PLL_P = 2 * PLL_Q = 7 @@ -91,7 +91,7 @@ static void SystemClock_Config(void) RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 8; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; RCC_OscInitStruct.PLL.PLLN = 200; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLQ = 7; diff --git a/hw/bsp/stm32f767nucleo/stm32f767nucleo.c b/hw/bsp/stm32f767nucleo/stm32f767nucleo.c index 7367c56b8..228fd6e57 100644 --- a/hw/bsp/stm32f767nucleo/stm32f767nucleo.c +++ b/hw/bsp/stm32f767nucleo/stm32f767nucleo.c @@ -66,7 +66,7 @@ static void all_rcc_clk_enable(void) * APB1 Prescaler = 4 * APB2 Prescaler = 2 * HSE Frequency(Hz) = 8000000 - * PLL_M = 8 + * PLL_M = HSE_VALUE/1000000 * PLL_N = 432 * PLL_P = 2 * PLL_Q = 9 @@ -99,7 +99,7 @@ void SystemClock_Config(void) RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 8; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; RCC_OscInitStruct.PLL.PLLN = 432; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLQ = 9; diff --git a/hw/bsp/stm32h743nucleo/stm32h743nucleo.c b/hw/bsp/stm32h743nucleo/stm32h743nucleo.c index b7071ed64..022827f5e 100644 --- a/hw/bsp/stm32h743nucleo/stm32h743nucleo.c +++ b/hw/bsp/stm32h743nucleo/stm32h743nucleo.c @@ -94,7 +94,7 @@ static void SystemClock_Config(void) RCC_OscInitStruct.CSIState = RCC_CSI_OFF; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 8; + RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; RCC_OscInitStruct.PLL.PLLN = 336; RCC_OscInitStruct.PLL.PLLP = 2; RCC_OscInitStruct.PLL.PLLQ = 7;