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.

TMS320F28377S: 内存溢出

Part Number: TMS320F28377S


我编写的代码用ram的cmd会出现:

的提示,我将代码一些内容删掉后好像就不会出现了,我修改CMD文件的内存分配也没有其他作用下面是cmd的内容:

MEMORY
{
PAGE 0 :
   /* BEGIN is used for the "boot to SARAM" bootloader mode   */

   BEGIN           	: origin = 0x000000, length = 0x000002
   RAMM0           	: origin = 0x000122, length = 0x0002DE//
   //RAMD0           	: origin = 0x00B000, length = 0x000800
   RAMD0           	: origin = 0x008000, length = 0x008000
   /*RAMLS0          	: origin = 0x008000, length = 0x000800
   RAMLS1          	: origin = 0x008800, length = 0x000800
   RAMLS2      		: origin = 0x009000, length = 0x000800
   RAMLS3      		: origin = 0x009800, length = 0x000800
   RAMLS4      		: origin = 0x00A000, length = 0x000800*/
   //RAMLS0          	: origin = 0x00A800, length = 0x000800
   RESET           	: origin = 0x3FFFC0, length = 0x000002

PAGE 1 :

   BOOT_RSVD       : origin = 0x000002, length = 0x000120     /* Part of M0, BOOT rom will use this for stack */
   RAMM1           : origin = 0x000400, length = 0x000400     /* on-chip RAM block M1 */
   RAMD1           : origin = 0x00B800, length = 0x000800

   //RAMLS5      : origin = 0x00A800, length = 0x000800
   RAMLS5      : origin = 0x00B000, length = 0x000800

   RAMGS0      : origin = 0x00C000, length = 0x001000
   RAMGS1      : origin = 0x00D000, length = 0x001000
   RAMGS2      : origin = 0x00E000, length = 0x001000
   RAMGS3      : origin = 0x00F000, length = 0x001000
   RAMGS4      : origin = 0x010000, length = 0x001000
   RAMGS5      : origin = 0x011000, length = 0x001000
   RAMGS6      : origin = 0x012000, length = 0x001000
   RAMGS7      : origin = 0x013000, length = 0x001000
   RAMGS8      : origin = 0x014000, length = 0x001000
   RAMGS9      : origin = 0x015000, length = 0x001000
   RAMGS10     : origin = 0x016000, length = 0x001000
   RAMGS11     : origin = 0x017000, length = 0x001000

   CANA_MSG_RAM     : origin = 0x049000, length = 0x000800
   CANB_MSG_RAM     : origin = 0x04B000, length = 0x000800
}


SECTIONS
{
   codestart        : > BEGIN,     PAGE = 0
   //.text            : >>RAMM0 | RAMD0 |  RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4,   PAGE = 0
   .text            : >>RAMM0 | RAMD0  ,   PAGE = 0
   //.cinit           : > RAMM0 | RAMD0,     PAGE = 0
   .cinit           : > RAMD1,     PAGE = 1
   .pinit           : > RAMM0,     PAGE = 0
   .switch          : > RAMM0,     PAGE = 0
   .reset           : > RESET,     PAGE = 0, TYPE = DSECT /* not used, */

   .stack           : > RAMM1,     PAGE = 1
   .ebss            : > RAMLS5|RAMGS0,    PAGE = 1
   .econst          : > RAMLS5|RAMGS0,    PAGE = 1
   .esysmem         : > RAMLS5,    PAGE = 1

   ramgs0           : > RAMGS0,    PAGE = 1
   ramgs1           : > RAMGS1,    PAGE = 1

#ifdef __TI_COMPILER_VERSION__
   #if __TI_COMPILER_VERSION__ >= 15009000
    .TI.ramfunc : {} > RAMM0,      PAGE = 0
   #else
   ramfuncs         : > RAMM0      PAGE = 0
   #endif
#endif

   /* The following section definitions are for SDFM examples */
   Filter1_RegsFile : > RAMGS1,	PAGE = 1, fill=0x1111
   Filter2_RegsFile : > RAMGS2,	PAGE = 1, fill=0x2222
   Filter3_RegsFile : > RAMGS3,	PAGE = 1, fill=0x3333
   Filter4_RegsFile : > RAMGS4,	PAGE = 1, fill=0x4444
   Difference_RegsFile : >RAMGS5, 	PAGE = 1, fill=0x3333
}

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

