yuantuh wrote on Friday, March 30, 2012:
Hi Richard,
I did not describe clearly in the last email. I added the following piece of code in the boot.s:
/*===================== Vector table remap ===========================*/
.global .reset_start
.global .vectors_end
.equ __excVecStart, 0x108000 /* .reset_start = 0x108000 */
.equ __excVecEnd, 0x108038 /* .vectors_end = 0x108038 */
.equ __ramStart, 0x200000
.equ __AT91C_BASE_MC, 0xFFFFFF00
.equ __AT91C_MC_RCB, 0x01
.equ __MC_RCR, 0x00
ldr r0, =__excVecStart
ldr r1, =__ramStart
ldr r2, =__excVecEnd
copy:
ldr r3, [r0], #4
str r3, [r1], #4
cmp r0, r2
bne copy
/* Remap exception vectors at address 0*/
ldr r0, =__AT91C_BASE_MC
ldr r1, =__AT91C_MC_RCB
str r1, [r0, #__MC_RCR]
/*=====================================================================*/
I insert the above code between
…
msr CPSR_c, #MODE_SYS|I_BIT|F_BIT /* System Mode */
mov sp, r0
<inserted code above>
/* We want to start in supervisor mode. Operation will switch to system
mode when the first task starts. */
msr CPSR_c, #MODE_SVC|I_BIT|F_BIT
The vector addresses are copy from map file see below:
0x00008000 . = 0x8000
startup 0x00108000 0x38
*(.startup)
.startup 0x00108000 0x38 C:\Users\yhuang\AppData\Local\Temp\ccClEVET.o
0x00108000 .reset_start
0x00108038 .vectors_end
prog 0x00108038 0x20424
*(.text)
.text 0x00108038 0x100 obj/main.o
It seems to me the vector table has been copy to address 0, but the application does not start. It stops in the first vPortISRStartFirstTask. I guess no time tick interrupt. Any suggestion? Thank you.
Yuantu