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.

[参考译文] TMDSPREX28335:将程序加载到闪存中后、DCL 库无法正常工作

Guru**** 2578945 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1331491/tmdsprex28335-the-dcl-library-does-not-work-properly-after-the-program-is-loaded-to-flash

器件型号:TMDSPREX28335

您好、TI 团队、

我曾使用数字控制库(DCL)来实现简单的 PI 控制算法。 当我使用28335_RAM_Ink .cmd 文件在 RAM 中加载程序时、可以使用该方法。 当我使用计算机进行调试时使用"F28335.cmd"、也可以使用该工具。 但是、当我拔掉仿真器电源并重新开启后、函数"DCL_runPI (pi *p、float rk、float Yk)"无法正常工作。  程序被卡住。 下面是使用 PI 控制命令的 CPU timer0 ISR 程序的一部分。 当程序运行到带有下划线的句子时、它将被卡住、串行通信将停止。

我检查了.cmd 文件和.map 文件、看起来还行、并且在 CCS 上没有显示错误。  

.cmd 文件:" dclfuncs:> RAML2、   page = 0"

和.map 文件:" RAML2          0000a000  00001000 0000003a 00000fc6 RWIX"、其中显示了 DCL 用户指南中建议的58个字大小。

"0 0000a000 _DCL_runPI"

有人能帮我弄清楚导致此问题的可能原因吗? 非常感谢!

此致!

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    通过将相应的代码段(dclfuncs)从闪存复制到 RAM 中已经解决了这个问题。 修改后的.cmd 文件为:

    " dclfuncs:load = FLASHE,
    RUN = RAML2、
    Load_start (_dclfuncsLoadStart)、
    Load_End (_dclfuncsLoadEnd)、
    RUN_START (_dclfuncsRunStart)、
    load_size (_dclfuncsLoadSize)、
    页= 0"

    在 main.c 文件中会使用存储器复制代码:

    "

    InitPieVectTable();
    Memcopy (&RamfuncsLoadStart、&RamfuncsLoadEnd、&RamfuncsRunStart);
    Memcopy (&dclfuncsLoadStart、&dclfuncsLoadEnd、&dclfuncsRunStart);
    InitFlash();

    "

    此外、需要在开头声明相关变量:

    "

    extern UINT16 RamfuncsLoadStart;
    extern UINT16 RamfuncsLoadEnd;
    外部 UINT16 RamfuncsRunStart;

    extern UINT16 dclfuncsLoadStart;
    extern UINT16 dclfuncsLoadEnd;
    extern UINT16 dclfuncsRunStart;

    "

    如果任何人遇到类似的问题,希望这将是有帮助的!