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配置

编译环境:CCS6.1

错误提示如下:

line 72: error #10099-D: program will not fit into available memory. placement with alignment/blocking fails for section ".econst" size 0x2096 page 0. Available memory ranges:
FLASHA size: 0xff80 unused: 0x1b12 max hole: 0x1b11

求解,谢谢!

F28035.cmd配置如下

MEMORY
{
PAGE 0: /* Program Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
RAMPRG : origin = 0x008000, length = 0x000080 /* on-chip RAM block L0, for RamFuncs */
OTP : origin = 0x3D7800, length = 0x000400 /* on-chip OTP */
FLASHA : origin = 0x3E8000, length = 0x00FF80 /* on-chip FLASH */
CSM_RSVD : origin = 0x3F7F80, length = 0x000076 /* Part of FLASHA. Program with all 0x0000 when CSM is in use. */
BEGIN : origin = 0x3F7FF6, length = 0x000002 /* Part of FLASHA. Used for "boot to Flash" bootloader mode. */
CSM_PWL : origin = 0x3F7FF8, length = 0x000008 /* Part of FLASHA. CSM password locations in FLASHA */

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 */

ROM : origin = 0x3FF27C, length = 0x000D44 /* Boot ROM */
RESET : origin = 0x3FFFC0, length = 0x000002 /* part of boot ROM */
VECTORS : origin = 0x3FFFC2, length = 0x00003E /* part of boot ROM */

PAGE 1 : /* Data Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
/* Registers remain on PAGE1 */

RAMM0 : origin = 0x000100, length = 0x000300 /* on-chip RAM block M0 */
RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */
RAML0 : origin = 0x008080, length = 0x001f80 /* on-chip RAM block L0 */
/* RAML1 : origin = 0x009000, length = 0x001000*/ /* on-chip RAM block L1 */
/* RAMH0 : origin = 0x00A000, length = 0x002000 */ /* on-chip RAM block H0 */
}

/* Allocate sections to memory blocks.
Note:
codestart user defined section in DSP28_CodeStartBranch.asm used to redirect code
execution when booting to flash
ramfuncs user defined section to store functions that will be copied from Flash into RAM
*/

SECTIONS
{

/* Allocate program areas: */
.cinit : > FLASHA PAGE = 0
.pinit : > FLASHA, PAGE = 0
.text : > FLASHA PAGE = 0
.binit : > FLASHA, PAGE = 0
.ovly : > FLASHA, PAGE = 0
codestart : > BEGIN PAGE = 0
ramfuncs : LOAD = FLASHA,
RUN = RAMPRG,
PAGE = 0,
table(_prginRAM)

otp_prg : > OTP PAGE = 0
csmpasswds : > CSM_PWL PAGE = 0
csm_rsvd : > CSM_RSVD PAGE = 0

/* Allocate uninitalized data sections: */
.stack : > RAMM1 PAGE = 1
.ebss : > RAML0 PAGE = 1
.esysmem : > RAML0 PAGE = 1
debug_buffer : > RAML0 PAGE = 1

/* Initalized sections go in Flash */
/* For SDFlash to program these, they must be allocated to page 0 */
.econst : > FLASHA PAGE = 0         //报错
.switch : > FLASHA PAGE = 0

/* Allocate IQ math areas: */
IQmath : > FLASHA 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)

}
*/

