当前位置:网站首页>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 .
边栏推荐
- 安装numpy问题总结
- 解决安装Failed building wheel for pillow
- Ansible practical Series III_ Task common commands
- Introduction and use of automatic machine learning framework (flaml, H2O)
- The virtual machine Ping is connected to the host, and the host Ping is not connected to the virtual machine
- A trip to Macao - > see the world from a non line city to Macao
- Postman Interface Association
- CSDN question and answer module Title Recommendation task (II) -- effect optimization
- Swagger, Yapi interface management service_ SE
- 软件测试与质量学习笔记3--白盒测试
猜你喜欢
AcWing 1298.曹冲养猪 题解
Learning question 1:127.0.0.1 refused our visit
CSDN blog summary (I) -- a simple first edition implementation
Image recognition - pyteseract TesseractNotFoundError: tesseract is not installed or it‘s not in your path
学习问题1:127.0.0.1拒绝了我们的访问
Unable to call numpy in pycharm, with an error modulenotfounderror: no module named 'numpy‘
安装numpy问题总结
【博主推荐】C# Winform定时发送邮箱(附源码)
机器学习--人口普查数据分析
QT creator runs the Valgrind tool on external applications
随机推荐
La table d'exportation Navicat génère un fichier PDM
Did you forget to register or load this tag
Why is MySQL still slow to query when indexing is used?
CSDN blog summary (I) -- a simple first edition implementation
记某公司面试算法题:查找一个有序数组某个数字出现的次数
Learning question 1:127.0.0.1 refused our visit
AcWing 179.阶乘分解 题解
导入 SQL 时出现 Invalid default value for ‘create_time‘ 报错解决方法
[free setup] asp Net online course selection system design and Implementation (source code +lunwen)
[C language foundation] 04 judgment and circulation
【博主推荐】C#生成好看的二维码(附源码)
Rhcsa certification exam exercise (configured on the first host)
CSDN question and answer tag skill tree (I) -- Construction of basic framework
Other new features of mysql18-mysql8
In the era of DFI dividends, can TGP become a new benchmark for future DFI?
Swagger, Yapi interface management service_ SE
Why can't I use the @test annotation after introducing JUnit
Swagger、Yapi接口管理服务_SE
[Thesis Writing] how to write function description of jsp online examination system
Armv8-a programming guide MMU (2)