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.

Flash启动



我使用28377D,在将程序烧写到FLASH的时候,在CCS上面点击运行的时候,程序正常运行;

断电之后,再上电,程序就无法运行了;

后来发现是有个全局数组比较大的原因导致的,但是为什么数组变大了就不行了?

  • “后来发现是有个全局数组比较大的原因导致的,但是为什么数组变大了就不行了?”
    Eric:
    数组变大了,编译没有问题吗?或者要检查一下CMD。 是不是全局变量占用的RAM侵犯到堆栈的RAM。
  • “我使用28377D,在将程序烧写到FLASH的时候,在CCS上面点击运行的时候,程序正常运行;

    断电之后,再上电,程序就无法运行了;

    后来发现是有个全局数组比较大的原因导致的,但是为什么数组变大了就不行了?”
    ERIC:
    哦,有可能是初始化的原因,在进入Main之前有一段全局变量的初始化值搬运的过程,如果看门狗打开的情况,会存在复位的情况。
    你在工程中查找code start .asm代码,然后将下面的参数修改一下:
    把WD_DISABLE改成1.

    WD_DISABLE .set 1 ;set to 1 to disable WD, else set to 0

    .ref _c_int00
    .global code_start

    ***********************************************************************
    * Function: codestart section
    *
    * Description: Branch to code starting point
    ***********************************************************************

    .sect "codestart"

    code_start:
    .if WD_DISABLE == 1
    LB wd_disable ;Branch to watchdog disable code
    .else
    LB _c_int00 ;Branch to start of boot._asm in RTS library
    .endif

    ;end codestart section