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.

28335_RAM_lnk.cmd编译出错



您好,我建立了一个工程文件,利用28335.cmd文件编译没有问题,但改为28335_RAM_lnk.cmd文件后,就报错,具体如下:

 errors encountered during linking; "./Debug/Example_2833xCpuTimer.out"

不知道是怎么回事?请您多多指教。谢谢!

  • 应该是CMD中分配的存储空间不足导致的,CCS完整的报错提示是什么?

  • 您好,具体内容为:

     undefined          first referenced                                                                                          symbol                in file                                                                                              ---------          ----------------                                                                                         _RamfuncsLoadEnd   C:\\Users\\whx\\Desktop\\CPU_DSP_100503\\CPU_DSP_100503\\AD6K_S_QGX_Pro\\sys\\build\\Debug\\28335_TR.obj  _RamfuncsLoadStart C:\\Users\\whx\\Desktop\\CPU_DSP_100503\\CPU_DSP_100503\\AD6K_S_QGX_Pro\\sys\\build\\Debug\\28335_TR.obj  _RamfuncsRunStart  C:\\Users\\whx\\Desktop\\CPU_DSP_100503\\CPU_DSP_100503\\AD6K_S_QGX_Pro\\sys\\build\\Debug\\28335_TR.obj

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

    >> Compilation failure

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

     

    然后我就在.c文件中查看了一下上述三个的变量,看到上面有如下定义:

     

    extern Uint16 RamfuncsLoadStart;

    extern Uint16 RamfuncsLoadEnd;

    extern Uint16 RamfuncsRunStart;

    然后我又查了一下,在DSP2833x_GlobalPrototypes.h文件中也有一模一样的定义。然后我把.c的定义中的三个extern去掉,如下:

     Uint16 RamfuncsLoadStart;

    Uint16 RamfuncsLoadEnd;

     Uint16 RamfuncsRunStart;,编译通过了。

    以上都是选择ram_lnk.cmd文件时出现的情况。然后我打开看了一下28335.cmd文件。看到里面有如下三个变量:

     LOAD_START(_RamfuncsLoadStart),                          LOAD_END(_RamfuncsLoadEnd),                          RUN_START(_RamfuncsRunStart),

    我有些搞不懂他们的关系了。

     

    谢谢您!

  • 你是不是用到了memcopy函数,使用RAM CMD文件不需要使用这个函数。

  • 您好,

    是的,如下: 

     

    // Step 4. Initialize the Device Peripheral. This function can be  /*****************************************************************************************/     MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);     InitFlash();

    那么,往flash里下载与往ram里下载,不同的就是cmd文件和这个函数吗,是吗?

     

    谢谢!

  • 这个函数是将代码从flash搬移到RAM,使用RAM CMD你的程序本来就是下载到RAM中的。

  • 哦,是这样啊,那就把这个函数屏蔽就行吧,往flash里下载也不用它是吧,谢谢您!

  • 如果你要把flash中的程序搬移到RAM中运行,往Flash里下载的时候就需要用到。