1. Exception vector table:
Contains: 1. Exception definition
2. Exception Type
3. Abnormal entrance
4. Vector table
First, the exception definition is in the ARM Architecture Reference Manual.pdf document, 2.6.Exceptions of 2.Programmers' Model:
Exception: Due to some internal or external events, the processor stops the work it is doing and turns to handle these events.
2. Exception Type
When an exception occurs, the ARM processor will jump to the fixed address corresponding to the exception to execute the exception handler. This fixed address is called an exception vector. Multiple exception vectors together form an exception vector table.
From the exception vector address above, you can notice that address 0x00000014 is not used. On the right side of the above figure, you can see that there are two sets of exception vector tables available. One set is for low addresses, and the other set is for high addresses. They can be configured through the corresponding bits of CP15. When CP15 is not configured, the default is to use the low address as the exception vector table.
3.Entrance: 00000000;
4. Exception vector table: The table consisting of seven exception vectors and processing function jump relationships is the exception vector table.
2. Code Writing (6410)
Linker script: forfish.lds:
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS {
. = 0x50008000;
. = ALIGN(4);
.text :
{
start.o (.text)
*(.text)
}
. = ALIGN(4);
.data :
{
*(.data)
}
. = ALIGN(4);
bss_start = .;
.bss :
{
*(.bss)
}
bss_end = .;
}
The assembly file start.S completes the code structure of the corresponding hardware operation:
@****************************
@File:start.S
@
@FORFISH
@****************************
.text
.global _start
_start:
b reset
ldr pc, _undefined_instruction
ldr pc, _software_interrupt
ldr pc, _prefetch_abort
ldr pc, _data_abort
ldr pc, _not_used //Note this unused address
ldr pc, _irq
ldr pc, _fiq
_undefined_instruction: .word undefined_instruction
_software_interrupt: .word software_interrupt
_prefetch_abort: .word prefetch_abort
_data_abort: .word data_abort
_not_used: .word not_used
_irq: .word irq
_fiq: .word fiq
undefined_instruction:
nop
software_interrupt:
nop
prefetch_abort:
nop
data_abort:
nop
not_used:
nop
irq:
nop
fiq:
nop
reset:
nop
After writing the above, it is time to write the Makefile file for this project:
Makefile:
all: start.o
arm-linux-ld -Tforfish.lds -o forfish.elf $^
arm-linux-objcopy -O binary forfish.elf forfish.bin
%.o : %.S
arm-linux-gcc -g -c $^
.PHONY: clean
clean:
rm *.o *.elf *.bin
After writing, the framework of the project is established, and make is used to compile:
You can see that the bin file is successfully generated, indicating that the bare metal uboot project has been established.
Previous article:21.Core initialization svc mode
Next article:19.Bootloader framework design
- 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
- 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
- CG-09 High Precision 485 Ultrasonic Wind Speed and Direction Sensor Zero Start Wind Speed
- A 1Ω resistor and a 1Ω capacitor are connected in series. What percentage of the AC signal is on the capacitor?
- [Xingkong Board Python Programming Learning Main Control Board] Unboxing Experience - A Python Programming Learning Board Worth Playing With
- Why are most PCBs green? Are black PCBs more advanced?
- You guys don't share the comparison pictures of software and hardware engineers. Let's talk about it.
- Hejian Gongsoft's New Year's greetings for 2022 - Spring brings blessings and everything is glorious
- How high can the transmission power of 5G mobile phones be?
- ESP32 uses littlefs v2 as the default file system
- [2022 Digi-Key Innovation Design Competition] Unboxing of materials STM32F7508DK and WE inductors and other accessories
- Op amp power supply