When writing a program for STM32, we need to add the startup file provided by the manufacturer to the project file (here we take the STMf10x series as an example), which contains the startup code. The startup code is a piece of assembly code related to the hardware. It is indispensable! The main functions of this code are as follows:
1. Initialization of the stack (SP);
2. Initialize the program counter (PC);
3. Set the entry address of the vector table exception event;
4. Call the main function.
These are all preparations. It doesn’t matter if you don’t understand it at the moment. After all, the file is written in assembly language. . . . .
Let's take a look at the three files provided by ST, which are used for STM32 chips of different capacities. These three files 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.s 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
In other words, you need to choose different startup files according to the size of your STM32 capacity, otherwise various errors will easily occur.
Previous article:In-depth analysis of STM32 startup files
Next article:ucOS_II transplantation: Stm32 startup code analysis
Recommended ReadingLatest update time:2024-11-16 17:48
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- When we make PCB, should we provide steel mesh files to the board factory?
- Buying an Apple phone without a charger violated the Consumer Protection Law and was ordered to pay 7,000 yuan
- MSP430 program burning problem in IAR
- If you had 100,000, what would you choose to do?
- Voltage Follower
- Let’s talk about RCD calculation
- Pre-registration for the prize-winning live broadcast | Microsoft and Avnet join forces to help you quickly start your IoT security journey
- Using cycloneIV for smoke detection, the reading has not changed
- [CY8CKIT-149 PSoC 4100S Review] + Porting Program Code
- Source program simulation file based on 51 single-chip multifunctional intelligent desk lamp (with clock, posture correction, display temperature and brightness)