各位高手,小弟基于友善之臂的MINI6410开发板编写裸板定时器中断程序。将裸板程序复制到SD卡中,设置开发板模式为SD卡启动。运行发现:系统未跳转到IRQ异常向量处执行。请教其中的原因。谢谢!启动文件内容如下:
.text
.globl _start
_start:
b reset
ldr pc, _undefined_instruction
ldr pc, _software_interrupt
ldr pc, _prefetch_abort
ldr pc, _data_abort
ldr pc, _not_used
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
_pad:
.word 0x12345678 /* now 16*4=64 */
reset:
ldr r0 , =0x7e004000
mov r1 , #0x0
str r1 , [r0]
/*复制中断向量表至0x0*/
mov r8 , #0
adr r9 , _start
ldmia r9! , {r0-r7}
stmia r8! , {r0-r7}
ldmia r9! , {r0-r7}
stmia r8! , {r0-r7}
ldr sp, =1024*4
bl main
/*
* exception handlers
*/
.align 5
undefined_instruction:
ldr r0, =0x7f008800
ldr r1, =0x11110000
str r1, [r0]
ldr r0, =0x7f008808
ldr r1, =0x0
str r1, [r0]
bl do_undefined_instruction
.align 5
software_interrupt:
ldr r0, =0x7f008800
ldr r1, =0x11110000
str r1, [r0]
ldr r0, =0x7f008808
ldr r1, =0x0
str r1, [r0]
bl do_software_interrupt
.align 5
prefetch_abort:
ldr r0, =0x7f008800
ldr r1, =0x11110000
str r1, [r0]
ldr r0, =0x7f008808
ldr r1, =0x0
str r1, [r0]
bl do_prefetch_abort
.align 5
data_abort:
ldr r0, =0x7f008800
ldr r1, =0x11110000
str r1, [r0]
ldr r0, =0x7f008808
ldr r1, =0x0
str r1, [r0]
bl do_data_abort
.align 5
not_used:
ldr r0, =0x7f008800
ldr r1, =0x11110000
str r1, [r0]
ldr r0, =0x7f008808
ldr r1, =0x0
str r1, [r0]
bl do_not_used
.globl irq
/*import c_irq_handler*/
.align 5
irq:
ldr r0, =0x7f008800
ldr r1, =0x11110000
str r1, [r0]
ldr r0, =0x7f008808
ldr r1, =0x0
str r1, [r0]
/*stmfd sp!, {r0-r12, lr} ;保存现场 */
bl c_irq_handler /*调用中断处理子程序*/
/*ldmfd sp!, {r0-r12, lr} ;恢复现场*/
/*subs pc, lr, #4*/
/*END*/
.align 5
fiq:
ldr r0, =0x7f008800
ldr r1, =0x11110000
str r1, [r0]
ldr r0, =0x7f008808
ldr r1, =0x0
str r1, [r0]
bl do_fiq
|