diff --git a/Core/Src/main.c b/Core/Src/main.c index 7c9d785..450c9bf 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -114,7 +114,12 @@ void SystemClock_Config(void) */ __HAL_RCC_PWR_CLK_ENABLE(); __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI; + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) + { + Error_Handler(); + } /** Initializes the RCC Oscillators according to the specified parameters * in the RCC_OscInitTypeDef structure. */ diff --git a/stm32f4discovery.cfg b/stm32f4discovery.cfg new file mode 100644 index 0000000..1174370 --- /dev/null +++ b/stm32f4discovery.cfg @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +# This is an STM32F4 discovery board with a single STM32F407VGT6 chip. +# http://www.st.com/internet/evalboard/product/252419.jsp + + +# 去OpenOCD的路径下去找这个文件 +source [find interface/stlink.cfg] +#如果用DAP调试器就取消 下面的注释,并注释掉上方代码 +#source [find interface/cmsis-dap.cfg] + +transport select hla_swd + +source [find target/stm32f4x.cfg]