[STM32 Standard Library] Create a new project using keil5

1. STM32 standard library

You can go to the ST official website to obtain STM32F10x_StdPeriph_Lib_V3.6.0 by yourself. After the compressed package is opened, there are the following files:

 2. New construction

Create a new folder WarGod, and create the following folders CMSIS, FWLIB, USER, keil5_project

 Copy all the files of \Libraries\CMSIS\CM3\CoreSupport and \CMSIS\CM3\DeviceSupport\ST\STM32F10x of the standard library to \WarGod\CMSIS to get the files in the figure below

 Copy all the files of \Libraries\STM32F10x_StdPeriph_Driver of the standard library to \WarGod\FWLIB to get the following file

 Copy these files in \Project\STM32F10x_StdPeriph_Template of the standard library to \WarGod\USER, as shown in the figure:

 

 Open keil5, create a new project, and save it to \WarGod\keil5_project

 

 Select the chip used in the project and click OK, if a pop-up window appears after OK, just delete it

 Click the icon below and add your own group

 

 Add the following files to the CMSIS folder

Add the following files to the USER folder

Add all files in \WarGod\FWLIB\src to FWLIB folder

The STARTUP folder selects the startup file according to its own chip, because it uses a high-capacity chip, so choose the startup_stm32f10x_hd.s of \WarGod\CMSIS\startup\arm

 Select the magic wand, C/C++ setting interface, write USE_STDPERIPH_DRIVER in the define column, and add the header file path in the includepath column.\CMSIS;.\FWLIB\inc;.\USER

 In the main.c file, you can get rid of the redundant things, turn on a light, and the compilation is no problem. So far, the new project has been created.

Guess you like

Origin blog.csdn.net/weixin_46183891/article/details/128351804