|
发现有些程序下载时会有错误,而有些又没有主要是CMD配置的原因. 我对CMD知道的太少,还望大虾帮我看一下,解释一下啊!!!
程序下载成功的CMD(下进去后程序运行也不正常,老是执行NMI,和其他未定义的中断):
MEMORY
{
PAGE 0:
VECS origin = 0000h, length = 0040h
FLASH: origin = 100h, length = 7F00h
SARAM_P: origin = 8000h, length = 07ffh
PAGE 1:
MMRS: origin = 0h, length = 05fh
B2: origin = 0060h, length = 020h
B0: origin = 200h, length = 100h
B1: origin = 300h, length = 100h
SARAM: origin = 0800h, length = 0800h
EXT: origin = 8000h, length = 8000h
}
SECTIONS
{
.vectors: > VECS PAGE 0
.text : > FLASH PAGE 0
.cinit : > FLASH PAGE 0
.switch : > FLASH PAGE 0
.bss : > SARAM PAGE 1
.const : > SARAM PAGE 1
.stack : > SARAM PAGE 1
.sysmem: > SARAM PAGE 1
}
下载时出现错误的CMD:
-stack 40
/*-------------------------------------------------------------------------*/
/* 命令文件 - 存储空间 F2407 */
/*-------------------------------------------------------------------------*/
MEMORY
{
PAGE 0 : VECS : origin = 0h , length = 40h /* 程序复位 */
PVECS : origin = 40h , length = 70h /* 外围模块中断向量 */
PROG : origin = 0b0h , length = 7F50h /* 在片FLASH */
PAGE 1 : MMRS : origin = 0h , length = 05Fh /* MMRS */
B2 : origin = 0060h , length = 020h /* DARAM B2 块 */
B0 : origin = 0200h , length = 100h /* DARAM B0 块 */
B1 : origin = 0300h , length = 100h /* DARAM B1 块 */
SARAM : origin = 0800h , length = 0800h /* SARAM 块 */
EXT : origin = 8000h , length = 8000h /* 外部存储器 */
}
/*-------------------------------------------------------------------------*/
/* SECTIONS ALLOCATION */
/*-------------------------------------------------------------------------*/
SECTIONS
{
.reset : { } > VECS PAGE 0 /* 复位中断向量表 */j
.vectors : { } > VECS PAGE 0 /* 中断向量表 */
.pvecs : { } > PVECS PAGE 0 /* 外围模块中断向量表 */
.text : { } > PROG PAGE 0 /* 代码 */
.cinit : { } > PROG PAGE 0
.bss : { } > SARAM PAGE 1 /* 块 B2 */
.const : { } > SARAM PAGE 1 /* 块 B2 */
.stack : { } > B1 PAGE 1 /* 堆栈-40个单元 */ |
|