STM32CubeMX Series|Development Environment

Development environment setup

1. Introduction and installation of Keil MDK-ARM software

1.1 Introduction to Keil MDK-ARM

Keil MDK, also known as MDK-ARM, Realview MDK (Microcontroller Development Kit), currently provides technical support and related services by three domestic agents.
MDK-ARM software provides a complete development environment for devices based on Cortex-M, Cortex-R4, ARM7, and ARM9 processors. MDK-ARM is specially designed for microcontroller applications, not only easy to learn and easy to use, but also powerful, able to meet most demanding embedded applications.
MDK-ARM has four available versions, namely MDK-Lite, MDK-Basic, MDK-Standard, MDK-Professional. All versions provide a complete C/C++ development environment, and MDK-Professional also contains a large number of intermediate libraries.

1.2 Get Keil MDK-ARM

Keil MDK-ARM get
https://www.keil.com/demo/eval/arm.htm#/DOWNLOAD

1.3 Keil MDK-ARM installation
  • MDK-ARM software installation: After downloading the MDK software and STM32 device installation package, start to install the software (be careful not to have a Chinese path)
    Insert picture description here

  • ST-LINK programming tool installation: ST_LINK is an emulator of the STM32 chip. Use this software to operate ST_LINK to program the .hex file onto the chip. This software is used to burn the bootloader file for the kernel. The code we compiled in keil can be downloaded by itself.
    Insert picture description here

2. Introduction and installation of STM32CubeMX software

2.1 Introduction to STM32CubeMX
  • Intuitive selection of STM32 microcontrollers

  • Microcontroller graphical configuration
    -automatically handle pin conflicts
    -dynamically set the determined clock tree
    -dynamically determine the parameter settings of the peripheral and middleware modes and initialization
    -power consumption prediction

  • The C code project generator covers the initialization and compilation software of STM32 microcontrollers, such as IAR, KEIL, and GCC, which can be used independently as Eclipse plug-ins

2.2 STM32CubeMX acquisition

STM32CubeMX access
http://www.st.com/en/development-tools/stm32cubemx.html

2.3 STM32CubeMX installation

Insert picture description here
Install the JAVA operating environment; install STM32CubeMX after decompression (no Chinese path); download the corresponding STM32 device installation package in the software after installation

Insert picture description here

2.4 STM32CubeMX use
  • New project, select corresponding development MCU

Insert picture description here
Insert picture description here

  • RCC setting, select HSE (external high-speed clock) as Crystal/Ceramic Resonator (crystal oscillator/ceramic resonator)

Insert picture description here

  • Clock configuration, the highest clock of STM32F103 is 72M

Insert picture description here

  • Function peripheral configuration, take PC0/PC1 as an example, set GPIO pin related parameters

Insert picture description here

  • Generate a project report, enter the project name, select the project path (no Chinese), Toolchain/IDE select MDK-ARM V5, you can set the stack size generally by default; find the Generated files box in the Code Generator, and check Generated periphera initialization as a pair of'.c/.h' files per IP peripherals are initialized as independent C files and header files

Insert picture description here
Insert picture description here

  • Click GENERATE CODE to generate project code

Insert picture description here

  • Click Open Project to open the project, and the project peripheral initialization is configured so far; the initialization function of the PC0/PC1 pins can be seen in the gpio.c file; at this point, the user can write application programs according to their own needs

Insert picture description here

Guess you like

Origin blog.csdn.net/Chuangke_Andy/article/details/108556938