This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
建议楼主在Code Start Brach.asm中对外部Ram进行初始化配置。
将InitXINTFRAM()编译之后生成.obj文件,在Code Start Branch中调用即可。
具体写法参考下面这个帖子:
我测试了一下,根据您给的建议在Code Start Branch中增加如下代码
WD_DISABLE .set 1 ;set to 1 to disable WD, else set to 0
.ref _c_int00
.global code_start
.ref _InitSysCtrl ;开外设
.ref _init_zone7 ;初始化XINTF总线为16BIT(用户的系统硬件设计相关)
然后变异通过,并下载进DSP里面,结过还是在运行完我的初始化函数后程序就运行不正确了,具体来说是运行完
void InitSysCtrl(void)
{
// Disable the watchdog
DisableDog();
// Initialize the PLL control: PLLCR and DIVSEL
// DSP28_PLLCR and DSP28_DIVSEL are defined in DSP2833x_Examples.h
InitPll(DSP28_PLLCR,DSP28_DIVSEL);
init_zone7();
// Initialize the peripheral clocks
InitPeripheralClocks();
}这个函数,就是ti自带的,只不过我在里面加了一个初始化init_zone7();
运行完这个函数后有时程序会跑去再接着运行global code_start
初始化函数的下一行不会被执行到,还有就是有的时候就是在main函数的init()前面设置一个断点,并没有while循环,但是程序运行时会一直进入这个断点处停止,期待您的回答
另,有个老师说也许是我的程序在内部的RAM和外部的RAM中,由于速度不匹配造成的这种结果,
用下面这个,不知道你和我的是否一样。
.if WD_DISABLE == 1
.text
wd_disable:
SETC OBJMODE ;Set OBJMODE for 28x object code
EALLOW ;Enable EALLOW protected register access
MOVZ DP, #7029h>>6 ;Set data page for WDCR register
MOV @7029h, #0068h ;Set WDDIS bit in WDCR to disable WD
EDIS
LCR _InitSysCtrl
LCR _InitZone7 ;Disable EALLOW protected register access
LB _c_int00 ;Branch to start of boot.asm in RTS library
.endif
;end wd_disable
.end
另外,你那个老师说的也有道理,要对外部的RAM进行初始化配置,否则非常慢。
配置代码如下:
void Sram_init( void)
{
XintfRegs.XTIMING6.bit.X2TIMING = 0;
XintfRegs.XTIMING6.bit.XRDLEAD = 1;
XintfRegs.XTIMING6.bit.XRDACTIVE = 1;
XintfRegs.XTIMING6.bit.XRDTRAIL = 0;
XintfRegs.XTIMING6.bit.XWRLEAD = 1;
XintfRegs.XTIMING6.bit.XWRACTIVE = 1;
XintfRegs.XTIMING6.bit.XWRTRAIL = 0;
XintfRegs.XINTCNF2.bit.CLKMODE = 0;
}
您好,Mr Chen,
我按照您的方法在Code Start Brach.asm里面加上你给我写的那段程序,因为我的初始化函数名称和您的不一样就修改了下函数名,但是编译的时候提示如下错误
"DSP2833x_CodeStartBranch.asm", ERROR! at EOF: [E0300] The following symbols
are undefined:
1 Assembly Error, No Assembly Warnings
init
init_zone7
Errors in Source - Assembler Aborted
是什么原因啊,我的函数都是定义的全局的,期待您的回答