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.

如何修改.CMD文件

我建了一个sin函数值数组,需要在。cmd文件中进行设置存放的位置及长度,要怎么设置呢。没设置的话出现这样的错误:

"E:\\28035 examp\\DSP2803x_common\\cmd\\28035_RAM_lnk.cmd", line 113: error:
   placement fails for object ".cinit", size 0x864 (page 0).  Available ranges:
   RAMM0        size: 0x3b0        unused: 0x391        max hole: 0x391    
"E:\\28035 examp\\DSP2803x_common\\cmd\\28035_RAM_lnk.cmd", line 119: error:
   run placement fails for object ".ebss", size 0x860 (page 1).  Available
   ranges:
   RAML2        size: 0x400        unused: 0x300        max hole: 0x300    

 undefined   first referenced                                                                      
  symbol         in file                                                                           
 ---------   ----------------                                                                      
 _Adc_Config E:\\28035 examp\\chang epwm\\epwm_dcevent_trip\\Debug\\Example_2803xEPwmDCEventTrip.obj

error: unresolved symbols remain
warning: entry-point symbol other than "_c_int00" specified:  "code_start"
error: errors encountered during linking;
   "./Debug/Example_2803xEPwmDCEventTrip.out" not built

>> Compilation failure

Build Complete,
  3 Errors, 1 Warnings, 0 Remarks.

  • 补充一下我用的是ccs3.3,dsp是28035

  • 可以从错误提示中看出是PAGE0的RAMM0和PAGE1的RAML2存储空间不够,你打开cmd文件,通过修改RAMM0和RAML2的大小,或者将你的sin函数数组映射到别的段,放到别的存储空间

  • 谢谢你的回答。该完后还有一个问题,这是什么原因?

    我该动的地方:

     RAMM0      : origin = 0x000050, length = 0x0053B0        // 改动前的是    origin = 0x000050, length = 0x0003B0

    RAML2      : origin = 0x008C00, length = 0x01000       // 改动前的是   RAML2 : origin = 0x008C00, length = 0x00400
    RAML3     : origin = 0x00A500, length = 0x001000      //改动前的 是   RAML3 : origin = 0x009500, length = 0x001000


    出现的错误:

    undefined first referenced
    symbol in file
    --------- ----------------
    _Adc_Config E:\\28035 examp\\chang epwm\\shiyshi spwm\\Debug\\Example_2803xEPwmDCEventTrip.obj

    error: unresolved symbols remain
    warning: entry-point symbol other than "_c_int00" specified: "code_start"
    error: errors encountered during linking;
    "./Debug/Example_2803xEPwmDCEventTrip.out" not built

    >> Compilation failure

    Build Complete,
    1 Errors, 1 Warnings, 0 Remarks.

  • 应该是RAMM0长度设置的不合适,你可以查数据手册0x0800开始有一段为Peripheral Frame 0的空间,是不能拿来用的

  • 再次感谢您的回答。我看了下确实是空间重叠,然后对着内存映射表更改了一下,结果又改回原来的样子了。哎弄了一下午还是弄不好。

    我现在想另外设置位置及长度给数组存放,不知道您能不能给我个例子

  • 比如a[1024]数组存放你的sin函数数据,你可以在main.c文件头上加

    #pragma DATA_SECTION(a,"sindata");

    然后到.cmd文件中的SECTIONS{}内增加

    sindata   : > RAMH0(你可以挑选一个比较空的段)   PAGE1

    通过这样的方式你可以手动选择你所定义数组的位置

  • 谢谢您的耐心解答