当前位置:网站首页>10 days based on stm32f401ret6 smart lock project practice day 1 (environment construction and new construction)

10 days based on stm32f401ret6 smart lock project practice day 1 (environment construction and new construction)

2022-06-13 01:50:00 It's Beichen bupiacra

10 Space based on STM32F401RET6 Smart lock project practice No 1 God ( Environmental construction and new construction projects )

One 、 Environment building

1、 install keil5
 Insert picture description here

2、 Install support package
Here, install the support package as required , Yes F4 and F1 The support package
 Insert picture description here
What's good about the installation keil5 Open the new project to see the chip selection

 Insert picture description here
 Insert picture description here

 Insert picture description here

3、 Crack software

Be careful : Run as administrator keil5
 Insert picture description here
 Insert picture description here

4、 Install serial port driver and downloader driver
There are two serial port drivers. Here we choose the first one
 Insert picture description here
 Insert picture description here
Let's download the downloader driver
 Insert picture description here

Two 、 New project

First, we create a folder , Names can be chosen at will , You can put it anywhere
 Insert picture description here
And then in LQY_2 Create several files in the folder
 Insert picture description here
And then in CMSIS There are some core files under the folder
 Insert picture description here
include The following files are placed in the folder
 Insert picture description here
lib The folder contains the chip .c.h The library files .c Files in src Under the folder .h Put it in inc Under the folder
 Insert picture description here

 Insert picture description here
protect Used to put keil5 Downloaded files
 Insert picture description here

stay keil5 When the program is compiled, it will be placed keil5 The file of
user Used to put the user's .c.h file .c Files in src Under the folder .h Put it in inc Under the folder , These will be put in later
 Insert picture description here
If you want to use peripherals later, you can see another one HARDWARE Folder , We won't build here , Use it later and build it again
Here the folder is set up , And then I'm going to keil5 Do the following
 Insert picture description here
 Insert picture description here
Put the document in protect Under the folder
 Insert picture description here
Then select the chip type
 Insert picture description here
Click... After selecting the chip ok That's all right.
Now let's put the file in keil5 Inside
 Insert picture description here
 Insert picture description here
stay CMSIS、lib、user Put them in separately .c file
 Insert picture description here
hold lib Under the folder src The folder .c Put all the files in , Except for the following two
 Insert picture description here
 Insert picture description here
hold main.c and main.h Save them separately to user Of src and inc Under the folder
 Insert picture description here
 Insert picture description here
Then take it. main.c and main.h Put it back keil5 in
 Insert picture description here
Here is the path of the header file
STM32F401xx,USE_STDPERIPH_DRIVER
The macro definition above is placed in define here , Note that English commas
Also, the following header file path should be included , The path contains only the first level folder
 Insert picture description here
At this point, a project file has been created
 Insert picture description here
If reading this blog post is helpful to you , Remember the praise. , Collection , Comments , Thank you for your support .

原网站

版权声明
本文为[It's Beichen bupiacra]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202280549162299.html