STM32CubeMX study notes (1)-build environment, compile and burn

1. Build the environment

1.1 Install Keil 5

Download from official website: http://www2.keil.com/mdk5/
Baidu Netdisk : https://pan.baidu.com/s/18t_ta0WWX_f1KCKXfgj_Zw Extraction code: gx3r

1.2 Install JRE

Since STM32CubeMX software runs based on the JAVA environment, it needs to install JRE to use it. STM32CubeMX requires the minimum JRE version to be 1.7.0_45.
Download from the official website: https://www.oracle.com/java/technologies/javase-jre8-downloads.html
Baidu Netdisk: Below the link of Baidu Netdisk

1.3 Install STM32CubeMX

Download from official website: https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/stm32cubemx .html
Baidu SkyDrive : https://pan.baidu.com/s/1r0liWTVxgUoxzg6yWd6YPA Extraction code: cl6e

1.4 Install STM32 library (firmware support package)

Click Help->Manage embedded software paclages

2. New construction

1. Open the STM32CubeMX software and click "New Project"

2. Choose MCU and package

3. Configure the clock
RCC settings, select HSE (external high-speed clock),

select Clock Configuration for Crystal/Ceramic Resonator (crystal oscillator/ceramic resonator) , configure the system clock SYSCLK to 72MHz,
modify the value of HCLK to 72, and press Enter. Automatically modify all configurations

4. It
is a very important step to configure the debug mode , otherwise the debugger
SYS setting will not be recognized after the first programming program , select Debug as Serial Wire

5. Configure GPIO
GPIO settings, find the corresponding pin of the LED light in the figure on the right, select GPIO_Output, output low level lights up, you can add a custom label

6. Generate code
Enter the project name and project path,

select the IDE development environment MDK-ARM V5 of the application, and

click GENERATE CODE to generate the code

Three, compile

Open Keil, click the button to compile

Fourth, burning

Select the debugger and method

Click the button to burn


Written by Leung on October 24, 2020

• Reference: STM32CubeMX series tutorial
    STM32CubeMX introduction, download and installation

Guess you like

Origin blog.csdn.net/qq_36347513/article/details/109260851