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:使用 ramfuncs 与 ti.ramfuncs 错误

Guru**** 2200880 points
Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/594577/tms320f28379d-using-ramfuncs-vs-ti-ramfuncs-error

器件型号:TMS320F28379D
Thread 中讨论的其他器件:controlSUITEC2000WARE

大家好、我使用的是 Lab3中代码的修改版本、可以在此处下载:  

我想从闪存中运行代码、并且成功地运行了代码、但我对 Flash_linker 命令文件中的以下部分感到有点困惑:

#ifdef __TI_Compiler_version__
#if __TI_Compiler_version__>=15009000
.TI.ramfunc:{}负载= FLASHD,
RUN = RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3、
load_start (_RamfuncsLoadStart)、
load_size (_RamfuncsLoadSize)、
load_end (_RamfuncsLoadEnd)、
run_start (_RamfuncsRunStart)、
run_size (_RamfuncsRunSize)、
run_end (_RamfuncsRunEnd)、
PAGE = 0、ALIGN (4)
#endif
#endif


基本而言、如果我按原样运行代码、它不起作用、我需要绕过 #if __TI_Compiler_version__>=15009000 、以便我的代码改用'ramfuncs'作为段。

我还在.c 文件中使用了类似的旁路:

#ifdef __TI_Compiler_version__
#if __TI_Compiler_version__>=15009000
#define ramFunc 段"ramfuncs "
//#define ramFuncSection ".TI.ramfunc" -未使用
其他
#define ramFunc 段"ramfuncs "
#endif
#endif

基本上、默认代码会让我相信我需要使用 .TI.ramfunc 、而不是基于编译器版本的 ramfuncs、但是我只能通过使用 ramfuncs 使其正常工作。 如果有人能帮助我们了解这一点、我们将不胜感激。

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

    对于较新的编译器、我们将对 RAM 函数段使用较新的命名".TI.ramfunc"。 从技术上讲、这两种方法都应该起作用、但它依赖于链接器段的命名以及要对齐的代码中使用的 pragma。 您希望在修复链接器之前使用它、以包含一条用于处理任一命名的 else 语句。 C2000Ware 和 controlSUITE 中的最新配套资料已设置为可处理这两种情况。

    如果您将代码中的任何引用从 ramfuncs 切换到.TI.ramfunc、它也应该与.TI.ramfunc 一起使用。

    此致
    Chris