TI中文支持网
TI专业的中文技术问题搜集分享网站

DSP每一次上电偶尔正常工作,偶尔不工作

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

你好   我在做2812的代码添加工作时碰到(原来的代码是能够保证每一次都正常工作的)频繁的在重启供电电源时,发现DSP有时能够启动有时不能启动,因为要添加一些功能,调试的过程中发现有两条语句影响比较大,没有这两条语句时,每一次上电都是正常的,但是加上这两条语句就是有时候正常有时候根本就是启不了,请问这是由于什么原因造成的,下面是我的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

}

谢谢

mangui zhang:

你好  频繁重启   我觉得问题出在了电源上 

当你掉电后要确保电源放电完成      也就是等电源供电彻底掉电以后再重启  

这样测试才能判断是否为程序的问题       建议你为了测试并放电快  

在电源供电端接一个50欧左右的功率电阻    确保断电后能快速放电  

再次上电   程序能正常执行

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

你好   我在做2812的代码添加工作时碰到(原来的代码是能够保证每一次都正常工作的)频繁的在重启供电电源时,发现DSP有时能够启动有时不能启动,因为要添加一些功能,调试的过程中发现有两条语句影响比较大,没有这两条语句时,每一次上电都是正常的,但是加上这两条语句就是有时候正常有时候根本就是启不了,请问这是由于什么原因造成的,下面是我的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

}

谢谢

min liu5:

回复 mangui zhang:

其实电源是不存在问题的,因为只要少了几行代码,上电之后DSP是能够正常启动的,cmd配置中的flash空间是足够 ,扩大堆栈的空间还是一样的结果

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

你好   我在做2812的代码添加工作时碰到(原来的代码是能够保证每一次都正常工作的)频繁的在重启供电电源时,发现DSP有时能够启动有时不能启动,因为要添加一些功能,调试的过程中发现有两条语句影响比较大,没有这两条语句时,每一次上电都是正常的,但是加上这两条语句就是有时候正常有时候根本就是启不了,请问这是由于什么原因造成的,下面是我的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

}

谢谢

min liu5:

回复 mangui zhang:

你好   我已初步找到原因  是外部扩展接口XINTF的原因,可能是数据内存已经溢出了,具体原因没有找到

赞(0)
未经允许不得转载:TI中文支持网 » DSP每一次上电偶尔正常工作,偶尔不工作
分享到: 更多 (0)