01, STM32 compiler environment installed

1. Go to the official website to download keil keil5 editor (currently using MDK-Arm)

2. Make the installation, if the following dialog box appears, choose not to install

3. Detection of environment variables

有的人的Windows用户名是中文,会在编译代码的过程中出现错误,可以按照以下步骤进行解决

    1.在C盘的顶层目录下创建一个Temp文件夹,保证文件的路径为:C:\Temp

    2.在计算机属性中配置环境变量

4. Installation library function

进入http://www.keil.com/dd2/pack下载stm32f4的库函数,选择一个稳定的版本
下载完后直接点击安装

5. Create Project

1.在菜单栏project中选择New uVision Project

2.在弹出的对话框中填写创建工程的名字,如:project

3.保存工程,并选择对应的芯片(这里是STM32F407)


4. Add the appropriate library function engineering


5. Add the project file in the directory main.c

6. Configuration Editor

 1.在菜单栏Edit中选择Configuration


2. Encoding options for Chinese GB2312 (Simplified), here to support Chinese characters, Chinese characters encounter will not be garbled; Tab Size 4 selected, press the Tab key on behalf of the time, they default input four spaces

3. Add auto-complete function

7. Platform Configuration

1.点击Options for Target,进入目标平台配置标签页


2. Check the resulting output file Hex, Hex file used in the burning process when the serial

3. Optimization of C / C ++ code in the checking of the level recommended Level 2 (-O2), define: USE_STDPERIPH_DRIVER in system_stm32f4xx.c the stem32f4xx.h in

8. download

1.下载前,请确保j-link仿真下载器已经正确连接到开发板的SWD接口,确保micro usb线是数据线,而不是充电线。

2.下载前,请确保j-link的驱动已经安装好,若没有安装好,请安装Setup_JLinkARM_V415e.exe

3.进入平台配置,切换到Debug标签页,然后按照下图选中J-Link/J-TRACE Cortex,接着点击Settings按钮。


4. port: SW is selected, then the display box can be seen SW Device device name, represents that the computer can recognize chip development board.

5. In Flash Download, select the Reset and Run, so after downloading the program, the program will run automatically.

6. Download

7. Run the program you can press F7 or click on one of them

Guess you like

Origin www.cnblogs.com/lp06/p/11991531.html