/startup_stm32f10x_md.s/startup_stm32f10x_hd.s, which are respectively suitable for small capacity/medium capacity/large capacity STM32 chips. The specific judgment method is as follows:
In the startup code, add a few points:
Explanation of the two statements in the startup code:
1. PROC is the start of a subroutine, and ENDP is the end of a subroutine
2. [weak] means that the priority of this function is relatively weak. If a function with the same name is defined elsewhere, this function will be replaced. The syntax format is EXPORT label {[WEAK]}. EXPORT can be replaced by GLOBAL.
Understanding of the _main function:
In fact, _main and main are two completely different functions! The _main code is automatically created by the compiler, so it cannot be found. There is a statement in the MDK documentation: it is automatically craated by the linker when it sees a definition of main() . The general meaning can be understood as: when the compiler finds that the main function is defined, it will automatically create _main.
The relationship between _main and main
_main mainly does two things: first, it gets the resources needed by C; second, it calls the main function. This makes it easy to understand why the startup code calls _main, but the main function is finally executed.
Understanding the AREA Directive
The AREA directive is a pseudo-instruction used for segment definition. The ARM assembler consists of segments, which are relatively independent units of instructions or data. Each segment is defined by the AREA pseudo-instruction, which defines the attributes of the segment.
AREA parameter description:
*
*
*
READWRITE (read and write), READONLY (read only)
*
Example: Create a stack segment named STACK, define it as readable and writable, initialize the memory unit to 0, and align it to 8 bytes.
AREA STACK,NOINIT,READWRITE,ALIGN=3
Previous article:STM32 interrupt priority problem
Next article:Torque Loading Controller Design with RTX and TM4C Microcontrollers
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- Embedded SBC plays AI reasoning
- dsp28335 SCI Summary
- How to assign a separate segment to the bss of a C file in the link file?
- Voltage to Frequency Converter
- Why are PCBs mostly green?
- [GD32L233C-START Review] 5. UART+DMA receives variable length data
- 【TI Course】What is the resolution within 5 meters?
- Class AB amplifiers are replaced by Class D amplifiers
- About MSP430 MCU serial communication data loss
- ccs5.5 printf console output cannot be displayed