跟着100ASK_STM32F103_MINI用户手册V1.1.pdf的第7章步骤进行Keil工程的创建。
文章目录
1 创建相关文件夹
在文件夹下新建5个子文件夹:Core、Driver、Main、Project、SDK,如下图所示
将下列的5个文件复制粘贴到 Core 文件夹下
"STM32Cube_FW_F1_V1.8.0\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\arm\startup_stm32f103xb.s"
"STM32Cube_FW_F1_V1.8.0\Projects\STM3210E_EVAL\Templates\Src\system_stm32f1xx.c"
"STM32Cube_FW_F1_V1.8.0\Projects\STM3210E_EVAL\Templates\Src\stm32f1xx_it.c"
"STM32Cube_FW_F1_V1.8.0\Projects\STM3210E_EVAL\Templates\Inc\stm32f1xx_it.h"
"STM32Cube_FW_F1_V1.8.0\Projects\STM3210E_EVAL\Templates\Inc\stm32f1xx_hal_conf.h"
2 创建“main.c/h”和“stm32f1xx_clk.c/h”
并且在 Core 文件夹下新建"stm32f1xx_clk.h"和stm32f1xx_clk.c",这两个文件的内容分别如下
stm32f1xx_clk.h
/* Copyright (s) 2019 深圳百问网科技有限公司
* All rights reserved
*
* 文件名称:文件名称:stm32f1xx_clk.h
* 摘要:
*
* 修改历史 版本号 Author 修改内容
*--------------------------------------------------
* 2020.6.6 v01 百问科技 创建文件
*--------------------------------------------------
*/
#ifndef __STM32F1XX_CLK_H
#define __STM32F1XX_CLK_H
#ifdef __cplusplus
extern "C" {
#endif
extern void SystemClock_Config(void);
#ifdef __cplusplus
}
#endif /* cplusplus */
#endif /* system_clk.h */
stm32f1xx_clk.c
/* Copyright (s) 2019 深圳百问网科技有限公司
* All rights reserved
*
* 文件名称:stm32f1xx_clk.c
* 摘要:
*
* 修改历史 版本号 Author 修改内容
*--------------------------------------------------
* 2020.6.6 v01 百问科技 创建文件
*--------------------------------------------------
*/
#include "stm32f1xx_hal.h"
#include "stm32f1xx_clk.h"
/**
* @brief System Clock Configuration
* The system Clock is configured as follow :
* System Clock source = PLL (HSI)
* SYSCLK(Hz) = 72000000
* HCLK(Hz) = 72000000
* AHB Prescaler = 1
*