|
发表于 2017-2-22 00:25:00
|
显示全部楼层
本帖最后由 suhob909081 于 2017-2-22 00:30 编辑
谢谢你的回复!我是用jlink下载测试的.程序运行到下面:
OSStartHighRdy
; Change to SVC mode.
MSR CPSR_c, #(OS_CPU_ARM_CONTROL_INT_DIS | OS_CPU_ARM_MODE_SVC)
LDR R0, =OSTaskSwHook ; OSTaskSwHook();
MOV LR, PC
BX R0
LDR R0, =OSRunning ; OSRunning = TRUE;
MOV R1, #1
STRB R1, [R0]
; SWITCH TO HIGHEST PRIORITY TASK:
LDR R0, =OSTCBHighRdy ; Get highest priority task TCB address,
LDR R0, [R0] ; Get stack pointer,
LDR SP, [R0] ; Switch to the new stack,
这儿iar出现 Wed Feb 22, 2017 00:17:50: The stack pointer for stack 'SVC_STACK' (currently 0x207624F0) is outside the stack range
LDR R0, [SP], #4 ; Pop new task's CPSR,
MSR SPSR_cxsf, R0
LDMFD SP!, {R0-R12, LR, PC}^ ; Pop new task's context.
您的iar工程编译时使用的icf文件是指向你电脑的另外一个文件夹中,并没有包含在rar中,第一编译出错,我就使用了文件包里的 EvalBoards\Alpscale\ASM9260\IAR\BSP\asm9260_SDRAM.icf 文件.是不是这个icf不对造成运行错误呢?
该icf内容为:
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$PROJ_DIR$\..\BSP\a_v1_0.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x20008000;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_ROM_start__ = 0x20008040;
define symbol __ICFEDIT_region_ROM_end__ = 0x201fffff;
define symbol __ICFEDIT_region_RAM_start__ = 0x20200000;
define symbol __ICFEDIT_region_RAM_end__ = 0x21ffffff;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x4000;
define symbol __ICFEDIT_size_svcstack__ = 0x8000;
define symbol __ICFEDIT_size_irqstack__ = 0x160;
define symbol __ICFEDIT_size_fiqstack__ = 0x40;
define symbol __ICFEDIT_size_undstack__ = 0x40;
define symbol __ICFEDIT_size_abtstack__ = 0x40;
define symbol __ICFEDIT_size_heap__ = 0x100000;
/**** End of ICF editor section. ###ICF###*/
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { };
define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { };
define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { };
define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { };
define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize by copy { readwrite };
do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in ROM_region { readonly };
place in RAM_region { readwrite,
block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK,
block UND_STACK, block ABT_STACK, block HEAP };
define exported symbol fl_ram_end = (__ICFEDIT_region_RAM_end__ & 0xFFFFFFF8);
这儿,我已经将 define symbol __ICFEDIT_size_svcstack__ = 0x8000; 从 0x40改为 0x8000了还是出错
|
|