Since these things are really worthless to publish in a paper, but I feel that they can serve as an introduction to ARM development. Due to my limited level and experience, mistakes are inevitable. But if I don't share them with you, I won't be able to find them even if there are mistakes, right? Haha. I will try to publish the first article in the series now to see how valuable it is. If you think it is valuable, I will continue to serialize.
Series 1:
Preface
This document is a summary and experience of my study of ARM programming. People who read this document should first read the help documents and related content of ADS1.2. This document will not make a detailed description of the compiler and connector, and will point out the specific content in the chapter of the relevant materials when necessary. At the same time, people who read this document need to understand the ARM instruction set and some basic content of ARM assembly as well as related programming content of C and C++. At the same time, you also need to understand the pipeline structure of ARM and some basic programming knowledge. At the same time, in order to facilitate the reference of English documents, all relevant terms are in the original English.
Chapter 1 STARTUP
1 ARM startup
Before the main program is executed, general embedded systems need to perform some initialization processes to create an environment for embedded program operation, especially some advanced embedded systems. Because the core chip uses memory mapping, memory protection and other mechanisms, and the programming uses high-level languages C, C++ and even JAVA, it is necessary to first create a hardware environment suitable for program operation, and then initialize or configure or trim the run-time library. These tasks must be completed before the main program is run, so a startup program or program group is very important for an embedded system. To write a startup program, you need to have a certain understanding of the details of the compiler, linker and assembler, and you also need to have some understanding of the address allocation and memory mapping mechanism of the ARM chip hardware itself.
2 The working process of the ARM program
is first compiled from various source files to generate object files, and then the object files are linked to generate Image files, and then downloaded to the specified address of the solid-state memory on the target board, such as flash, EEPROM, ROM, etc., according to the description file. Before the program is executed, according to certain description files, the part of the data that needs to be read and written is read out and placed in the dynamic memory such as RAM, and then the program starts to execute from ROM. Or sometimes, in order to improve the running speed of the program, all programs (except for some root parts, which will be mentioned later) can be placed in the specified RAM through a description file, and then the program will start to execute from the RAM, but this will consume a lot of dynamic memory, so most programs will take a compromise method, putting the parts that need to run quickly and the parts that need to be read and written into the RAM (generally, the process of reading solid-state memory is the same as the process of dynamic memory, but writing is different, so the read-write part must be placed in the RAM), and the read-only part and the part that does not require such high speed into the solid-state memory. At the same time, the exception vector table of the ARM structure is stipulated to be placed in the address space starting at address 0x00000000, and the general CPU will remap this vector segment to other RAM in order to improve the exception response speed, so the address of the exception vector jump program must be accurately specified in the description file to the remap location. Before the application program is executed, some files are also needed to describe the environment in which the application program is executed. For example, the system working clock and bus frequency. The general embedded programming languages now are C, C++, etc. If the runtime-library is used when using them, then the heap needs to be initialized for these library functions before the program is executed. Then ARM may work in different modes, and it is necessary to set up the stack for different working modes. In this way, the file that describes the link address and all the initialization programs before the application runs are the startup program group
3 STARTUP classification
In this way, the functions performed by the startup program are classified. One type is the link address description, and the other type is various initialization programs. Depending on the application, the content, structure and complexity of the description file and the initialization program will be different. But basically, they must all implement the following functions.
3.1 Description file implementation function
The description file can be a simple few characters on the link command line, or it can be a very complex file, but it must complete the following functions:
; Specify the address for program download
; Specify the address for program execution
3.2 Initialization program implementation function
The initialization program has different structures and complexities depending on the application, but it must complete the following basic functions:
; Exception vector initialization
; Memory environment initialization
; Other hardware environment initialization
Previous article:ARM development experience! (Part 2)
Next article:Interrupt control of 44b0X
Recommended ReadingLatest update time:2024-11-23 08:08
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Take it with you when shopping for New Year's goods, and never complain about being tired again
- Award-winning evaluation: 100 sets of evaluation boards for Toshiba's smallest photorelay TLP3547 are available for free
- Reference materials for control questions: Intelligent car material series
- Another generation of super processor? Kirin 820 running score announced: single-core/multi-core both surpass Kirin 980
- protous 8.9 green version
- A brief discussion on the relationship between driving capability and timing
- LED switching power supply topology BUCKBOOST analysis
- FAQ_How to set the impedance of BlueNRG-12 ADC_V1.0
- 【Perf-V Review】Timer and Dot Matrix Module Display
- Do I need to apply for use of the 868mhz frequency band in China?