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.

F28377S不能脱机运行



我有一块F28377S的伺服驱动控制板,在控制板中下载自己写的控制LED的小程序,断电并不用仿真器可以正常运行。把整个伺服代码下载,带着仿真器程序可以运行,但断电后重启程序不在运行?现在不知哪里出现问题了。

  • 两个程序用的CMD文件相同

  • 您好,

    需要使用flash的cmd文件,并配置好boot mode模式为flash启动。

  • 同样的电路板,同样的CMD文件,写一个控制LED的小程序,下载程序后断电重启,程序是可以正常运行的。

    这是我的CMD:

    MEMORY
    {
    PAGE 0 : /* Program Memory */
    /* Memory (RAM/FLASH) blocks can be moved to PAGE1 for data allocation */
    /* BEGIN is used for the "boot to Flash" bootloader mode */

    BEGIN : origin = 0x080000, length = 0x000002
    RAMM0 : origin = 0x000122, length = 0x0002DE
    RAMD0 : origin = 0x00B000, length = 0x000800


    RAMLS0 : origin = 0x008000, length = 0x002800

    RAMGS14 : origin = 0x01A000, length = 0x001000 /* Only Available on , F28377S, F28375S devices. Remove line on other devices. */

    RAMGS15 : origin = 0x01B000, length = 0x001000 /* Only Available on , F28377S, F28375S devices. Remove line on other devices. */
    RESET : origin = 0x3FFFC0, length = 0x000002

    /* Flash sectors */
    FLASHA : origin = 0x080002, length = 0x001FFE /* on-chip Flash */
    FLASHB : origin = 0x082000, length = 0x004000 /* on-chip Flash */

    FLASHD : origin = 0x086000, length = 0x01A000 /* on-chip Flash */

    FLASHH : origin = 0x0A0000, length = 0x008000 /* on-chip Flash */
    FLASHI : origin = 0x0A8000, length = 0x008000 /* on-chip Flash */
    FLASHJ : origin = 0x0B0000, length = 0x008000 /* on-chip Flash */
    FLASHK : origin = 0x0B8000, length = 0x002000 /* on-chip Flash */
    FLASHL : origin = 0x0BA000, length = 0x002000 /* on-chip Flash */
    FLASHM : origin = 0x0BC000, length = 0x002000 /* on-chip Flash */

    FLASHN : origin = 0x0BE000, length = 0x002000 /* on-chip Flash */

    PAGE 1 : /* Data Memory */
    /* Memory (RAM/FLASH) blocks can be moved to PAGE0 for program allocation */

    BOOT_RSVD : origin = 0x000002, length = 0x000120 /* Part of M0, BOOT rom will use this for stack */
    RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */
    RAMD1 : origin = 0x00B800, length = 0x000800

    RAMLS5 : origin = 0x00A800, length = 0x000800

    RAMGS0 : origin = 0x00C000, length = 0x001000
    RAMGS1 : origin = 0x00D000, length = 0x001000
    RAMGS2 : origin = 0x00E000, length = 0x006000

    RAMGS8 : origin = 0x014000, length = 0x001000
    RAMGS9 : origin = 0x015000, length = 0x001000
    RAMGS10 : origin = 0x016000, length = 0x001000
    RAMGS11 : origin = 0x017000, length = 0x001000
    RAMGS12 : origin = 0x018000, length = 0x001000 /* Only Available on , F28377S, F28375S devices. Remove line on other devices. */
    RAMGS13 : origin = 0x019000, length = 0x001000 /* Only Available on , F28377S, F28375S devices. Remove line on other devices. */

    }


    SECTIONS
    {
    /* Allocate program areas: */
    .cinit : > FLASHB PAGE = 0, ALIGN(4)
    .pinit : > FLASHB, PAGE = 0, ALIGN(4)
    .text : >> FLASHB | FLASHD | FLASHH|FLASHI PAGE = 0, ALIGN(4)
    codestart : > BEGIN PAGE = 0, ALIGN(4)

    #ifdef __TI_COMPILER_VERSION__
    #if __TI_COMPILER_VERSION__ >= 15009000
    .TI.ramfunc : {} LOAD = FLASHD,
    RUN = RAMLS0 ,
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    RUN_SIZE(_RamfuncsRunSize),
    RUN_END(_RamfuncsRunEnd),
    PAGE = 0, ALIGN(4)
    #else
    ramfuncs : LOAD = FLASHD,
    RUN = RAMLS0,
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    RUN_SIZE(_RamfuncsRunSize),
    RUN_END(_RamfuncsRunEnd),
    PAGE = 0, ALIGN(4)
    #endif
    #endif

    /* Allocate uninitalized data sections: */
    .stack : > RAMM1 PAGE = 1
    .ebss : >> RAMLS5 | RAMGS0 | RAMGS1| RAMGS2PAGE = 1
    .esysmem : > RAMLS5 PAGE = 1

    /* Initalized sections go in Flash */
    .econst : >>  FLASHH PAGE = 0, ALIGN(4)
    .switch : > FLASHB PAGE = 0, ALIGN(4)

    .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */

    IQmath       :>FLASHK,PAGE=0,ALIGN(4)

    IQmathTables        :>FLASHL,PAGE=0,ALIGN(4)

    }

    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */

  • 检查下你的工程中是否缺少源文件。

  • 程序中不缺少文件,带着仿真器完全是正常的,使用的也是FLAsh的CMD文件,但是就是重新断电后,程序就没有了。程序好像在附近中的163和191行之间循环。

  • 你好,由于没法帮你复现所以建议你看看程序具体“卡”在了哪里,脱机检测的话可以使用反转IO的方式了解程序执行到什么位置。

  • 您好!
    请检查一下整个伺服代码的初始化程序是否执行时间过长从而有可能导致看门狗复位。
  • 问题已解决,启动文件把看门狗打开,初始化的变量太多看门狗复位。