我在用DSP28335做试验的时候,如果频繁的重启供电电源,就发现DSP板偶尔不能进入主循环,经过查找发现程序停在了某一个初始化代码的位置上,但是如果删除这段代码,程序又偶尔会卡在下一段初始化的代码位置,请问各位大侠有没有遇到这种情况,是因为电源供电的问题还是什么原因?请大家多多指教!
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.
我在用DSP28335做试验的时候,如果频繁的重启供电电源,就发现DSP板偶尔不能进入主循环,经过查找发现程序停在了某一个初始化代码的位置上,但是如果删除这段代码,程序又偶尔会卡在下一段初始化的代码位置,请问各位大侠有没有遇到这种情况,是因为电源供电的问题还是什么原因?请大家多多指教!
我测试的是自己的代码;在程序中的确是将一部分代码由flash中复制到了ram中用来提高运行速度,减小程序执行时间;我在cmd文件中开辟了一个8K的ramfuncs用来存放复制的代码;
如果说是因为复制到ram的原因,那为什么程序只是偶尔卡到了初始化的地方?
现将初始化的程序贴出来:
void main()
{
InitSys();//DSP硬件配置初始化
// 以下是烧写FLASH使用的程序段,带仿真器调试时请注释掉! MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart); InitFlash(); // 以上语句在带仿真器调试时请注释掉!
InitCtrSys();
ComVar_Init(); //初始化 参数初始化、事件记录事故记录和试验记录所用的参数
// Enable global Interrupts and higher priority real-time debug events: EINT; // Enable Global interrupt INTM ERTM; // Enable Global realtime interrupt DBGM
Para_Init(); //控制参数初始化
BasicCircle();
}
你好 我碰到上面一样的问题,原来的2812 代码工作是正常的,因为要添加一些功能,调试的过程中发现有两条语句影响比较大,没有这两条语句时,每一次上电都是正常的,但是加上这两条语句就是有时候正常有时候根本就是启不了,请问这是由于什么原因造成的,下面是我的cmd文件:
MEMORY
{
PAGE 0 :
/* For this example, H0 is split between PAGE 0 and PAGE 1 */
/* BEGIN is used for the "boot to HO" bootloader mode */
/* RESET is loaded with the reset vector only if */
/* the boot is from XINTF Zone 7. Otherwise reset vector */
/* is fetched from boot ROM. See .reset section below */
//RAMM0 : origin = 0x000000, length = 0x000400
/*
BEGIN : origin = 0x3F8000, length = 0x000002
PRAMH0 : origin = 0x3F8002, length = 0x0013fe
RESET : origin = 0x3FFFC0, length = 0x000002
*/
RAMPM : origin = 0x3F8002, length = 0x000F00
OTP : origin = 0x3D7800, length = 0x000800
FLASHJ : origin = 0x3D8000, length = 0x002000
FLASHI : origin = 0x3DA000, length = 0x002000
FLASHSTART : origin = 0x3DC000, length = 0x000100
FLASHH : origin = 0x3DC100, length = 0x00Ff00
/*FLASHD : origin = 0x3EC000, length = 0x004000*/
FLASHC : origin = 0x3F0000, length = 0x004000
FLASHB : origin = 0x3F4000, length = 0x002000
FLASHA : origin = 0x3F6000, length = 0x001FF4
BEGIN : origin = 0x3F7FF4, length = 0x000004
PASSWDS : origin = 0x3F7FF8, length = 0x000008
ROM : origin = 0x3FF000, length = 0x000FC0
VECTORS : origin = 0x3FFFC2, length = 0x00003E
PAGE 1 :
/* For this example, H0 is split between PAGE 0 and PAGE 1 */
ERAM : origin = 0x3EB000, length = 0x001000
RAMM1 : origin = 0x00040, length = 0x0007BF
DRAMH0 : origin = 0x3F8802, length = 0x0018FD
DRAML : origin = 0x8000, length = 0x1ffff
DSRAM : origin = 0x100000, length = 0x080000
}
SECTIONS
{
/* Setup for "boot to H0" mode:
The codestart section (found in DSP28_CodeStartBranch.asm)
re-directs execution to the start of user code.
Place this section at the start of H0 */
/*codestart : > BEGIN, PAGE = 0*/
ramfuncs : > FLASHH PAGE = 0
/*.text : > PRAMH0, PAGE = 0*/
/*.cinit : > RAMM0, PAGE = 0*/
.pinit : > FLASHH, PAGE = 0
.switch : > FLASHH, PAGE = 0
/*.reset : > BEGIN, PAGE = 0, TYPE = DSECT*/ /* not used, */
/* Allocate program areas: */
.reset : > BEGIN PAGE = 0
vectors : > VECTORS PAGE = 0
.cinit : > FLASHH PAGE = 0
.text : > FLASHH PAGE = 0
.pm_sdram : > FLASHH PAGE = 0
.AppStartRom : > FLASHSTART PAGE = 0
ramfunc1 : LOAD = FLASHH,
RUN = RAMPM,
LOAD_START(_RamfuncsLoadStart),
LOAD_END(_RamfuncsLoadEnd),
RUN_START(_RamfuncsRunStart),
PAGE = 0
.stack : > RAMM1, PAGE = 1
.bss : > DRAML, PAGE = 1
.ebss : > DRAML, PAGE = 1
{
/* Get Run Address */
__const_run = .;
/* Mark Load Address*/
*(.c_mark)
/* Allocate .const */
*(.const)
/* Compute Length */
__const_length = .-__const_run;
}
.usect : > DSRAM, PAGE = 1
/*.econst: load = FLASHH PAGE 0, run = DRAML PAGE 1*/
.econst : > ERAM, PAGE = 1
{
/* Get Run Address */
__econst_run = .;
/* Mark Load Address*/
*(.ec_mark)
/* Allocate .const */
*(.econst)
/* Compute Length */
__econst_length = .-__econst_run;
}
.esysmem : > DRAML, PAGE = 1
.off_ram : > DSRAM, PAGE = 1
}
谢谢
在DSP2833x_CodeStartBranch.asm中就有禁止看门狗的代码,把0x0068改成使能的0x0028
.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 ;Disable EALLOW protected register access