程序进不去
.text
_c_int0:
SETC INTM
CLRC SXM
CLRC OVM
CLRC CNF ;B0配置为数据空间
LDP #0E0H
SPLK #604H,SCSR1 ;时钟1倍频
SPLK #0E8H,WDCR ;不使能WDT
LDP #0
SPLK #02H,IMR ;使能中断优先级INT2
SPLK #0FFFFH,IFR ;清中断标志
LDP #DP_EVA ;指向74007480h区
SPLK #80H,EVAIMRA ;使能1T1PINT
SPLK #0FFFFH,EVAIFRA;清EVA中断标志
SPLK #0,GPTCONA
SPLK #177H,T1PR ;1ms产生一次中断
SPLK #0,T1CNT
SPLK #164CH,T1CON
CLRC INTM
WAIT: NOP
B WAIT
GISR2:
LDP #0E0H;
LACC PIVR,1
ADD #PVECTORS
BACC
T1PINT_ISR:
LDP #DP_EVA
SPLK #0,T1CNT
GISR2_RET:
CLRC INTM
RET
PHANTOM:
;KICK_DOG
RET
END
cmd文件为
MEMORY
{
PAGE 0:
VECS: origin=0000h, length=0040h
PVECS: origin=0044h, length=0100h
PM: origin=1000h, length=0200h
PAGE 1:
B2: origin=0060h, length=0020h
}
SECTIONS
{
.vectors {} > VECS PAGE 0
.pvecs {} > PVECS PAGE 0
.text {} > PM PAGE 0
}
向量表的部分省略,程序义务错误
load program时提示如下:
请那位大哥帮我分析分析
附件
1.bmp(219.15 KB)
2006-10-20 12:15
附件
1.bmp(219.15 KB)
2006-10-20 12:15
忘了说了
芯片是2401a,内部程序存储器是Flash
看一下你的.gel文件的设置!
高手能否给解释一下?
你用到.gel文件了吗,可也把你的.gel文件发来看看。
ccs自带的gel文件啊
/********************************************************************/
/* Code Composer Studio supports five reserved GEL functions that */
/* automatically get executed if they are defined. They are: */
/* */
/* StartUp() - Executed whenever CCS is invoked */
/* OnReset() - Executed after Debug->Reset CPU */
/* OnRestart() - Executed after Debug->Restart */
/* OnPreFileLoaded() - Executed before File->Load Program */
/* OnFileLoaded() - Executed after File->Load Program */
/* */
/********************************************************************/
StartUp()
{
/* Initialize F2401 memory map */
F2401_Memory_Map();
}
/* uncomment the function(s) you want Code Composer Studio to execute
OnReset(int nErrorCode)
{
}
OnRestart(int nErrorCode)
{
}
OnPreFileLoaded()
{
}
OnFileLoaded(int nErrorCode, int bSymbolsOnly)
{
}
*/
menuitem \"Initialize Memory Map\";
/*----------------------- F2401 Memory Map -------------------------*/
/* */
/* The entire LF2401 address space (program, data, IO) is mapped */
/* as RAM with two exceptions. The on-chip flash is mapped as */
/* ROM and the following illegal/reserved sections are not */
/* mapped: */
/* */
/* Illegal/Rsvd Program Illegal/Rsvd Data Illegal/Rsvd IO */
/* -------------------- ----------------- --------------- */
/* 0x2000 - 0x7fff 0x0080 - 0x01ff 0x0000 - 0xff0e */
/* 0x8200 - 0xfeff 0x0400 - 0x07ff 0xff10 - 0xffff */
/* 0x0a00 - 0x6fff */
/* 0x8000 - 0xffff */
/*------------------------------------------------------------------*/
hotmenu F2401_Memory_Map()
{
GEL_MapReset();
GEL_MapOn();
/* Program Memory Maps */
GEL_MapAdd(0x0000,0,0x2000,1,0); /* On-chip flash memory */
GEL_MapAdd(0x8000,0,0x0200,1,1); /* SARAM */
GEL_MapAdd(0xff00,0,0x0100,1,1); /* DARAM (B0), CNF=1 */
/* Data Memory Maps */
GEL_MapAdd(0x0000,1,0x0060,1,1); /* Mem mapped regs */
GEL_MapAdd(0x0060,1,0x0020,1,1); /* DARAM B2 */
GEL_MapAdd(0x0200,1,0x0200,1,1); /* DARAM B0 & B1 */
GEL_MapAdd(0x0800,1,0x0200,1,1); /* SARAM */
GEL_MapAdd(0x7000,1,0x1000,1,1); /* Peripherals */
/* I/O Memory Maps */
GEL_MapAdd(0xff0f,2,0x0001,1,1); /* Flash ctrl mode reg */
}
menuitem \"Watchdog\";
hotmenu Disable_WD()
{
/* Enable WD override */
*0x7029 = *0x7029 | 0x0068;
*0x7025 = 0x0055;
*0x7025 = 0x00AA;
你使用的片上存储器吧,片上存储器的0000h-2000h是flash,是不能load程序的,而且,你在.gel文件里设置成了禁止写 /* Program Memory Maps */
GEL_MapAdd(0x0000,0,0x2000,1,0); /* On-chip flash memory */
GEL_MapAdd(0x8000,0,0x0200,1,1); /* SARAM */
GEL_MapAdd(0xff00,0,0x0100,1,1); /* DARAM (B0), CNF=1 */
可你的MEMORY
{
PAGE 0:
VECS: origin=0000h, length=0040h
PVECS: origin=0044h, length=0100h
PM: origin=1000h, length=0200h
是从0000h始的,因此有此错误!
把memory改为
MEMORY
{
PAGE 0:
VECS: origin=8000h, length=0040h
PVECS: origin=8044h, length=0100h
PM: origin=8100h, length=0200h
....
试试,如没有中断,应该会好使得。
谢谢你
可我的程序是要用中断的,
而且我看书上的程序都是从0000h开始的a,
为什么要从8000h开始?
小弟新学,请问还有别的什么方法来设置吗
比如改gel文件?