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.

[参考译文] 编译器/TMS320F28377D:询问在 CAL 中使用常量数据的问题!

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/700455/compiler-tms320f28377d-ask-for-the-problem-of-using-const-data-in-cal

器件型号:TMS320F28377D

工具/软件:TI C/C++编译器

在 CLA 程序中、在闪存模式下、需要使用 const short Table[]={0、1、2...}。 CMD 的 CMD 部分定义如下:
 CLAscratch:
                     {*。obj (CLAscratch)
                     += CLA_ScratchPad_size;
                     RAMLS0、PAGE = 1  

  暂存区:>RAMLS0,页=1

 .bss_cla:> RAMLS0,PAGE = 1.

 //.const_CLA      :> RAMLS0,      PAGE = 1.
   .const_CLA:负载= FLASHB、
                       运行= RAMLS0、
                       run_start (_Cla1ConstRunStart)、
                       Load_start (_Cla1ConstLoadStart)、
                       load_size (_Cla1ConstLoadSize)、
                       PAGE = 1.

编译程序后会出现以下警报:
"./flash_lnk_cpu1.cmd"、第274行:错误#10265:没有用于放置".const_cla"的有效存储器范围(NULL)
"../flash_lnk_cpu1.cmd"、第274行:错误#10099-D:程序将无法放入可用内存中。 对齐/分块加载".const_cla"大小为0x20页1的放置失败
变量 Cla1ConstRunStart、Cla1ConstLoadStart 和 Cla1ConstLoadSize 也不会看到它们的定义位置。 例程未找到任何常量数据。

问题:

1、哪一个是正确的? ".CONST_CLA      :>RAMLS0、      PAGE = 1"或

       "  .const_cla:load = FLASHB、
                       运行= RAMLS0、
                       run_start (_Cla1ConstRunStart)、
                       Load_start (_Cla1ConstLoadStart)、
                       load_size (_Cla1ConstLoadSize)、
                       页= 1"

2、当我使用".const_CLA      :>RAMLS0、      PAGE = 1"时、常量数据仿真正确、成本仿真不正确。

谢谢!

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

    如果要将程序加载到闪存中、则需要将所有数据加载到闪存中、然后将其复制到 RAM 中。 第二个问题是正确的。

    出现构建错误时、您能否确认 FLASHB 和 RAMLS0位于链接器命令文件的同一页面?

    此致、
    SAL