How to start
For S3C2440, there are two ways to boot, one is Nor Flash boot, the other is Nand Flash boot.
Boot using Nor Flash
The address range of Nor Flash is as follows
0x0000.0000—0x0800.0000 (2M Nor Flash)
The BootSRAM address on the chip is set to
0x4000.0000—0x4000.DFFF (4K BootSRAM)
Since the code can be run directly in Nor Flash, BootSRAM is mapped to other addresses and can be used for other purposes.
The program image is directly stored in NOR FLASH, and the interrupt vector table is stored in the 8×4 space starting at 0x0000.0000.
When an interrupt occurs, the PC is set to the corresponding vector address. When the power is turned on or the reset key is pressed, the PC is directly set to 0x00 and execution starts from 0x00 of the NOR FLASH.
Booting using NAND Flash
At this time, the BootSRAM address in the chip is set to
0x0000.0000—0x0800.0000 (4K BootSRAM)
NAND Flash address connected to NFCE
Since the code cannot be run in NAND Flash, it must be copied to the memory and then run.
The program image is stored in NAND FLASH, and the interrupt vector table is located at the front of the program image. Since NAND FLASH cannot run code, when the system is powered on or reset, the built-in NAND FLASH will access the control interface and automatically load the interrupt vector table and boot code into the internal SRAM (the SRAM is located at the starting address space 0x00000000, with a capacity of 4KB), and set the PC value to 0x00 to run the program (all this is done by the hardware logic inside the chip). After that, the boot program in SRAM loads the operating system image into SDRAM, and the operating system can run in SDRAM. After the startup is completed, the 4KB startup SRAM can be used for other purposes.
Interrupt vector table settings
There are 7 types of exceptions and interrupts in ARM
Response priority from high to low
According to the interrupt vector table order
Reset
Reset
Data abort
Undefined instruction interrupt
FIQ
SWI
IRQ
Prefetch instruction abort
Prefetch instruction abort
Data Abort Exception
Undefined instruction, SWI
IRQ
FIQ
ARM requires that the interrupt vector table must be placed in a continuous 8×4-byte space starting from address 0 (ARM720T, ARM9, and ARM10 also support high-address vector tables starting from 0xFFFF0000). The locations of each exception and interrupt vector in the vector table are as follows
address
Interrupt
0x00
Reset
0x04
Undef
0x08
SWI
0x0C
Prefetch Abort
0x10
Data Abort
0x14
(Reserved)
0x18
IRQ
0x2C
FIQ
When an interrupt occurs, the ARM processor forces the PC pointer to be set to the corresponding vector address in the interrupt vector table. Because each interrupt vector has only one byte of storage space in the vector table and can only store one instruction, a jump instruction is usually stored to make the program jump to other places in the memory and then execute the interrupt processing.
The implementation procedure of the interrupt vector table is usually as follows
AREA Boot, CODE, READONLY
ENTRY
B Reset_Handler; Reset_Handler is a label
B Undef_Handler
B SWI_Handler
B PreAbort_Handler
B DataAbort_Handler
B ;for reserved interrupt, stop here
B IRQ_Handler
B FIQ_Handler
The keyword ENTRY specifies that the compiler should keep this code, because the compiler may consider this code to be redundant and optimize it. When linking, make sure that this code is linked to address 0 and used as the entry point of the entire program (ENTRY is not always used to set the entry point of the program, so it is usually necessary to explicitly set the program entry point in the link options).
Previous article:STM32 drives ST7920's 12864 LCD (serial mode)
Next article:Buses in ARM
- Popular Resources
- Popular amplifiers
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
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- 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
- Can someone help me figure out whether this active filter is a voltage-controlled power supply type or a multiple feedback type?
- 【BearPi-HM Nano】NFC test
- Frost has fallen~
- Summary by an expert: Answers to 23 classic questions in power supply development!
- What is the difference between these two ways of connecting the max680 capacitor?
- 2G/GPS/Bluetooth or Zigbee IoT communication module
- COCOFLY Tutorial - Crazy Shell Drone Series · Quick Start · [4] Flight Control Firmware Burning
- The Zhongke Yihaiwei FPGA board is unboxed!
- Share a video series by Hou Jie C++
- GD32L233C-START Evaluation (3) On-chip hardware oversampling ADC