;中断向量表
Reset
LDR PC, ResetAddr
LDR PC, UndefinedAddr
LDR PC, SWI_Addr
LDR PC, PrefetchAddr
LDR PC, DataAbortAddr
DCD 0xb9205f80
LDR PC, [PC, #-0xff0]
LDR PC, FIQ_Addr
ResetAddr DCD ResetInit
UndefinedAddr DCD Undefined
SWI_Addr DCD SoftwareInterrupt
PrefetchAddr DCD PrefetchAbort
DataAbortAddr DCD DataAbort
Nouse DCD 0
IRQ_Addr DCD 0
FIQ_Addr DCD FIQ_Handler
ResetInit
;Initial the extenal bus controller
;初始化外部总线控制器,根据目标板决定配置
LDR R0, =PINSEL2
IF :DEF: EN_CRP
LDR R1, =0x0f814910
ELSE
LDR R1, =0x0f814914
ENDIF
STR R1, [R0]
LDR R0, =BCFG0
LDR R1, =0x10001460
STR R1, [R0]
LDR R0, =BCFG1
LDR R1, =0x1000ffef
STR R1, [R0]
LDR R0, =BCFG2
LDR R1, =0x1000ffef
STR R1, [R0]
; LDR R0, =BCFG3
; LDR R1, =0x2000ffef
; STR R1, [R0]
BL InitStack ; Initialize the stack 初始化堆栈
BL TargetResetInit ; Initialize the target board 目标板基本初始化
; Jump to the entry point of C program 跳转到c语言入口
B __main
上面是ARM7的启动代码startup.s的一段代码.我跟踪了一下,程序先运行Reset-ResetAddr-ResetInit
但有一个问题当执行完ResetInit里面最后一个函数TargetResetInit(蓝色)后,程序接着运行哪了,我本以为会运行函数,但单步跟踪进去
不是函数,而是一堆汇编指令.
小弟刚学ARM7,请大虾们指点一下,运行完TargetResetInit后,程序接着运行什么? |