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:未初始化的数据 RAM 分配问题

Guru**** 2419530 points
Other Parts Discussed in Thread: TMS320F28377S

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1112397/tms320f28377s-uninitialized-data-ram-allocation-problem

器件型号:TMS320F28377S

各位专家、您好!

我正在向我们的客户提出此问题。

客户使用 TMS320f28377S、CCS 版本和编译器版本如下图所示。

客户发现、当分配未初始化的数据时、如果.ebss、.esystem、.cio 和.data 分配的地址包含0x10000之后的地址、则程序无法运行、并且在调试后将显示下图。

例如、在下图中、.ebss、.esSystem,.cio 和.data 被分配到0x10000之前的地址、可以正常调试。

例如、如果下图中的.ebss、.esystem、.cio 和.data 分配给0x10000之后的地址、则会发生上述问题。

由于我没有 F28277S 的 EVM、因此我使用 F28379D 进行测试、无法重现客户的问题。 我注意到 CIO 显示在控制台表的左上角。 这是否是.cio 分配问题? 请帮我分析一下。 我要在下面附上客户的.cmd 文件

// The user must define CLA_C in the project linker settings if using the
// CLA C compiler
// Project Properties -> C2000 Linker -> Advanced Options -> Command File 
// Preprocessing -> --define
#define CLA_C
#ifdef CLA_C
// Define a size for the CLA scratchpad area that will be used
// by the CLA compiler for local symbols and temps
// Also force references to the special symbols that mark the
// scratchpad are. 
CLA_SCRATCHPAD_SIZE = 0x200;
--undef_sym=__cla_scratchpad_end
--undef_sym=__cla_scratchpad_start
#endif //CLA_C

MEMORY
{
PAGE 0 :
   /* BEGIN is used for the "boot to SARAM" bootloader mode   */
   D01SARAM         : origin = 0x00BF00, length = 0x000100
   RAMM0                   : origin = 0x000122, length = 0x0002DE
   Cla1Prog         : origin = 0x008000, length = 0x002000
   RAMGS0_6         : origin = 0x00C000, length = 0x007000
   RESET             : origin = 0x3FFFC0, length = 0x000002

   /* Flash sectors */
   BEGIN             : origin = 0x084002, length = 0x000004
   FLASH_HEAD       : origin = 0x084000, length = 0x000002
   FLASH_HEAD2      : origin = 0x084006, length = 0x000002
   FLASHC_N         : origin = 0x084008, length = 0x037FF8    /* on-chip Flash */
   FLASH_SAFETY_CRC : origin = 0x0BC000, length = 0x000001
   FLASH_SAFETY     : origin = 0x0BC001, length = 0x003FFD
   FLASH_TRAIL      : origin = 0x0BFFFE, 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
   RAMD01           : origin = 0x00B000, length = 0x000F00
   Cla1Share        : origin = 0x00A000, length = 0x000A00     /* for CLA Data RAM */
   Cla1Stack        : origin = 0x00AA00, length = 0x000500            /* for CLA Stack Ram*/
   RAMSafetyCla     : origin = 0x00AF00, length = 0x000100       /* for CLA Stack Ram*/
   RAMGS7_14        : origin = 0x013000, length = 0x008000     /* for Ram Data     */
   CLA1_MSGRAMLOW   : origin = 0x001480, length = 0x000080
   CLA1_MSGRAMHIGH  : origin = 0x001500, length = 0x000080

   RAMSafetyPrt     : origin = 0x01B000, length = 0x000900
         
   RAM_SAFETY_dwregister0           : origin = 0x01B900, length = 0x000002
   RAM_SAFETY_dwregister1           : origin = 0x01B902, length = 0x000002
   RAM_SAFETY_dwregister2           : origin = 0x01B904, length = 0x000002  
   RAM_SAFETY_wregister0            : origin = 0x01B906, length = 0x000001
   RAM_SAFETY_wregister1            : origin = 0x01B907, length = 0x000001    
   RAM_SAFETY_wregistercheckFlag    : origin = 0x01B908, length = 0x000001
   RAMSafety                        : origin = 0x01B909, length = 0x0006F7
   
}

