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.

[参考译文] TMS320F28P550SJ:SysConfig 不允许在链接器脚本中为不同的构建配置设置具有相同名称的用户定义的内存部分

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1361526/tms320f28p550sj-sysconfig-does-not-allow-to-set-user-defined-memory-sections-in-the-linker-script-with-the-same-name-for-different-build-configurations

器件型号:TMS320F28P550SJ
主题中讨论的其他器件:SysConfigC2000WARE

在 Code Composer Studio 中、我导入了一个 DSP RFFT 示例项目。 它附带"RAM"和"flash"构建配置。 工程定义了一些 存储 RFFT 数据的内存段(例如 RFFTdata1)。 RAM 配置有针对这些区域的定义、如下所示:

    //
    // User Sections
    //
    RFFTdata1 {  }         >  RAMGS3,
                              ALIGN(512)
    RFFTdata2 {  }         >  RAMGS3
    RFFTdata3 {  }         >  RAMGS3
    FPUfftTables {  }      >  RAMGS3
    RFFTdata4 {  }         >  RAMGS3
    FPUmathTables {  }     >  RAMGS2

该工程使用 SysConfig、我也尝试在闪存配置中定义此类存储器区域、因为在那里未定义它们(未定义它们会导致代码行为不正确)。

 但是、当我在 SysConfig 中将 RFFTdata1添加到用户定义的段时、我会收到错误

错误:generic_ram_lnk (/utilities/cmd_tool/cmd_syscfg/source/CMD) userSection[0].$name:重复名称:"RFFTdata1"也存在于用户定义段的实例上
错误:generic_flash_lnk (/utilities/cmd_tool/cmd_syscfg/source/CMD) userSection[0].$name:重复名称:"RFFTdata1"在用户定义段的实例上也存在

SysConfig UI 中和编译代码时都会出现此错误。 请注意、生成链接器脚本(device_cmd.cmd)使用预处理器指令来选择要使用的存储器配置、因此不应将 RFFTdata1视为重复、请参阅下面的(为清晰起见而缩短了):

#ifdef generic_ram_lnk

MEMORY
{
    ...
}


SECTIONS
{
    ...
}

#endif
#ifdef generic_flash_lnk

MEMORY
{
    ...
}


SECTIONS
{
    ...
}

#endif

/*
//===========================================================================
// End of file.
//===========================================================================
*/

如何在闪存配置中将所需的 RFFTdata 段添加到链接器脚本?

