STM32 study notes development environment

Publisher:SparklingRiverLatest update time:2017-11-06 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

This article mainly consists of two parts: one is the introduction and installation of the STM32 development environment MDK-ARM, and the other is the download and configuration of the STM32 official library files.

1. Development environment installation

1. Introduction to the development environment

KEIL currently has four independent embedded software development tools, namely MDK, KEIL C51, KEIL C166, and KEIL C251. They are all products under the KEIL brand and are based on the uVision integrated development environment. MDK is a member of the RealView series. MDK-ARM, KEIL MDK, RealView MDK, and KEIL For ARM are all the same thing. ARM now uniformly uses the name MDK-ARM.

KEIL MDK development tool is from Keil of Germany. It has been verified and used by more than 100,000 embedded development engineers worldwide. It is the latest software development tool for various embedded processors launched by ARM. KEIL MDK integrates the most advanced technologies in the industry, including µVision5 integrated development environment and RealView compiler. It supports ARM7, ARM9 and the latest Cortex-M3/M1/M0 core processors, automatically configures startup code, integrates Flash burning module, powerful Simulation device simulation, performance analysis and other functions. Compared with ARM's previous toolkit ADS, the latest version of RealView compiler can improve performance by more than 20%. KEIL MDK has outstanding price and function advantages and has become the standard of ARM software development tools. At present, KEIL MDK has reached 90% of the market share in the domestic ARM development tool market. The latest version 5.4 is used here.


As can be seen from the above figure, MDKCore is divided into four parts: uVisionIDE with Editor, ARMC/C++ Compiler, PackInstaller, and uVisionDebugger with Trace. uVision IDE has added practical functions such as code prompts and dynamic syntax detection since MDK4.7, which is a great improvement over previous IDEs. SoftwarePacks (package installer) is divided into three small parts: Device (chip support), CMSIS (ARMCortex microcontroller software interface standard) and Mdidleware (intermediate library). Through the package installer, we can install the latest components to support new devices, provide new device driver libraries and the latest routines, etc., to accelerate product development progress. Unlike the previous MDK, which included all components in one installation package, which was very "bulky", MDK5 is different. MDKCore is an independent installation package, which does not include components such as device support and device drivers, but generally includes CMSIS components, with a size of about 350M, which is much smaller than MDK4.70A's 500M. It is also worth mentioning that after MDK5 is installed, in order to make MDK5 support the development of STM32F103, we also need to install the STM32F1 device support package: Keil.STM32F1xx_DFP.1.0.5.pack (STM32F1 device package).

(II) Development environment installation

 1 Download MDK5 integrated development environment 

(1) Download from the official website

(2) Third-party downloads

(3) Online cracked version

2 Installing the Integrated Development Environment

(1) Click the executable file and the following page will pop up.


(2) Select the installation path as shown below. It is best not to use the Chinese path.


(3) Finally, the following interface pops up, indicating that the CMSIS and MDK intermediate software packages have been successfully downloaded. The progress indicator below indicates that the program is automatically downloading various support packages from the KEIL official website (if the support package download fails, proceed to the next step)


(4) Download and install the STM32F1xx support library. Select STMicroelectronics STM32F1 Series Device Support, Drivers and Examples.

3 If it is a cracked version, crack it

2. STM32 firmware library

  1  STM32 library download , select STSW-STM32054, STM32F10x standard peripheral library

  2 After decompression, the following file directory is obtained


Libraries standard peripheral libraries include CMSIS and STM32F10x_StdPeriph_Driver. CMSIS is a vendor-independent hardware abstraction layer for the Cortex-M processor series, which provides a simple processor software interface for chip manufacturers and middleware suppliers, simplifies software reuse, reduces the difficulty of porting operating systems on Cortex-M, and reduces the learning curve and time to market for new microcontroller developers. STM32F10x_StdPeriph_Driver includes driver functions corresponding to all peripherals, which are written in C language and provide a unified, easy-to-call function interface for developers to use.

The Project folder includes all ST official routines and project templates based on different compilers. These routines are important references for learning and using STM32.

