当前位置:网站首页>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 .




边栏推荐
- MySQL other hosts cannot connect to the local database
- Detailed reading of stereo r-cnn paper -- Experiment: detailed explanation and result analysis
- SSM integrated notes easy to understand version
- 【博主推荐】asp.net WebService 后台数据API JSON(附源码)
- Kubernetes - problems and Solutions
- [BMZCTF-pwn] 12-csaw-ctf-2016-quals hungman
- QT creator design user interface
- Leetcode 461 Hamming distance
- Copie maître - esclave MySQL, séparation lecture - écriture
- Neo4j installation tutorial
猜你喜欢

02 staff information management after the actual project

Summary of numpy installation problems

csdn-Markdown编辑器

Unable to call numpy in pycharm, with an error modulenotfounderror: no module named 'numpy‘
![[ahoi2009]chess Chinese chess - combination number optimization shape pressure DP](/img/7d/8cbbd2f328a10808319458a96fa5ec.jpg)
[ahoi2009]chess Chinese chess - combination number optimization shape pressure DP

35 is not a stumbling block in the career of programmers

Image recognition - pyteseract TesseractNotFoundError: tesseract is not installed or it‘s not in your path

【博主推荐】SSM框架的后台管理系统(附源码)

连接MySQL数据库出现错误:2059 - authentication plugin ‘caching_sha2_password‘的解决方法

Csdn-nlp: difficulty level classification of blog posts based on skill tree and weak supervised learning (I)
随机推荐
Image recognition - pyteseract TesseractNotFoundError: tesseract is not installed or it‘s not in your path
Windows cannot start the MySQL service (located on the local computer) error 1067 the process terminated unexpectedly
Ansible practical series I_ introduction
Install mysql5.5 and mysql8.0 under windows at the same time
windows无法启动MYSQL服务(位于本地计算机)错误1067进程意外终止
Test objects involved in safety test
Kubernetes - problems and Solutions
CSDN blog summary (I) -- a simple first edition implementation
[C language foundation] 04 judgment and circulation
自动机器学习框架介绍与使用(flaml、h2o)
Error connecting to MySQL database: 2059 - authentication plugin 'caching_ sha2_ The solution of 'password'
Postman Interface Association
Leetcode 461 Hamming distance
Database advanced learning notes -- SQL statement
引入了junit为什么还是用不了@Test注解
图像识别问题 — pytesseract.TesseractNotFoundError: tesseract is not installed or it‘s not in your path
【博主推荐】C# Winform定时发送邮箱(附源码)
Principes JDBC
[BMZCTF-pwn] 11-pwn111111
安全测试涉及的测试对象