当前位置:网站首页>How to build a new project for keil5mdk (with super detailed drawings)
How to build a new project for keil5mdk (with super detailed drawings)
2022-07-06 11:15:00 【Mo tuoruxi】
One Build an engineering framework
1. Create a new folder on your computer , Name it Template
2.

3. Choose chip model ( Be sure to install the corresponding device pack Will show these inside Rong oh !)
Click on OK, If other interfaces appear , Click Cancel ;MDK Will pop up Manage Run-Time Environment Dialog box , We don't introduce it here , Click on Cancel that will do
Get the following interface , Here we only make a framework , You also need to add startup code , as well as .c Documents, etc.
here USER The folder will be as shown in the following figure (Template.uvprojx It's engineering documents , It's critical , It can't be deleted easily .Listings and Objects The folder is MDK Automatically generated folder , Used to store intermediate files generated during compilation ) We choose to put Listings and Objects These two folders are deleted , In the next step, rebuild the folder .
Two stay Template work Under the program directory , newly build 3 A folder CORE, OBJ as well as STM32F10x_FWLib.
Used to store core files and startup files ,OBJ It is used to store compilation process files and hex file ,STM32F10x_FWLib As the name suggests, folders are used to store ST Official library function source file .USER The directory is used to put project files , And store the main function file main.c, And others include system_stm32f10x.c wait .
3、 ... and Copy the source code file in the official firmware library package to our project directory (CORE, OBJ ,STM32F10x_FWLib) Under the folder
1 STM32F10x_FWLib Folder

2. CORE Folder ( Startup file )

3 USER Folder
(1)


5、 ... and towards Group Add the files we need
1 FWLID
2 CORE
3 USER
So the files we need to add have been added to me We are in the project , Finally, click OK, Back to the main project interface .
6、 ... and Generate compiled files
7、 ... and Add header file
8、 ... and Configure global macro definition variables
Nine Open the project USER Below main.c file , Copy the following overlay before compiling main.c The procedure in , Remember to return on the last line (enter), Otherwise, there will be a warning during compilation .
#include "stm32f10x.h"
void Delay(u32 count)
{
u32 i=0;
for(;i<count;i++);
}
int main(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB|
RCC_APB2Periph_GPIOE, ENABLE); //?? PB,PE ????
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; //LED0-->PB.5 ????
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //????
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //IO ???? 50MHz
GPIO_Init(GPIOB, &GPIO_InitStructure); //??? GPIOB.5
GPIO_SetBits(GPIOB,GPIO_Pin_5); //PB.5 ???
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; //LED1-->PE.5 ????
GPIO_Init(GPIOE, &GPIO_InitStructure); //??? GPIO
GPIO_SetBits(GPIOE,GPIO_Pin_5); //PE.5 ???
while(1)
{
GPIO_ResetBits(GPIOB,GPIO_Pin_5);
GPIO_SetBits(GPIOE,GPIO_Pin_5);
Delay(3000000);
GPIO_SetBits(GPIOB,GPIO_Pin_5);
GPIO_ResetBits(GPIOE,GPIO_Pin_5);
Delay(3000000);
} }
Recompile the code , We can be in OBJ I see it in the folder .hex file .


边栏推荐
- Install mongdb tutorial and redis tutorial under Windows
- Csdn-nlp: difficulty level classification of blog posts based on skill tree and weak supervised learning (I)
- 数据库高级学习笔记--SQL语句
- QT creator uses Valgrind code analysis tool
- CSDN question and answer tag skill tree (I) -- Construction of basic framework
- CSDN question and answer tag skill tree (II) -- effect optimization
- Image recognition - pyteseract TesseractNotFoundError: tesseract is not installed or it‘s not in your path
- 01项目需求分析 (点餐系统)
- npm一个错误 npm ERR code ENOENT npm ERR syscall open
- Learning question 1:127.0.0.1 refused our visit
猜你喜欢
La table d'exportation Navicat génère un fichier PDM
MySQL master-slave replication, read-write separation
Install mysql5.5 and mysql8.0 under windows at the same time
【博主推荐】C#生成好看的二维码(附源码)
CSDN markdown editor
[download app for free]ineukernel OCR image data recognition and acquisition principle and product application
In the era of DFI dividends, can TGP become a new benchmark for future DFI?
Data dictionary in C #
学习问题1:127.0.0.1拒绝了我们的访问
A brief introduction to the microservice technology stack, the introduction and use of Eureka and ribbon
随机推荐
Ansible实战系列一 _ 入门
Swagger, Yapi interface management service_ SE
QT creator shape
35 is not a stumbling block in the career of programmers
Idea import / export settings file
[BMZCTF-pwn] 11-pwn111111
AcWing 179.阶乘分解 题解
Navicat 导出表生成PDM文件
Install mongdb tutorial and redis tutorial under Windows
CSDN Q & a tag skill tree (V) -- cloud native skill tree
windows下同时安装mysql5.5和mysql8.0
虚拟机Ping通主机,主机Ping不通虚拟机
数数字游戏
Ubuntu 20.04 安装 MySQL
导入 SQL 时出现 Invalid default value for ‘create_time‘ 报错解决方法
Kubesphere - deploy the actual combat with the deployment file (3)
【博主推荐】C# Winform定时发送邮箱(附源码)
Detailed reading of stereo r-cnn paper -- Experiment: detailed explanation and result analysis
Picture coloring project - deoldify
Other new features of mysql18-mysql8