重定向了_user_initial_stackheap,但仍出现以下错误
:Error : L6218E: Undefined symbol Image$$ZI$$Limit (referred from sys_stackheap.o)
AREA START, CODE, READONLY
CODE32
IMPORT _main
EXPORT Start
EXPORT _user_initial_stackheap
EXPORT stack_base
EXPORT heap_base
ENTRY
Start
BL InitStack
BL MAC7111Init
B _main
_user_initial_stackheap
LDR R0, =heap_base
LDR R1, =stack_base
MOV PC, LR
InitStack
MOV R0, LR ;每种模式对应不同的LR,程序以管理员模式进入,以用户模式返回,所以要保存LR
MSR CPSR_c, #0xd3 ;设置管理员模式堆栈
LDR SP, StackSvc
MSR CPSR_c, #0xd1 ;设置FIQ模式堆栈
LDR SP, StackFIQ
MSR CPSR_c, #0xd2 ;设置IRQ模式堆栈
LDR SP, StackIRQ
MSR CPSR_c, #0xd7 ;设置中止模式堆栈
LDR SP, StackAbt
MSR CPSR_c, #0xdb ;设置未定义模式堆栈
LDR SP, StackUde
MSR CPSR_c, #0xdf ;设置SYS模式堆栈
LDR SP, =stack_base
MOV PC, R0
INTC_BASE EQU 0xFC048000
INTC_CFG EQU 0x0018
CRG_BASE EQU 0xFC088000
CRG_SYNR EQU 0x0000
CRG_RFDV EQU 0x0001
CRG_CLKSEL EQU 0x0005
CRG_PLLCTL EQU 0x0006
EIM_BASE EQU 0xFC008000
CASR0 EQU 0x0080 ;16BIT
CSMR0 EQU 0x0084 ;32BIT
CSCR0 EQU 0x0088 ;16BIT
CASR1 EQU 0x008C ;16BIT
CSMR1 EQU 0x0090
CSCR1 EQU 0x0094 ;16BIT
CASR2 EQU 0x0098 ;16BIT
CSMR2 EQU 0x009C
CSCR2 EQU 0x00A0 ;16BIT
;CASR0 EQU 0xFC008080
;CSMR0 EQU 0xFC008084
;CSCR0 EQU 0xFC008088
;CASR1 EQU 0xFC00808C
;CSMR1 EQU 0xFC008090
;CSCR1 EQU 0xFC008094
;CASR2 EQU 0xFC008098
;CSMR2 EQU 0xFC00809C
;CSCR2 EQU 0xFC0080A0
MAC7111Init
LDR R0, =CRG_BASE
LDR R1, =0x0
STRB R1, [R0, #CRG_CLKSEL] ;Fclk=Fosc=8MHz
STRB R1, [R0, #CRG_PLLCTL] ;PLL Disabled, Clock Monitor Disabled
;AT RESET ALL THE INTERRUPT ARE DISABLED
LDR R0, =EIM_BASE
LDR R1, =0x00000000
STR R1, [R0, #CASR1]
LDR R1, =0x00010001
STR R1, [R0, #CSMR1]
LDR R1, =0x000005A0
STR R1, [R0, #CSCR1]
LDR R1, =0x00300000
STR R1, [R0, #CASR2]
LDR R1, =0x00000001
STR R1, [R0, #CSMR2]
LDR R1, =0x000001A0
STR R1, [R0, #CSCR2]
LDR R1, =0x00020000
STR R1, [R0, #CASR0]
LDR R1, =0x000009A0
STR R1, [R0, #CSCR0]
LDR R1, =0x001F0000
STR R1, [R0, #CSMR0]
NOP
NOP
NOP
NOP
NOP
NOP
NOP
LDR R1, =0x001F0001
STR R1, [R0, #CSMR0]
MOV PC, LR
AREA RAMDATA, DATA, READWRITE
StackIRQ SPACE 256
StackFIQ SPACE 256
StackSvc SPACE 256
StackAbt SPACE 256
StackUde SPACE 256
StackSys SPACE 256
AREA stack, DATA, NOINIT
stack_base SPACE 1024
AREA heap, DATA, NOINIT
heap_base SPACE 1024
END
scf文件
LOAD_RAM 0x00000000 ;加载域为RAM
{
RUN_RAM 0x00000000 0x5000 ;第一个运行时域,长20K Bytes
{
Vectors.o(vector, +First)
*(+RO)
}
ISR_table 0x00005000 ;256byte for 64 int sources
{
Vectors.o(ISRAddr, +First)
}
data 0x00005100
{
*(+RW, +ZI)
}
heaps 0x00006000 UNINIT
{
init.o(heap, +First)
}
stacks 0x00020000 UNINIT ;128K RAM的顶端
{
init.o(stack, +First)
}
}