大家好,现在在调试一个板子,用的是2407,片外flash是SST的SST39LF400A,驱动用的是官方网站给的。现在可以擦除,但是写不了,卡了好几天也看不出来哪错了,求大虾指正。另外,每次我RUN后程序自动停止,但是第二次RUN并不会自动停止,请问是什么原因?还有我的反汇编头几行都是FFFF...貌似是跑飞了
下面是我的程序和CMD:
主程序:
main()
{
uint *sec_des,*my_des;
SCSR1=0x81FE; //初始化
WDCR=0xE8;//关狗
CS_RAM_1;//不选择片外RAM
A16_0;//我用两个GPIO口作地址线,这两句相当于高地址为0
A17_0;
sec_des = (uint *)(0x8000);
Erase_One_Sector (sec_des);//官方给的驱动里的函数,擦除一个sector
my_des = (uint *)(0x8008);
Program_One_Word (0x5231,my_des);//官方给的驱动里的函数,写一个字
cs_flash_0;
my_word = *(uint *)(0x8002);
cs_flash_1;
}
---------------------------------------------------------------------------
CMD:
-stack 150
-l rts2xx.lib
/*-------------------------------------------------------------------------*/
/* LINKER COMMAND FILE - MEMORY SPECIFICATION for F2407 DSK */
/* Last update 8 JULY 2001 */
/*-------------------------------------------------------------------------*/
MEMORY
{
PAGE 0 : VECS: origin = 0000h, length = 0040h
LOW: origin = 0050h, length = 07FAFh
PAGE 1: B0: origin = 0200h, length = 0100h
B1: origin = 0300h, length = 0100h
B2: origin = 0060h, length = 0020h
SARAM: origin = 0800h, length = 0800h
EXSRAM: origin = 70a8h, length = 0010h
FLASH: origin = 8000h,length = 2000h
}
/*-------------------------------------------------------------------------*/
/* SECTIONS ALLOCATION */
/*-------------------------------------------------------------------------*/
SECTIONS
{
.vectors : { } > VECS PAGE 0
.text : { } > LOW PAGE 0
.cinit : { } > LOW PAGE 0
.switch : { } > LOW PAGE 0
.stack : { } > B0 PAGE 1
.const : { } > B0 PAGE 1
.usect : { } > B1 PAGE 1
.sysmem : { } > B1 PAGE 1
.data : { } > SARAM PAGE 1
.bss : { } > SARAM PAGE 1
} |