Utilities contains sample programs and driver functions for related evaluation boards for developers using official evaluation boards. Many driver functions can also serve as important references for learning.

  3 STM32 library usage architecture

The STM32F10xxx standard peripheral library architecture is shown in the figure below. The figure shows the connection between each layer and specific files.



The specific functions of each file in the figure are described in the following table

file name

Functional Description

Specific function description

core_cm3.h

core_cm3.c

Cortex-M3 core and its device files

Libraries\CMSIS\CM3\CoreSupport

Access to the Cortex-M3 core and its devices: NVIC, SysTick, etc.

Functions for accessing the Cortex-M3 CPU registers and core peripherals

 

stm32f10x.h

Microcontroller-specific header files

Libraries\CMSIS\CM3\DeviceSupport

\ST\STM32F10x

This file contains the definition of all peripheral registers of the STM32F10x series (base address and layout of registers), bit definition, interrupt vector table, address mapping of storage space, etc.

 

system_stm32f10x.h

system_stm32f10x.c

Microcontroller-specific system files

Libraries\CMSIS\CM3\DeviceSupport

\ST\STM32F10x

Function SystemInit, used to initialize the microcontroller

Function Sysem_ExtMemCtl, used to configure the external memory controller

startup_stm32f10x_Xd.s

Compiler startup code

Libraries\CMSIS\CM3\DeviceSupport

\ST\STM32F10x\startup\arm

List of interrupt handlers specific to the microcontroller (consistent with the header file)

 

stm32f10x_conf.h

Firmware library configuration file

Project\STM32F10x_StdPeriph_Template

The peripherals used by the firmware library are selected by changing the included peripheral header files. The corresponding configuration should be modified first before creating a new program and making functional changes.

 

stm32f10x_it.h

stm32f10x_it.c

Peripheral interrupt function file

Project\STM32F10x_StdPeriph_Template

Users can add their own interrupt program code accordingly. For multiple different interrupt requests pointing to the same interrupt vector, users can determine the exact interrupt source by judging the interrupt flag bit of the peripheral and execute the corresponding interrupt service function.

 

stm32f10x_ppp.h

stm32f10x_ppp.c

Peripheral driver function file

Libraries\STM32F10x_StdPeriph_Driver

It includes the initialization configuration of related peripherals and some functional application functions, which is an important part of realizing programming functions.

 

Application.c

User documentation

User program files perform corresponding peripheral configuration and function design through the interfaces provided by the standard peripheral library.

 

  4 STM32 peripheral library configuration

(1) Create a new directory, a new application project directory, and add the following files from the peripheral library. 

Table of contents

Overview

Copy directories and files

User


main.c

Sys


Project\STM32F10x_StdPeriph_Template \stm32f10x_it.h

Project\STM32F10x_StdPeriph_Template\ stm32f10x_it.c

Project\STM32F10x_StdPeriph_Template\ stm32f10x_conf.h

Libraries\CMSIS\CM3\DeviceSupport

\ST\STM32F10x\stm32f10x.h

Libraries\CMSIS\CM3\DeviceSupport

\ST\STM32F10x \system_stm32f10x.h

Libraries\CMSIS\CM3\DeviceSupport

\ST\STM32F10x \system_stm32f10x.c

Lib

STM32 library functions

Libraries\STM32F10x_StdPeriph_Driver/src

Libraries\STM32F10x_StdPeriph_Driver/inc

Core

System Files

Libraries\CMSIS\CM3\DeviceSupport

\ST\STM32F10x\startup\arm\startup_stm32f10x_ld.s

Libraries\CMSIS\CM3\CoreSupport \core_cm3.h

Libraries\CMSIS\CM3\CoreSupport \core_cm3.c

Bin

Compile and generate files



(2) New construction projects and new application projects

(3) File configuration


  • Open the project management interface

  • Modify project options (optional)

  • Corresponding to the directory in (1), add a file group

  • In the file group, add the source files corresponding to the folder in (1)



  5 Project Configuration

(1) Target configuration


(2) Output configuration

(3) Macro definition and header file reference


Keywords:STM32 Reference address:STM32 study notes development environment

Previous article:STM32 study notes clock analysis
Next article:The difference between various clocks of STM32

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号