TI E2E™ 英文论坛海量技术问答的中文版全新上线,可点击相关论坛查看,或在站内搜索 “参考译文” 获取。

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文件的问题

1、将main中的数组变量放到RAML0段去:

     #pragma DATA_SECTION(array,"mysect")

     _iq array[16][16];

     然后在CMD文件中的section部分添加以下段,请问是在PAGE 0中还是PAGE 1 中定义段mysect?

     mysect : > RAML0, PAGE = 0  /* Program Memory */  或PAGE 1  /* Data Memory */

2、

MEMORY
{
PAGE 0: /* Program Memory */

IQTABLES : origin = 0x3FE000, length = 0x000B50 /* IQ Math Tables in Boot ROM */
IQTABLES2 : origin = 0x3FEB50, length = 0x00008C /* IQ Math Tables in Boot ROM */
IQTABLES3 : origin = 0x3FEBDC, length = 0x0000AA /* IQ Math Tables in Boot ROM */
BOOTROM : origin = 0x3FF27C, length = 0x000D44 /* Boot ROM */

}

IQmath : > FLASHCD PAGE = 0    /* Math Code */


IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD

/*  Uncomment the section below if calling the IQNexp() or IQexp() functions from the IQMath.lib library in order to utilize the relevant IQ Math table in Boot ROM (This saves space and Boot ROM is 1 wait-state). If this section is not uncommented, IQmathTables2 will be loaded into other memory (SARAM, Flash, etc.) and will take up space, but 0 wait-state is possible. */

IQmathTables2 : > IQTABLES2, PAGE = 0, TYPE = NOLOAD
{

IQmath.lib<IQNexpTable.obj> (IQmathTablesRam)

}

/* Uncomment the section below if calling the IQNasin() or IQasin() functions from the IQMath.lib library in order to utilize the
relevant IQ Math table in Boot ROM (This saves space and Boot ROM is 1 wait-state). If this section is not uncommented, IQmathTables2 will be loaded into other memory (SARAM, Flash, etc.) and will take up space, but 0 wait-state is possible. */


IQmathTables3 : > IQTABLES3, PAGE = 0, TYPE = NOLOAD
{

IQmath.lib<IQNasinTable.obj> (IQmathTablesRam)

}

IQmathTablesRam : LOAD = FLASHGH, PAGE = 1
                                     RUN = RAML1L2L3,PAGE = 1
                                    LOAD_START(_IQmathTablesRamLoadStart),
                                     LOAD_END(_IQmathTablesRamLoadEnd),
RUN_START(_IQmathTablesRamRunStart)

这几个段IQmath、IQmathTables、IQmathTables2、IQmathTables3、IQmathTablesRam有什么区别,分别是用来做什么的?
{ IQmath.lib<IQNexpTable.obj> (IQmathTablesRam) }是什么功能?
IQmathTablesRamLoadStart、IQmathTablesRamLoadEnd要在main中哪里声明的?

  • Haypin,

    1.数据段放在page1.

    2.IQmath、IQmathTables、IQmathTables2、IQmathTables3 对应不同的IQmath不同函数会用到的表格,IQmathTablesRam是定义了一个段,将某些IQmath函数放在RAM中跑。函数声明在main文件前面声明为外部变量。因为在main函数中会调用memcpy函数。

    Eric

  • IQmathTablesRamLoadStart、IQmathTablesRamLoadEn是在哪个文件中声明的?

    而RamfuncsLoadStart是在DSP2803x_GlobalPrototypes.h中声明的。好像是要自己在DSP2803x_GlobalPrototypes.h声明?

    // External symbols created by the linker cmd file
    // DSP28 examples will use these to relocate code from one LOAD location
    // in Flash to a different RUN location in internal
    // RAM
    extern Uint16 RamfuncsLoadStart;
    extern Uint16 RamfuncsLoadEnd;
    extern Uint16 RamfuncsRunStart;

  • Haypin,

    只要在使用到这些变量的源文件之前,对这些变量进行声明就可以了,不管是使用include 头文件的方式,还是直接在main文件中进行声明,都可以。

    Eric