如果我用flash的cmd文件就没有这样的情况代码也能正常运行,请问我应该修改什么内容呢

  • 你好,cmd是例程中的cmd吗?有做过任何修改吗?运行TI的例程能否正常运行?

  • 我用了官方例程序报错:

    line 58: error #10099-D: program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. placement with alignment/blocking fails for section ".text" size 0x3476 page 0. Available memory ranges:
    RAMM0 size: 0x2de unused: 0x0 max hole: 0x0
    RAMD0 size: 0x800 unused: 0x0 max hole: 0x0
    RAMLS0 size: 0x800 unused: 0x0 max hole: 0x0
    RAMLS1 size: 0x800 unused: 0x5 max hole: 0x5
    RAMLS2 size: 0x800 unused: 0x2 max hole: 0x2
    RAMLS3 size: 0x800 unused: 0x7 max hole: 0x7
    RAMLS4 size: 0x800 unused: 0x78f max hole: 0x78f
    "2024.1.16moto_RAM/2837xS_Generic_RAM_lnk.cmd", line 59: error #10099-D: program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. placement with alignment/blocking fails for section ".cinit" size 0x561 page 0. Available memory ranges:
    RAMM0 size: 0x2de unused: 0x0 max hole: 0x0
    "2024.1.16moto_RAM/2837xS_Generic_RAM_lnk.cmd", line 66: error #10099-D: program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. placement with alignment/blocking fails for section ".econst" size 0x414 page 1. Available memory ranges:
    RAMLS5 size: 0x800 unused: 0x173 max hole: 0x173
    error #10010: errors encountered during linking; "2024.1.16moto_RAM.out" not built

    >> Compilation failure
    makefile:182: recipe for target '2024.1.16moto_RAM.out' failed
    gmake[1]: *** [2024.1.16moto_RAM.out] Error 1
    makefile:178: recipe for target 'all' failed
    gmake: *** [all] Error 2

    **** Build Finished ****

    cmd如下:

    MEMORY
    {
    PAGE 0 :
       /* BEGIN is used for the "boot to SARAM" bootloader mode   */
    
       BEGIN           	: origin = 0x000000, length = 0x000002
       RAMM0           	: origin = 0x000122, length = 0x0002DE
       RAMD0           	: origin = 0x00B000, length = 0x000800
       RAMLS0          	: origin = 0x008000, length = 0x000800
       RAMLS1          	: origin = 0x008800, length = 0x000800
       RAMLS2      		: origin = 0x009000, length = 0x000800
       RAMLS3      		: origin = 0x009800, length = 0x000800
       RAMLS4      		: origin = 0x00A000, length = 0x000800
       RAMGS14     		: origin = 0x01A000, length = 0x001000
       RAMGS15     		: origin = 0x01B000, length = 0x001000
       RESET           	: origin = 0x3FFFC0, length = 0x000002
    
    PAGE 1 :
    
       BOOT_RSVD       : origin = 0x000002, length = 0x000120     /* Part of M0, BOOT rom will use this for stack */
       RAMM1           : origin = 0x000400, length = 0x000400     /* on-chip RAM block M1 */
       RAMD1           : origin = 0x00B800, length = 0x000800
    
    
       RAMLS5      : origin = 0x00A800, length = 0x000800
    
       RAMGS0      : origin = 0x00C000, length = 0x001000
       RAMGS1      : origin = 0x00D000, length = 0x001000
       RAMGS2      : origin = 0x00E000, length = 0x001000
       RAMGS3      : origin = 0x00F000, length = 0x001000
       RAMGS4      : origin = 0x010000, length = 0x001000
       RAMGS5      : origin = 0x011000, length = 0x001000
       RAMGS6      : origin = 0x012000, length = 0x001000
       RAMGS7      : origin = 0x013000, length = 0x001000
       RAMGS8      : origin = 0x014000, length = 0x001000
       RAMGS9      : origin = 0x015000, length = 0x001000
       RAMGS10     : origin = 0x016000, length = 0x001000
       RAMGS11     : origin = 0x017000, length = 0x001000
       RAMGS12     : origin = 0x018000, length = 0x001000
       RAMGS13     : origin = 0x019000, length = 0x001000
    
    }
    
    
    SECTIONS
    {
       codestart        : > BEGIN,     PAGE = 0
       
    #ifdef __TI_COMPILER_VERSION__
       #if __TI_COMPILER_VERSION__ >= 15009000
        .TI.ramfunc : {} > RAMM0,      PAGE = 0
       #else
       ramfuncs         : > RAMM0      PAGE = 0   
       #endif
    #endif   
    
       .text            : >>RAMM0 | RAMD0 |  RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4,   PAGE = 0
       .cinit           : > RAMM0,     PAGE = 0
       .pinit           : > RAMM0,     PAGE = 0
       .switch          : > RAMM0,     PAGE = 0
       .reset           : > RESET,     PAGE = 0, TYPE = DSECT /* not used, */
    
       .stack           : > RAMM1,     PAGE = 1
       .ebss            : > RAMLS5,    PAGE = 1
       .econst          : > RAMLS5,    PAGE = 1
       .esysmem         : > RAMLS5,    PAGE = 1
    
       ramgs0           : > RAMGS0,    PAGE = 1
       ramgs1           : > RAMGS1,    PAGE = 1
    }
    
    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */
    

    路径为:

    C:\ti\ccs1100\ccs\ccs_base\c2000\include

  • 你的程序太大了,所以需要修改下cmd,可以把报错的段多放几个ram区,参考下下面这个文件:

    TI Linker Command File Primer

  • 您好我修改了CMD之后代码可以正常运行,在ccs里面能看到数据在正常变化,但是我打不了断点一停下来就有这样的提示

    请问这是仿真器问题吗

  • 可能是代码的逻辑错误或断点位置不当