Create a simple engineering template with STM32 firmware library V3.5.0

First, open Keil, select Project-"New uVision Project, select the appropriate folder, enter the project name, click Save, and create the project.

As shown in the figure below, create a project named stm32_demo under the Template folder.

Create a simple engineering template with STM32 firmware library V3.5.0

Then we select the device, take STM32F103RB as an example (STM32 other series can be analogized), select STM32F103RB in STMicroelectronics column, as shown below, we can see the description of the chip on the right side of the figure.

Create a simple engineering template with STM32 firmware library V3.5.0

Click OK and the following dialog box pops up, asking if you need to add a startup file (this startup file is included with MDK).

Create a simple engineering template with STM32 firmware library V3.5.0

Here, select No (N), we will add the startup file in the STM32 firmware library.

Next, we need to create several file groups to store different source files, so that the entire project directory structure is clear, click Create a simple engineering template with STM32 firmware library V3.5.0 middle Create a simple engineering template with STM32 firmware library V3.5.0 After the following figure

Create a simple engineering template with STM32 firmware library V3.5.0

Click Create a simple engineering template with STM32 firmware library V3.5.0 middle Create a simple engineering template with STM32 firmware library V3.5.0 Can create a file group, Create a simple engineering template with STM32 firmware library V3.5.0 You can delete the group. Below we will create four file groups: User, StdPeriph_Drive, CMSIS, MDK-ARM. User is used to store files related to the user. StdPeriph_Drive is used to store peripheral driver files in the library function. CMSIS is used to place The file related to the Cortex_M3 kernel, MDK-ARM is used to store the startup file. After the file group is created, as shown in the figure below.

Create a simple engineering template with STM32 firmware library V3.5.0

Click OK, we can see the file group as shown below

Create a simple engineering template with STM32 firmware library V3.5.0

Next, we will operate on the firmware library folder (shown below) and the files in the Template folder.

Create a simple engineering template with STM32 firmware library V3.5.0

Copy the Libraries folder in the firmware library folder to the project directory (that is, under the Template folder just created), and create two folders, User and Output, under Template, and User is used to put files related to user code. Output is used to store intermediate files generated after compilation.

Open the Template folder as shown below.

Create a simple engineering template with STM32 firmware library V3.5.0

Then

STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_Stdperiph_Examples\GPIO\IOToggle

In the directory, the main.c, stm32f10x_conf.h, stm32f10x_it.h, stm32f10x_it.c four files are copied to the User directory.

At this point, the operation of the file ends.

Re-click Create a simple engineering template with STM32 firmware library V3.5.0 Now we have to add files to each filegroup.

The first is the User file group, click Add Files, and then add 3 C files under the User folder, as shown below.

Create a simple engineering template with STM32 firmware library V3.5.0

Kitchen Range Hood motor

Kitchen Range Hood Motor,Range Hood Motor,Kitchen Range Hood,Range Hood Fan Motor

WUJIANG JINLONG ELECTRIC APPLIANCE CO., LTD , https://www.jinlongmotor.com

Posted on