The startup process of arm embedded chips is actually very complicated for embedded novices. Many people have only a little understanding of it and there are many misunderstandings. In the author's opinion, if you want to truly understand this startup process, you must first understand the differences and connections between memories. Please refer to the article: The Differences and Connections of Various Mainstream Semiconductor Memories. You also need to understand how the program is compiled, linked and executed.
This article will take s3c2440 as an example to describe the startup process of the arm chip in detail. s3c2440 supports two startup modes: NAND FLASH startup and non-NAND FLASH startup (usually NOR FLASH startup, and the data width can be configured), which is controlled through the two pins OM1 and OM0.
NAND FLASH startup process
When both OM1 and OM0 pins are low, the CPU is configured to start as NAND FLASH. At this time, the 4KB SRAM inside the CPU will be mapped to the nGCS0 space (the starting address is 0x00000000). When powered on, the CPU will automatically copy the first 4KB data in the NAND FLASH to the on-chip SRAM. Then the CPU starts executing the program from the 0x00000000 address of the internal SRAM, initializes the system accordingly, and prepares for subsequent program execution beyond 4Kb.
In other words, the programs that can be executed during the CPU startup process can only occupy up to 4Kb of space. If you need to execute more programs, you need to complete the initialization of DRAM in a 4Kb program (DRAM must be initialized before use), configure the stack space, copy the programs that need to be executed to DRAM, and then jump to DRAM. Continue execution.
The reason why the code in the NAND FLASH must be copied to the internal SRAM before execution during the startup process is because the NAND FLASH needs to be accessed through the NAND FLASH controller and cannot be directly accessed through the CPU bus, so the program cannot be executed.
NOR FLASH startup process
When the system is configured to start in this way, the CPU internal SRAM is no longer mapped to the address space. At this time, what is mapped to the nGCS0 (starting address is 0x00000000) address space should be the external NOR FLASH (memory that stores the startup code). ). When the system is powered on or reset, the CPU starts executing code directly from address 0x00000000 (which is the starting address of NOR FLASH). Compared with NAND FLASH startup, the NOR FLASH startup code can reach 128Mb (s3c2440).
The reason why code can be executed directly on NOR FLASH is because NOR FLASH has a RAM-like access interface and can directly perform random reads through the CPU bus, but does not support random write operations. Therefore, C language cannot be included in these startup codes. This is because the program must have variables (which need to be written) and require stack space to call functions (which also need to be written), and the assembler can avoid writing to the memory space. of.
So does that mean that if NOR FLASH is started, there cannot be a C program? Of course not, don't forget the existence of DRAM. When the NOR FLASH startup process completes the initialization of the DRAM and the configuration of the stack space, the C language program can be called.
This is the startup process of the arm chip. In fact, there are many places in the startup code at the beginning of the startup process that are worthy of careful consideration, and there will also be many questions. At this time, you should understand how the program is compiled and linked. , and how to implement it.
Previous article:Design of GPS real-time navigation system based on Linux operating system and S3C2410 microprocessor
Next article:Detailed explanation of U-boot transplantation on S3C2440 (1)
- 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
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Cache miss categories of the C6000 series
- 3. Signal Filter
- 2. [Record] Solve git@gitee.com: Permission denied (publickey). Could not read fr...
- Five clock sources and three clock signals of msp430
- Talk about CC1310 development environment
- EEWORLD University Hall - Soldering comparison between different solders and welding techniques for various components
- Can the ordinary probe of an oscilloscope be used to check the strength of ESD tests?
- DIY fan PK competition is now open! Students who want to practice power supply please come in~~
- Watch the video for a reward | Play with DP1.4 source physical layer consistency test
- What is the accuracy of LM317 as a cross-current source?