谢谢。

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

    您好!  

    您能否共享工程和 SysConfig 文件以供查看?

    此外、在 Project 属性中检查是否为闪存配置定义了预定义符号(GENERAL_FLASH_lnk)。

    此致

    西达尔特

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

    您好!

    当然、该工程与 C2000ware 中的示例工程 dsp_rfft_fpu32_f28p55x 相同。

    这是 SysConfig:

    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "F28P55x" --package "128PDT" --part "F28P55x_128PDT" --context "system" --product "C2000WARE@5.02.00.00"
     * @versions {"tool":"1.20.0+3587"}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const cputimer       = scripting.addModule("/driverlib/cputimer.js", {}, false);
    const cputimer1      = cputimer.addInstance();
    const device_support = scripting.addModule("/driverlib/device_support.js");
    const sysctl         = scripting.addModule("/driverlib/sysctl.js");
    const FFT            = scripting.addModule("/libraries/dsp/FPU/FFT/FFT.js", {}, false);
    const FFT1           = FFT.addInstance();
    const FPUfastRTS     = scripting.addModule("/libraries/math/FPUfastRTS/FPUfastRTS.js", {}, false);
    const FPUfastRTS1    = FPUfastRTS.addInstance();
    const CMD            = scripting.addModule("/utilities/cmd_tool/cmd_syscfg/source/CMD");
    const CMD1           = CMD.addInstance();
    const CMD2           = CMD.addInstance();
    
    /**
     * Write custom configuration values to the imported modules.
     */
    cputimer1.$name           = "myCPUTIMER0";
    cputimer1.emulationMode   = "CPUTIMER_EMULATIONMODE_RUNFREE";
    cputimer1.startTimer      = true;
    cputimer1.enableInterrupt = true;
    cputimer1.timerPeriod     = 100000000;
    
    FFT1.$name                  = "myFFT0";
    FFT1.RFFT.create(1);
    FFT1.RFFT[0].$name          = "myRFFT0";
    FFT1.RFFT[0].numStages      = 8;
    FFT1.RFFT[0].inPtr          = "inPtr";
    FFT1.RFFT[0].outPtr         = "outPtr";
    FFT1.RFFT[0].magPtr         = "magPtr";
    FFT1.RFFT[0].phasPtr        = "phPtr";
    FFT1.RFFT[0].coeffPtr       = "twiddlePtr";
    FFT1.RFFT[0].sincosFunction = false;
    
    FPUfastRTS1.$name = "myFFR0";
    
    CMD1.$name                             = "generic_ram_lnk";
    CMD1.sectionMemory_const               = ["RAMLS5","RAMLS6"];
    CMD1.sectionMemory_ramfunc             = ["RAMM0"];
    CMD1.sectionMemory_init_array          = ["RAMM0"];
    CMD1.sectionMemory_switch              = ["RAMM0"];
    CMD1.sectionMemory_sysmem              = ["RAMLS4"];
    CMD1.sectionMemory_stack               = ["RAMLS0"];
    CMD1.sectionMemory_bss                 = ["RAMLS4","RAMLS5"];
    CMD1.sectionMemory_text                = ["RAMGS0","RAMGS1","RAMLS0","RAMLS1","RAMLS2","RAMLS3"];
    CMD1.sectionMemory_data                = ["RAMLS5","RAMLS6","RAMLS7","RAMLS8","RAMLS9"];
    CMD1.sectionMemory_cinit               = ["RAMGS2"];
    CMD1.userSection.create(6);
    CMD1.userSection[0].sectionAlignEnable = true;
    CMD1.userSection[0].sectionMemory      = ["RAMGS3"];
    CMD1.userSection[0].sectionAlign       = 512;
    CMD1.userSection[0].$name              = "RFFTdata1";
    CMD1.userSection[1].sectionMemory      = ["RAMGS3"];
    CMD1.userSection[1].$name              = "RFFTdata2";
    CMD1.userSection[1].sectionAlign       = 512;
    CMD1.userSection[2].sectionMemory      = ["RAMGS3"];
    CMD1.userSection[2].$name              = "RFFTdata3";
    CMD1.userSection[3].sectionMemory      = ["RAMGS3"];
    CMD1.userSection[3].$name              = "FPUfftTables";
    CMD1.userSection[4].$name              = "RFFTdata4";
    CMD1.userSection[4].sectionMemory      = ["RAMGS3"];
    CMD1.userSection[5].$name              = "FPUmathTables";
    CMD1.userSection[5].sectionMemory      = ["RAMGS2"];
    
    CMD2.$name                               = "generic_flash_lnk";
    CMD2.sectionAlignEnable_ramfunc          = true;
    CMD2.sectionAlignEnable_text             = true;
    CMD2.sectionAlignEnable_binit            = true;
    CMD2.sectionAlignEnable_cinit            = true;
    CMD2.sectionAlignEnable_switch           = true;
    CMD2.sectionAlignEnable_init_array       = true;
    CMD2.sectionAlignEnable_const            = true;
    CMD2.sectionAlignEnable_ovly             = true;
    CMD2.sectionMemory_codestart             = "0x080000";
    CMD2.sectionMemory_stack                 = ["RAMM1"];
    CMD2.sectionMemory_bss                   = ["RAMLS5","RAMLS6"];
    CMD2.sectionMemory_data                  = ["RAMLS5"];
    CMD2.sectionMemory_sysmem                = ["RAMLS4"];
    CMD2.sectionMemory_ramfunc               = ["FLASH_BANK0"];
    CMD2.sectionMemory_text                  = ["FLASH_BANK0","FLASH_BANK1"];
    CMD2.sectionMemory_binit                 = ["FLASH_BANK0"];
    CMD2.sectionMemory_cinit                 = ["FLASH_BANK0"];
    CMD2.sectionMemory_switch                = ["FLASH_BANK0"];
    CMD2.sectionMemory_init_array            = ["FLASH_BANK0"];
    CMD2.sectionMemory_const                 = ["FLASH_BANK0"];
    CMD2.sectionMemory_ovly                  = ["FLASH_BANK0"];
    CMD2.sectionRunFromDifferentAddr_ramfunc = true;
    CMD2.sectionRun_ramfunc                  = ["RAMLS0"];
    CMD2.sectionBinit_ramfunc                = false;
    

    我还在项目属性中检查了 GENERAL_FLASH_lnk 是否处于闪存配置中。

    谢谢!

    丹尼尔

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

    Daniel:

    我们将仔细研究一下、几天后回来。

    此致

    西达尔特