/* .reset is a standard section used by the compiler. It contains the */
/* the address of the start of _c_int00 for C Code. /*
/* When using the boot ROM this section and the CPU vector */
/* table is not needed. Thus the default type is set here to */
/* DSECT */
.reset : > RESET, PAGE = 0, TYPE = DSECT
vectors : > VECTORS PAGE = 0, TYPE = DSECT
}

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

  • 应该是 FLASHA 剩余空间不够(0x00001b08 ),怎么解决?

    MAP文件部分如下:
    ******************************************************************************
    TMS320C2000 Linker PC v6.4.2
    ******************************************************************************
    >> Linked Mon Dec 07 19:51:47 2020

    OUTPUT FILE NAME: <E:/code/MD380_75_1/MD380/MD380_28034/../../MD380/Debug/MD380-2803X-DSP.out>
    ENTRY POINT SYMBOL: "code_start" address: 003f7ff6


    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    PAGE 0:
    RAMPRG 00008000 00000080 0000001d 00000063 RWIX
    OTP 003d7800 00000400 00000000 00000400 RWIX
    FLASHA 003e8000 0000ff80 0000e478 00001b08 RWIX
    CSM_RSVD 003f7f80 00000076 00000076 00000000 RWIX
    BEGIN 003f7ff6 00000002 00000002 00000000 RWIX
    CSM_PWL 003f7ff8 00000008 00000008 00000000 RWIX
    IQTABLES 003fe000 00000b50 00000000 00000b50 RWIX
    IQTABLES2 003feb50 0000008c 00000000 0000008c RWIX
    IQTABLES3 003febdc 000000aa 00000000 000000aa RWIX
    ROM 003ff27c 00000d44 00000000 00000d44 RWIX
    RESET 003fffc0 00000002 00000000 00000002 RWIX
    VECTORS 003fffc2 0000003e 00000000 0000003e RWIX

    PAGE 1:
    RAMM0 00000100 00000300 00000000 00000300 RWIX
    RAMM1 00000400 00000400 00000400 00000000 RWIX
    DEV_EMU 00000880 00000105 00000004 00000101 RWIX
    SYS_PWR_CTL 00000985 00000003 00000003 00000000 RWIX
    FLASH_REGS 00000a80 00000060 00000008 00000058 RWIX
    CSM 00000ae0 00000010 00000010 00000000 RWIX
    ADC_RESULT 00000b00 00000020 00000020 00000000 RWIX
    CPU_TIMER0 00000c00 00000008 00000008 00000000 RWIX
    CPU_TIMER1 00000c08 00000008 00000008 00000000 RWIX
    CPU_TIMER2 00000c10 00000008 00000008 00000000 RWIX
    PIE_CTRL 00000ce0 00000020 0000001a 00000006 RWIX
    PIE_VECT 00000d00 00000100 00000100 00000000 RWIX
    CLA1 00001400 00000080 00000040 00000040 RWIX
    ECANA 00006000 00000040 00000034 0000000c RWIX
    ECANA_LAM 00006040 00000040 00000040 00000000 RWIX
    ECANA_MOTS 00006080 00000040 00000040 00000000 RWIX
    ECANA_MOTO 000060c0 00000040 00000040 00000000 RWIX
    ECANA_MBOX 00006100 00000100 00000100 00000000 RWIX
    COMP1 00006400 00000020 00000011 0000000f RWIX
    COMP2 00006420 00000020 00000011 0000000f RWIX
    COMP3 00006440 00000020 00000011 0000000f RWIX
    EPWM1 00006800 00000040 0000003a 00000006 RWIX
    EPWM2 00006840 00000040 0000003a 00000006 RWIX
    EPWM3 00006880 00000040 0000003a 00000006 RWIX
    EPWM4 000068c0 00000040 0000003a 00000006 RWIX
    EPWM5 00006900 00000040 0000003a 00000006 RWIX
    EPWM6 00006940 00000040 0000003a 00000006 RWIX
    EPWM7 00006980 00000040 0000003a 00000006 RWIX
    ECAP1 00006a00 00000020 00000020 00000000 RWIX
    EQEP1 00006b00 00000040 00000040 00000000 RWIX
    LINA 00006c00 00000080 0000004a 00000036 RWIX
    GPIOCTRL 00006f80 00000040 00000040 00000000 RWIX
    GPIODAT 00006fc0 00000020 00000020 00000000 RWIX
    GPIOINT 00006fe0 00000020 0000000c 00000014 RWIX
    SYSTEM 00007010 00000020 00000020 00000000 RWIX
    SPIA 00007040 00000010 00000010 00000000 RWIX
    SCIA 00007050 00000010 00000010 00000000 RWIX
    NMIINTRUPT 00007060 00000010 00000010 00000000 RWIX
    XINTRUPT 00007070 00000010 00000010 00000000 RWIX
    ADC 00007100 00000080 00000050 00000030 RWIX
    SPIB 00007740 00000010 00000010 00000000 RWIX
    I2CA 00007900 00000040 00000022 0000001e RWIX
    RAML0 00008080 00001f80 000019cd 000005b3 RWIX
    PARTID 003d7e80 00000001 00000001 00000000 RWIX
    CSM_PWL 003f7ff8 00000008 00000008 00000000 RWIX


    SECTION ALLOCATION MAP

    output attributes/
    section page origin length input sections
    -------- ---- ---------- ---------- ----------------
    .text 0 003e8000 0000e1d5
    003e8000 000012bd f_menu.obj (.text)
    003e92bd 00000fd7 f_io.obj (.text)
    003ea294 00000ddc MotorVF.obj (.text)
    003eb070 00000b88 f_runSrc.obj (.text)
    003ebbf8 00000977 f_comm.obj (.text)
    003ec56f 000008ea f_frqSrc.obj (.text)
    003ece59 00000856 MotorVCMain.obj (.text)
    003ed6af 00000850 MotorImParEst.obj (.text)
    003edeff 0000083f MotorImParStaticEst.obj (.text)
    003ee73e 000006fa MotorInvProtect.obj (.text)
    003eee38 000006e0 f_canlink.obj (.text)
    003ef518 000006d5 MotorMain.obj (.text)
    003efbed 000005aa f_frqSrc_pid.obj (.text)
    003f0197 0000052c f_interface.obj (.text)
    003f06c3 000004c3 MotorParChange.obj (.text)
    003f0b86 000004ab f_eeprom.obj (.text)
    003f1031 00000496 f_error.obj (.text)
    003f14c7 00000496 f_osc.obj (.text)
    003f195d 0000044b MotorCarrier.obj (.text)
    003f1da8 0000042c f_runSrc_accDecFrq.obj (.text)
    003f21d4 0000040a f_main.obj (.text)
    003f25de 000003f1 MotorDataExchange.obj (.text)
    003f29cf 000003d9 MotorPublicCal.obj (.text)
    003f2da8 000003cb MotorSVC2.obj (.text)
    003f3173 000003c5 f_ui.obj (.text)
    003f3538 0000039b MotorSVC.obj (.text)
    003f38d3 0000036d MotorEncoder.obj (.text)
    003f3c40 00000346 f_modbus.obj (.text)
    003f3f86 0000032f f_invPara.obj (.text)
    003f42b5 00000300 MotorPWM.obj (.text)
    003f45b5 000002d5 f_fcDeal.obj (.text)
    003f488a 0000028c MotorSpeedCheck.obj (.text)
    003f4b16 0000024b f_dspcan.obj (.text)
    003f4d61 0000022f SubPrg.obj (.text)
    003f4f90 00000211 f_p2p.obj (.text)
    003f51a1 000001af f_plc.obj (.text)
    003f5350 00000172 f_torqueCtrl.obj (.text)
    003f54c2 00000153 mainInit_2803x.obj (.text)
    003f5615 00000120 MotorCurrentTransform.obj (.text)
    003f5735 0000010b MotorParEst.obj (.text)
    003f5840 00000107 rts2800_ml.lib : ll_div.obj (.text)
    003f5947 000000f9 MotorInfoCollect.obj (.text)
    003f5a40 000000ef f_CANlinkEx.obj (.text)
    003f5b2f 000000c5 f_vf.obj (.text)
    003f5bf4 00000091 ASMSubPrg.obj (.text)
    003f5c85 0000008c main.obj (.text:retain)
    003f5d11 0000008b MotorImParEst.obj (.text:retain)
    003f5d9c 0000008a f_osc.obj (.text:retain)
    003f5e26 00000074 f_dspcan.obj (.text:retain)
    003f5e9a 0000006c f_motorFc.obj (.text)
    003f5f06 00000061 main.obj (.text)
    003f5f67 0000005a rts2800_ml.lib : fs_mpy.obj (.text)
    003f5fc1 00000044 DSP2803x_CpuTimers.obj (.text)
    003f6005 00000044 rts2800_ml.lib : boot.obj (.text)
    003f6049 00000043 f_common.obj (.text)
    003f608c 0000002e f_comm.obj (.text:retain)
    003f60ba 0000002a rts2800_ml.lib : l_div.obj (.text)
    003f60e4 00000029 : fs_tol.obj (.text)
    003f610d 00000026 DSP2803x_CodeStartBranch.obj (.text)
    003f6133 00000022 rts2800_ml.lib : i_div.obj (.text)
    003f6155 0000001e : ll_cmp.obj (.text)
    003f6173 00000019 : args_main.obj (.text)
    003f618c 00000019 : exit.obj (.text)
    003f61a5 00000014 : ll_mpy.obj (.text)
    003f61b9 0000000b : u_div.obj (.text)
    003f61c4 00000009 : _lock.obj (.text)
    003f61cd 00000008 mainInit_2803x.obj (.text:retain)

    ramfuncs 0 003f61d6 0000001d RUN ADDR = 00008000
    003f61d6 00000019 mainInit_2803x.obj (ramfuncs)
    003f61ef 00000004 DSP2803x_usDelay.obj (ramfuncs)

    .cinit 0 003f61f3 0000027c
    003f61f3 00000051 MotorPWM.obj (.cinit)
    003f6244 00000049 f_runSrc_accDecFrq.obj (.cinit)
    003f628d 00000035 f_osc.obj (.cinit)
    003f62c2 00000032 f_io.obj (.cinit)
    003f62f4 00000020 f_frqSrc_pid.obj (.cinit)
    003f6314 0000001c f_plc.obj (.cinit)
    003f6330 0000001a f_interface.obj (.cinit)
    003f634a 00000019 MotorSVC.obj (.cinit)
    003f6363 00000019 f_ui.obj (.cinit)
    003f637c 00000017 f_CANlinkEx.obj (.cinit)
    003f6393 00000014 f_modbus.obj (.cinit)
    003f63a7 00000013 f_canlink.obj (.cinit)
    003f63ba 00000011 MotorInvProtect.obj (.cinit)
    003f63cb 00000010 MotorDataExchange.obj (.cinit)
    003f63db 00000010 f_main.obj (.cinit)
    003f63eb 0000000f f_invPara.obj (.cinit)
    003f63fa 0000000c f_dspcan.obj (.cinit)
    003f6406 0000000c f_runSrc.obj (.cinit)
    003f6412 0000000a rts2800_ml.lib : exit.obj (.cinit)
    003f641c 00000008 MotorVCMain.obj (.cinit)
    003f6424 00000008 f_comm.obj (.cinit)
    003f642c 00000008 f_eeprom.obj (.cinit)
    003f6434 00000008 f_error.obj (.cinit)
    003f643c 00000005 rts2800_ml.lib : _lock.obj (.cinit:__lock)
    003f6441 00000005 : _lock.obj (.cinit:__unlock)
    003f6446 00000005 f_menu.obj (.cinit)
    003f644b 00000005 f_torqueCtrl.obj (.cinit)
    003f6450 00000005 f_vf.obj (.cinit)
    003f6455 00000004 MotorDebug.obj (.cinit)
    003f6459 00000004 MotorEncoder.obj (.cinit)
    003f645d 00000004 MotorMain.obj (.cinit)
    003f6461 00000004 f_fcDeal.obj (.cinit)
    003f6465 00000004 f_frqSrc.obj (.cinit)
    003f6469 00000004 f_p2p.obj (.cinit)
    003f646d 00000002 --HOLE-- [fill = 0]

    .pinit 0 003e8000 00000000 UNINITIALIZED

    .econst 0 00000000 00002098 FAILED TO ALLOCATE
    .ovly 0 003f6470 0000000a
    003f6470 0000000a (.ovly:_prginRAM)

    csm_rsvd 0 003f7f80 00000076
    003f7f80 00000076 DSP2803x_CSMPasswords.obj (csm_rsvd)
  • 钱包里的钱不够怎么办? 去挣更多的钱(换一颗flash更大的芯片)或是尽量少用钱(删除不需要的代码,代码优化),还能怎么办?

  • 谢谢 的回复。

    @shaowen li 若是空间实在不够的话,请考虑换一颗芯片

    另外建议点击右下角“使用高级编辑器编辑文本”来发送您的文件。