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.

TMS320F28379D: 程序烧写进flash中不正确问题

Part Number: TMS320F28379D

我们dsp伺服控制程序,通过仿真器debug模式全部功能可以正常工作,但是release模式烧写进flash,上电启动后,传感器数据都能采集正确,发送控制命令伺服没有响应,请问可能是什么原因,需要什么办法才能解决。

有部分代码是在cla中编写的,是否可能有部分代码功能有没正常运行。

  • 从flash加载到ram中的代码是有的

    MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);

    InitFlash();

    并且我们在程序里也增加了把cla程序加载到flash里的代码,cla里有部分数据采集代码,这部分代码采集的数据也是正常的。

    extern uint32_t Cla1funcsRunStart, Cla1funcsLoadStart, Cla1funcsLoadSize;
    extern uint32_t CLA1mathTablesRunStart, CLA1mathTablesLoadStart, CLA1mathTablesLoadSize;

    EALLOW;

    #ifdef _FLASH
    // Copy over code from FLASH to RAM
    memcpy((uint32_t *)&Cla1funcsRunStart, (uint32_t *)&Cla1funcsLoadStart,
    (uint32_t)&Cla1funcsLoadSize);
    #ifndef CLA_MATH_TABLES_IN_ROM
    memcpy((uint32_t *)&CLA1mathTablesRunStart, (uint32_t *)&CLA1mathTablesLoadStart,
    (uint32_t)&CLA1mathTablesLoadSize);
    #endif //CLA_MATH_TABLES_IN_ROM

    #endif //_FLASH

  • 传感器数据都能采集正确,

    这个是怎么看出来的?

    建议在代码中加入翻转IO的操作,以检查相应代码是否正常执行

  • 您好,谢谢解答。

    我们板卡控制电机,电机上有个编码器,电机旋转位置能通过外部设备测量,和编码器返回值是能够对应上的。

    现象就是在线加载,能控制电机运动,但是烧写完flash,就只能读取编码器数据了,控制不了电机。

  • 有试一下烧写到flash中debug吗?

    如之前所说,还是建议在代码中加入翻转IO之类的操作,先判断一下代码的运行情况

  • 由于我的芯片是bga封装的,没办法用示波器看io翻转了。
    板卡上有另外的dsp,我在程序里加入了io翻转,用板子上另外的dsp监测,是能看到我的io翻转信号的。
    烧写到flash中debug,是选择release,点小锤子,然后再点绿色小虫子吧,这样操作,一开始全部功能都是好的,过一会后,伺服就失控了。

  • 请问,有没有可能是我生成的bin文件没有包含全部的程序呢,有没有地方可以设置生成bin文件的大小。

  • 我需要一些时间来看一下

  • 我现在release模式烧写进flash,挂着仿真器,也不能运行了。

  • 有切换boot模式吗