SECTIONS
{
   /* Allocate program areas: */
   .cinit           : > FLASHC_N      PAGE = 0, ALIGN(4)
   .binit           : > FLASHC_N      PAGE = 0, ALIGN(4)
   .pinit           : > FLASHC_N,     PAGE = 0, ALIGN(4)
   .text            : > FLASHC_N      PAGE = 0, ALIGN(4)
   codestart        : > BEGIN         PAGE = 0, ALIGN(4)
   
   /* Initalized sections go in Flash */
   .const           : > FLASHC_N      PAGE = 0, ALIGN(4)
   .econst          : > FLASHC_N      PAGE = 0, ALIGN(4)
   .switch          : > FLASHC_N      PAGE = 0, ALIGN(4)
   .args            : > FLASHC_N      PAGE = 0, ALIGN(4)

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

#ifdef __TI_COMPILER_VERSION__
   #if __TI_COMPILER_VERSION__ >= 15009000
    .TI.ramfunc : {} LOAD = FLASHC_N,
                                     RUN = RAMGS0_6,
                     LOAD_START(_RamfuncsLoadStart),
                     LOAD_SIZE(_RamfuncsLoadSize),
                     LOAD_END(_RamfuncsLoadEnd),
                     RUN_START(_RamfuncsRunStart),
                     RUN_SIZE(_RamfuncsRunSize),
                     RUN_END(_RamfuncsRunEnd),
                                          PAGE = 0, ALIGN(4)
   #else
   ramfuncs        : LOAD = FLASHC_N,
                     RUN = RAMGS0_6,
                     LOAD_START(_RamfuncsLoadStart),
                     LOAD_SIZE(_RamfuncsLoadSize),
                     LOAD_END(_RamfuncsLoadEnd),
                     RUN_START(_RamfuncsRunStart),
                     RUN_SIZE(_RamfuncsRunSize),
                     RUN_END(_RamfuncsRunEnd),
                     PAGE = 0, ALIGN(4)
   #endif
#endif

   ProgramRamFuncs : LOAD = FLASHC_N,               /* Used by InitFlash() in SysCtrl.c */
                     RUN = RAMGS0_6,
                     LOAD_START(_ProgramRamFuncs_loadstart),
                     LOAD_END(_ProgramRamFuncs_loadend),
                     RUN_START(_ProgramRamFuncs_runstart)
                     PAGE = 0, ALIGN(4)
  

   FPUmathTables     : > FLASHC_N                 PAGE = 0
   FlashSafetyCRC    : > FLASH_SAFETY_CRC         PAGE = 0
   FlashSafety       : > FLASH_SAFETY             PAGE = 0  
   FlashHead         : > FLASH_HEAD               PAGE = 0
   FlashHead2        : > FLASH_HEAD2              PAGE = 0
   FlashTrail        : > FLASH_TRAIL              PAGE = 0

   Cla1Prog          : LOAD = FLASHC_N,
                       RUN = Cla1Prog,
                       RUN_START(_Cla1ProgRunStart),
                       LOAD_START(_Cla1ProgLoadStart),
                       LOAD_SIZE(_Cla1ProgLoadSize),
                       PAGE = 0, ALIGN(4)

   CLAData          : > Cla1Share,         PAGE = 1
   RAMSafetyForCla  : > RAMSafetyCla,      PAGE = 1
   Cla1ToCpuMsgRAM  : > CLA1_MSGRAMLOW,    PAGE = 1
   CpuToCla1MsgRAM  : > CLA1_MSGRAMHIGH,   PAGE = 1
   
   
   RAMSafetyForPrt                  : > RAMSafetyPrt,                   PAGE = 1

   RamSafety_dwregister0            : > RAM_SAFETY_dwregister0          PAGE = 1
   RamSafety_dwregister1            : > RAM_SAFETY_dwregister1          PAGE = 1
   RamSafety_dwregister2            : > RAM_SAFETY_dwregister2          PAGE = 1
   RamSafety_wregister0             : > RAM_SAFETY_wregister0           PAGE = 1
   RamSafety_wregister1             : > RAM_SAFETY_wregister1           PAGE = 1
   RamSafety_wregistercheckFlag     : > RAM_SAFETY_wregistercheckFlag   PAGE = 1

   // Must be allocated to memory the CLA has write access to
   CLAscratch       :
                     { *.obj(CLAscratch)
                     . += CLA_SCRATCHPAD_SIZE;
                     *.obj(CLAscratch_end) } >  Cla1Stack,  PAGE = 1

   .scratchpad      : > Cla1Stack,       PAGE = 1
   .bss_cla         : > Cla1Stack,       PAGE = 1
   .reset           : > RESET,           PAGE = 0, TYPE = DSECT /* not used, */
}

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

此致、

Julia

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

    尊敬的 Julia:

    我将此事提交给我们的编译器团队。 他们应该能够在这方面为您提供指导。

    此致、

    Vivek Singh  

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

    Julia、

    我们的编译器专家现已推出。  但是、第一条错误消息指出 CCS 无法设置断点。  我假设它尝试为运行到 main 设置断点的位置在闪存中、并且没有足够的可用硬件断点资源。  您可以尝试通过更改 CCS 中的调试设置来解决该问题。  默认情况下、根据 CCS 的版本、CCS 将在程序末尾设置一个断点、另一个断点用于 CIO。  如果这些段位于闪存中、则会使用可用的硬件断点。  您可以在此处更改这些选项:

    请注意、无论您将数据段放置在何处、我都希望出现该错误。  该消息是否显示在工作场景中?

     

    至于出现 XDC 运行时错误的原因、我无能为力。

    此致、

    John