Understanding the Firmware Library (1) and the Firmware Library

Source: Internet
Author: User

Understanding the Firmware Library (1) and the Firmware Library

 

When we use the STM32 Firmware Library, we need to understand the structure of the Firmware Library package officially provided.

Folder introduction:

The Libraries of the Firmware Library package has two directories: CMSIS and STM32F10x-StdPeriph-Driver, which contain all subfolders of the kernel of the Firmware Library.

STM32F10x-StdPeriph-Driver // directory for the Firmware Library source code;
CMSIS // Startup File with inc and src folders, placed in stm32f10x-xxx.h and stm32f10x-xxx.c, each peripherals corresponds to a file;
Project // store the instance Source Code officially provided by ST;

File introduction:

Core-cm3.c core-cm3.h // provides access to the Cortex-M3 kernel interface, under the Coresupport directory
System-stm32f10x.c system-stm32f10x.h // set system and clock bus, under DeviceSupport directory
Stm32f10x. h // multi-struct and macro definition, under the DeviceSupport directory
Startup-stm32f10x-ld.s
Startup-stm32f10x-md.s
Startup-stm32f10x-hd.s // For the 103 series there are three main startup files respectively small, medium, large

The Startup File is mainly used to initialize the stack, interrupt vector table, and interrupt function definition. The Startup file should be directed to the main function. The Rest-Handler interrupt function is the only interrupt Handler implemented. Other interrupt functions are basically endless loops:

Rest handler
Reset-Handler PROC
EXPORT Reset-Handler
IMPORT --main
IMPORT SystemInit
LDR R0,=SystemInit
BLX R0
LDR R0,=--main
BX R0
ENDP

After the above Code is started, the system first calls the SystemInit system initialization function and then enters the main function.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.