|
編譯鏈接都能通過,但是在simulator里面就是一直有錯誤。
lcf文件的設置采用系統默認的.intvec start 0x08000000;
內存ROM劃分:從0x08000000開始
調試了幾天都出現這個錯誤:0x1000000內存溢出的錯誤。
uC/OS II運行到這里出現的如上錯誤:
;********************************************************************************************************
; START MULTITASKING
; void OSStartHighRdy(void)
;
; Note(s) : 1) This function triggers a PendSV exception(essentially, causes a context switch) to cause
; the first task to start.
;
; 2) OSStartHighRdy() MUST:
; a) Setup PendSV exception priority to lowest;
; b) Set initial PSP to 0, to tell context switcher this is firstrun;
; c) Set OSRunning to TRUE;
; d) Trigger PendSV exception;
; e) Enable interrupts (tasks will run with interruptsenabled).
;********************************************************************************************************
OSStartHighRdy
LDR R0,=NVIC_SYSPRI14 ; Set the PendSV exception priority
LDR R1, =NVIC_PENDSV_PRI
STRB R1,[R0]
MOVS R0,#0 ; Set the PSP to 0 for initial context switch call
MSR PSP, R0
LDR R0,=OSRunning ; OSRunning = TRUE
MOVS R1,#1
STRB R1,[R0]
LDR R0,=NVIC_INT_CTRL ; Trigger the PendSV exception (causes context switch)
LDR R1, =NVIC_PENDSVSET
STR R1, [R0]
CPSIE I ; Enable interrupts at processor level
OSStartHang
B OSStartHang ; Should never get here
終于通過修改vector table和ROM地址從 0x00000000開始,程序可以正常跑了。
還不知道原因,后續還要仔細看下芯片手冊。
|
|