当前位置:网站首页>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 .
边栏推荐
- Leetcode 461 Hamming distance
- [recommended by bloggers] asp Net WebService background data API JSON (with source code)
- Postman uses scripts to modify the values of environment variables
- 引入了junit为什么还是用不了@Test注解
- The virtual machine Ping is connected to the host, and the host Ping is not connected to the virtual machine
- [recommended by bloggers] background management system of SSM framework (with source code)
- ++Implementation of I and i++
- SSM整合笔记通俗易懂版
- Ansible practical series I_ introduction
- One click extraction of tables in PDF
猜你喜欢
自动机器学习框架介绍与使用(flaml、h2o)
windows无法启动MYSQL服务(位于本地计算机)错误1067进程意外终止
Redis的基础使用
When you open the browser, you will also open mango TV, Tiktok and other websites outside the home page
[recommended by bloggers] asp Net WebService background data API JSON (with source code)
Idea import / export settings file
Django running error: error loading mysqldb module solution
连接MySQL数据库出现错误:2059 - authentication plugin ‘caching_sha2_password‘的解决方法
Csdn-nlp: difficulty level classification of blog posts based on skill tree and weak supervised learning (I)
Invalid global search in idea/pychar, etc. (win10)
随机推荐
Tcp/ip protocol (UDP)
Invalid global search in idea/pychar, etc. (win10)
Base de données Advanced Learning Notes - - SQL statements
neo4j安装教程
Invalid default value for 'create appears when importing SQL_ Time 'error reporting solution
Postman environment variable settings
Ansible practical Series III_ Task common commands
导入 SQL 时出现 Invalid default value for ‘create_time‘ 报错解决方法
数数字游戏
JDBC principle
[recommended by bloggers] C WinForm regularly sends email (with source code)
Development of C language standard
Ansible实战系列一 _ 入门
Rhcsa certification exam exercise (configured on the first host)
C language advanced pointer Full Version (array pointer, pointer array discrimination, function pointer)
SSM整合笔记通俗易懂版
Dotnet replaces asp Net core's underlying communication is the IPC Library of named pipes
Have you mastered the correct posture of golden three silver four job hopping?
A brief introduction to the microservice technology stack, the introduction and use of Eureka and ribbon
[ahoi2009]chess Chinese chess - combination number optimization shape pressure DP