Simple analysis of STM32 startup file

Publisher:敬亭山人Latest update time:2017-10-25 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Simple analysis of STM32 startup file (applicable scope of STM32F10x.s) Timer, model, name in <>, all our routines use a startup file called STM32F10x.s, which defines the stack size of STM32 and the names of various interrupts and entry function names, as well as startup-related assembly code. STM32F10x.s is the startup code provided by MDK. From the content inside, it only defines 3 serial ports and 4 timers. In fact, the STM32 series products have models with 5 serial ports, and only models with 2 serial ports, and timers as well, with a maximum of 8 timers. For example, if you use STM32F103ZET6, and the startup file uses STM32F10x.s, you can use the interrupts of serial ports 1~3 normally, while the interrupts of serial ports 4 and 5 are not used normally. For example, the interrupts of TIM1~4 can be used normally, but those of 5~8 cannot be used.

Therefore, STM32F10x.s cannot be applied to all STM32 models. In this way, we have to choose different startup files for different STM32 models. ST provides us with 3 startup files, which are suitable for STM32 chips of different capacities. They are:

startup_stm32f10x_ld.s

startup_stm32f10x_md.s

startup_stm32f10x_hd.s

Among them, ld.s is suitable for small capacity products; md.s is suitable for medium capacity products; hd is suitable for large capacity products;

The capacity here refers to the size of FLASH. The judgment method is as follows:

Small capacity: FLASH≤32K

Medium capacity: 64K≤FLASH≤128K

Large capacity: 256K≤FLASH

Our development board uses STM32F103RBT6, which has a FLASH capacity of 128K and is a medium-capacity product. STM32F10x.s is just the startup file that meets the requirements of medium-capacity models, so there will be no problem using STM32F10x.s, which is equivalent to startup_stm32f10x_md.s. If yours is a small-capacity or large-capacity STM32, you can choose startup_stm32f10x_ld.s or startup_stm32f10x_hd.s accordingly.

Upload these startup files here. See the attachment for details.

 

 

cl: interconnect products, stm32f105/107 series

vl: value-for-money products, stm32f100 series

xl: ultra-high density products, stm32f101/103 series ultra-large capacity 512-1024K

ld: low-density product, FLASH is less than 64K

md: medium density product, FLASH=64 or 128

hd: high density product, FLASH greater than 128-512


Keywords:STM32 Reference address:Simple analysis of STM32 startup file

Previous article:stm32 serial communication
Next article:Common problems and solutions in the debugging process of stm32

Recommended ReadingLatest update time:2024-11-15 15:15

Summary of stm32 serial communication debugging
This article is divided into two parts, namely "Serial port initialization taking USART1 as an example" and "Problems encountered in debugging" Serial port initialization using USART1 as an example This program calls the firmware library that comes with stm32. The specific files in the project are shown in the figure
[Microcontroller]
Summary of stm32 serial communication debugging
STM32 controls common anode digital tube and common cathode digital tube
Common anode digital tube #include "stm32f10x.h"   u8table ={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80}; //Common anode digital tube 0 1 2 3 4 5 6 7 8 encoding   void delayms(u16 time) //delay function delay 1ms   {            u16i=0;            while(time--)            {                      i=12000;            
[Microcontroller]
STM32 study notes: lighting up the LED
Experimental Procedure: /******************************led.c****************** ******************/   #include "stm32f4xx.h" // can be found in the SYSTEM directory, extract some ST official libraries to form a SYSTEM directory   #include "sys.h"         void LED_Init(void){      RCC- AHB1ENR = 1 5; //Enable
[Microcontroller]
STM32 study notes: lighting up the LED
stm32 startup file selection
The low-capacity products refer to the STM32F101xx, STM32F102xx and STM32F103xx microcontrollers with Flash memory capacities between 16K and 32K bytes. The medium-capacity products refer to the STM32F101xx, STM32F102xx and STM32F103xx microcontrollers with Flash memory capacities between 64K and 128K bytes. The high-
[Microcontroller]
STM32 Learning Road-LCD (2)
I have been studying the LCD initialization function these days, because whether it is using the IO port to simulate the timing or using the FSMC to drive the LCD, the LCD initialization must be done well. Actually, the initialization of LCD is to write registers according to the LCD IC datasheet. Most of them use the
[Microcontroller]
The most concise stm32 encoder program
#define ROTATE_A  PAin(2) #define ROTATE_B PAin(3) s16 DATA=0;   void EXTI2_IRQHandler(void) {   if (EXTI_GetITStatus(EXTI_Line2) != RESET)   {     if(ROTATE_A!=ROTATE_B)      {         DATA++;          }         else DATA--;     EXTI_ClearITPendingBit(EXTI_Line2);   } }     v
[Microcontroller]
The most concise stm32 encoder program
STM32 AD is also very large without signal input
Reason: VREF+ is not connected to the network in the schematic diagram, resulting in the absence of this network on the PCB. Therefore, the data of the external channel is very large when no signal is added, and the number is not necessarily the same each time the power is turned on.
[Microcontroller]
STM32 AD is also very large without signal input
STM32 SysTick based on 3.5 library function
#include "stm32f10x.h" #include "led.h" #include stdio.h /*********************************************************************** ***********************************************************************/ static __IO uint32_t TimingDelay; /*********************************************************************** *
[Microcontroller]
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号