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板偶尔不能进入主循环,程序卡在初始化过程中的问题,请大侠指教!

Other Parts Discussed in Thread: TMS320VC5402

  我在用DSP28335做试验的时候,如果频繁的重启供电电源,就发现DSP板偶尔不能进入主循环,经过查找发现程序停在了某一个初始化代码的位置上,但是如果删除这段代码,程序又偶尔会卡在下一段初始化的代码位置,请问各位大侠有没有遇到这种情况,是因为电源供电的问题还是什么原因?请大家多多指教!

  • 停在某个位置上一段时间后,应该会触发看门狗复位芯片,复位后仍然不正常吗?

    是哪段初始化程序?是bootrom中的程序,还是main中的初始化程序?

    建议参考附件中的电路设计28335的供电电路和上电时序。

    F28335 controlCARD ZJZ Schematic [R2.2].pdf
  • Jie tian,

           请问你测试的是你自己的代码还是TI的例程?

           从你描述的情况来看,跟软件的关系更大一些,而且跟程序复制到RAM有关系,不知道你是否有在一开始就把程序复制到RAM区域,一定要保证在调用这些代码之前把程序放到RAM里面去,否则程序会跑飞。

    ERIC

  • 我测试的是自己的代码;在程序中的确是将一部分代码由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();

       }

     

     

  • jie tian,

          有没有另外一块demo板,如果有,可以把程序烧到里面,测试,排除硬件问题。

          把程序复制到RAM的操作取消掉,测试是否是这个问题。

          可以把CMD贴上上,一起分析一下。

    Eric

  • jie tian

        你好,不知你这个问题解决没有,因为最近在使用F28335也遇到同样的问题,偶尔刚上电时在初始化后不能进入到主循环程序,但重启下就OK了。

  • 你好:

           我现在用的是TMS320VC5402的 DSP ,也是上电长鸣,断电再上电就可以了,也不晓得是怎么回事,好像是外部Flash 程序调用失败  ,就像复位后没有进入主循环一样 。帮忙分析分析是怎么回事啊

  • 你好   我碰到上面一样的问题,原来的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

    }

    谢谢

  • 之前一步一步查找发现是SPI读写外部flash时出现的问题,后来加上看门狗就好了。

  • 汇编的怎么加看门狗啊 求帮助!!!

  • 在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

  • DSP5402的看门狗不知道如何添加啊   谢谢

  • 你的问题解决了吗?我也遇到了这样的问题,DSP初始化过程中卡住了。

  • 你好,我也遇到,DSP卡在初始化的问题。怎么解决呢