[STM32 MCU learning] Lesson 3: Introduction to the development board and Keil environment construction

[Mr. Zhu's course summary intrusion]

The first part, chapter list

3.3.1. STM32 development board detailed introduction

3.3.2. ISP download principle analysis of STM32 development board

3.3.3. STM32F4 floating-point unit

3.3.4. MDK5 development environment construction and introduction


Part Three, Classroom Record

3.3.1. STM32 development board detailed introduction

3.3.1.1. Overall introduction of the development board
(1) Schematic diagrams of various peripherals and motherboards

  • All peripherals used in STC51 can be used here!
  • STM32F103C8 schematic download address

(2) 3.3V and 5V power supply board portion compatibility design


3.3.1.2, STM32 described core plate
(1) Appearance core board

(2) in the bottom mounting plate core
as FIG

3.3.1.3, core board schematics
(1) Crystal
( 2) Power supply
(3) CAN interface
(4) pin definition and the mapping relationship between the backplane

  • In the future, you can first look at the schematic diagram to analyze which pins are needed, and then go to the IO pin diagram to find the corresponding pin P through the red letter


 

3.3.2. ISP download principle analysis of STM32 development board

3.3.2.1, USB download analysis
(1) Download process manual
(2) STM32 program download practical operation

3.3.2.2 Analysis of ISP download principle

(1) Review of ISP principle.

  • Step 1: First set BOOT1 and BOOT0 to start from the system area, and execute the program preset in the system
  • Step 2: The host sends the hex file to be downloaded to STM32 through the serial port
  • Step 3: After receiving hex, the preset program of the system will burn it into the flash of user area
  • Step 4: Set BOOT1 and BOOT0 to start from the user area, then reset and restart to execute the hex just downloaded

(2) BOOT pin setting

  • BOOT1 is always 0
  • BOOT0 must be 1 during ISP and 0 during normal operation.
  • BOOT0 and BOOT1 are controlled by picking the cap

3.3.2.3. Reset circuit design
(1) Power-on reset
(2) RSTK reset button reset
(3) Controlled reset after ISP download, controlled by RSTK1


3.3.3. STM32F4 floating-point unit

3.3.3.1. Fundamentals of floating-point arithmetic—the principle of composition
(1) What is floating-point arithmetic: Not all CPUs support floating-point arithmetic
(2) Two implementation methods of floating-point calculation:

  • Soft floating
    point Realizing floating point operations through floating point libraries is low in efficiency and low cost!
    The compilation environment supports floating-point libraries, which can convert floating-point operations written in C language into plastic operations. For the single-chip microcomputer, float and double are not known at all, so the single-chip microcomputer does not need to have a special floating-point operation unit. Floating point numbers too.
  • Hard floating
    point is completed by the floating point arithmetic unit (FPU), with high efficiency and high cost!

(3) Use of floating point arithmetic unit

  • F4 supports FPU, but it is not necessary and needs to be configured
  • Method of use: download FPU library and compilation options, open/close in Target in Keil5

3.3.3.2, F4 floating-point operation learning
(1) FPU: single-precision floating-point unit
Refer to "Cortex M3 and M4 Authoritative Guide.pdf"
1. F4 internal FPU can only be counted as float but not double
2. F4 internal FPU can only be counted Calculate the simple addition, subtraction, multiplication, and division of floats, but cannot calculate the complex calculations such as sin and cos of
floats. Ideal effect: we don’t need to consider the soft floating point or hard floating point characteristics of the CPU when programming, we can directly use C programming to realize the function, and then set it directly Compile.
                  Compile according to this rule: FPU can be used for floating-point operations when hard floating-point is used, and if hard floating-point cannot be used, soft floating-point is automatically implemented.

When a large number of double floating points or a large number of sin cos are used in the project, F4's FPU is invalid. At this time, it is recommended to use F1+ DSP (library function) to introduce the link


3.3.4. MDK5 development environment construction and introduction

3.3.4.1. The introduction of MDK5,  download, install and register links
(1) The relationship between MDK5 and keil C51

  • Both are two softwares of keil company (now acquired by ARM), and the installation method is the same as the cracking method!
  • C51 does not need to download the device support package, MDK5 needs to install the corresponding device support package according to the development board model

(2) MDK5 and keil C51 in Keil official website are separated

  • Need to install the crack separately

(3) MDK5 and Keil C51 can coexist in the same windows

  • Can share an icon

(4) The difference between MDK5 and MDK4

  • After MDK4 is downloaded, the device support package is also installed successfully, but many of them are not used, and some models are not yet available (such as F4 series)
  • After MDK5 is downloaded, users can selectively install the device support package online/offline, generally choose offline installation, online downloading is very slow

3.3.4.2, MDK5 experience
(1) Open the project and compile and download
(2) Menu bar browsing—and how to create a new one

Guess you like

Origin blog.csdn.net/qq_27148893/article/details/111415709