2407load program求救,急!谢谢各位大侠
[复制链接]
这个是我的cmd文件:
MEMORY
{
PAGE 0:
VECS origin = 0000h, length = 0040h
FLASH: origin =0100h, length = 7F00h
SARAM_P: origin = 8100h, length = 1000h
PAGE 1:
B2: origin = 0060h, length = 020h
B0: origin = 200h, length = 100h
B1: origin = 300h, length = 100h
SARAM_D: origin = 0C00h, length = 400h
}
SECTIONS
{
vectors: > VECS PAGE 0
.text: > FLASH PAGE 0
.data: > FLASH PAGE 0
.bss: > B2 PAGE 1
stack: > B1 PAGE 1
buffer: > SARAM_D PAGE 1
}
这个是我的gel文件:
#define SCSR1 0x7018
#define SCSR2 0x7019
#define MP 0x0f
#define MC 0x0b
/* The Startup() function is executed when the GEL file is loaded. */
StartUp()
{
F2407_Init();
}
F2407_Init()
{
GEL_Reset();
GEL_MapReset();
GEL_MapOn();
GEL_MapAdd(0x0000,0,0x8000,1,1); /* Flash/External SRAM */
GEL_MapAdd(0x8000,0,0x8000,1,1); /* External SRAM */
GEL_MapAdd(0x0000,1,0x0060,1,1); /* MMR */
GEL_MapAdd(0x0060,1,0x0020,1,1); /* B2 */
GEL_MapAdd(0x0200,1,0x0100,1,1); /* B0 */
GEL_MapAdd(0x0300,1,0x0100,1,1); /* B1 */
GEL_MapAdd(0x0800,1,0x0800,1,1); /* SRAM */
GEL_MapAdd(0x1000,1,0xF000,1,1); /* External SRAM */
}
menuitem \"F2407 DEBUGGER\";
hotmenu flash_disable()
{
*(int *)SCSR2 = MP;
}
hotmenu flash_enable()
{
*(int *)SCSR2 = MC;
}
这个是我的asm文件:
.global start
.global PHANTOM
.data
b0 .word 0fffEh ;turn-on GPIO0
b1 .word 0fffDh ;turn-on GPIO1
b2 .word 0fffBh ;turn-on GPIO2
b3 .word 0fff7h ;turn-on GPIO3
b4 .word 0ffEFh ;turn-on GPIO0
b5 .word 0ffDFh ;turn-on GPIO1
b6 .word 0ffBFh ;turn-on GPIO2
b7 .word 0ff7Fh ;turn-on GPIO3
GPR0 .word 0
.include f2407.h
KICK_DOG .macro
LDP #00E0h ;DP-->7000h-707fh
SPLK #05555h,WDKEY
SPLK #0aaaah,WDKEY
LDP #0h ;DP-->0000h-007fh
.endm
.text
start:
LDP #0h
SETC INTM
SETC CNF
SPLK #0000h,IMR
LACC IFR
SACL IFR
LDP #00E0h
SPLK #0200h,SCSR1
SPLK #006Fh,WDCR
KICK_DOG
SPLK #0h,GPR0
OUT GPR0,WSGR
LDP #00E1h
SPLK #00000h,MCRA
SPLK #0FF00h,MCRB
SPLK #00000h,MCRC
SPLK #0FFFFh,PADATDIR
SPLK #0FFFFh,PBDATDIR
SPLK #0FFFFh,PCDATDIR
SPLK #0FFFFh,PEDATDIR
SPLK #0FFFFh,PFDATDIR
MAIN:
LDP #0
LOOP:
LDP #00E1h
setc xf
CALL DELAY
SPLK #0FFFFh,PADATDIR
CALL DELAY
SPLK #0FFFFh,PBDATDIR
CALL DELAY
SPLK #0FFFFh,PCDATDIR
CALL DELAY
SPLK #0FFFFh,PEDATDIR
CALL DELAY
SPLK #0FFFFh,PFDATDIR
CALL DELAY
CALL DELAY
clrc xf
CALL DELAY
SPLK #0FF00h,PADATDIR
CALL DELAY
SPLK #0FF00h,PBDATDIR
CALL DELAY
SPLK #0FF00h,PCDATDIR
CALL DELAY
SPLK #0FF00h,PEDATDIR
CALL DELAY
SPLK #0FF00h,PFDATDIR
CALL DELAY
CALL DELAY
B MAIN
DELAY:
D_LOOP:
RPT #0FFh
NOP
RET
PHANTOM:
KICK_DOG
B PHANTOM
结果就是load不了,提示数据空间有错,我也照FAQ上面的提示分配了数据和程序存储空间,还是不行,我的这块2407才刚买的,应该没问题的。我是完全照给我的光盘上面的GPIO程序,但就是load不了。仿真器和板子接上以后也有按安装说明的提示reset成功,不知道问题出在哪,请各位大侠帮帮我。