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.

[参考译文] TMS320F280025:C28xx_CPU1:autorun:目标未作为符号"main"未定义

Guru**** 2536840 points
Other Parts Discussed in Thread: C2000WARE

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1241105/tms320f280025-c28xx_cpu1-autorun-target-not-run-as-the-symbol-main-is-not-defined

器件型号:TMS320F280025
主题中讨论的其他器件:C2000WARE

您好!

当我尝试从_c_int00跳转到 main 时 、收到错误"C28xx_cpu1: autorun: target not run 因为符号"main"未定义。"  在控制台中、不仅是 main 函数、还不加载程序中的大部分函数。 但是、当我在没有 _c_int00的情况下运行我的程序时 、我没有遇到这个问题、所有的函数都被正确加载。我已经尝试了 TMS320F28069M:C28xx:autorun 的解决方案: 未定义符号"main"时目标未运行- C2000微控制器论坛- C2000 ︎ 微控制器- TI E2E 支持论坛、 但问题仍然没有解决。 请 告诉我导致此问题的原因。

下面是我的链接器文件

MEMORY
{

   BOOT_RSVD		: origin = 0x00000002, length = 0x00000126
   RAMM0           	: origin = 0x00000128, length = 0x000002D8
   RAMM1            : origin = 0x00000400, length = 0x000003F8     /* on-chip RAM block M1 */
// RAMM1_RSVD       : origin = 0x000007F8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

/* RAMLS4           : origin = 0x0000A000, length = 0x00000800
   RAMLS5           : origin = 0x0000A800, length = 0x00000800
   RAMLS6           : origin = 0x0000B000, length = 0x00000800
   RAMLS7           : origin = 0x0000B800, length = 0x00000800 */

   /* Combining all the LS RAMs */
   RAMLS4567        : origin = 0x0000A000, length = 0x00002000
   RAMGS0           : origin = 0x0000C000, length = 0x000007F8
// RAMGS0_RSVD      : origin = 0x0000C7F8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
   RESET            : origin = 0x003FFFC0, length = 0x00000002


   BOOTROM          : origin = 0x003F0000, length = 0x00008000
   BOOTROM_EXT      : origin = 0x003F8000, length = 0x00007FC0

#ifdef __TI_COMPILER_VERSION__
   #if __TI_COMPILER_VERSION__ >= 20012000
GROUP {      /* GROUP memory ranges for crc/checksum of entire flash */
   #endif
#endif
   BEGIN           	: origin = 0x080000, length = 0x000002
   /* Flash sectors */
   /* BANK 0 */
// FLASHBANK0       : origin = 0x00080000, length = 0x0000FFF0
   FLASH_BANK0_SEC0  : origin = 0x080002, length = 0x000FFE	/* on-chip Flash */
   FLASH_BANK0_SEC1  : origin = 0x081000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC2  : origin = 0x082000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC3  : origin = 0x083000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC4  : origin = 0x084000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC5  : origin = 0x085000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC6  : origin = 0x086000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC7  : origin = 0x087000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC8  : origin = 0x088000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC9  : origin = 0x089000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC10 : origin = 0x08A000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC11 : origin = 0x08B000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC12 : origin = 0x08C000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC13 : origin = 0x08D000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC14 : origin = 0x08E000, length = 0x001000	/* on-chip Flash */
   FLASH_BANK0_SEC15 : origin = 0x08F000, length = 0x000FF0	/* on-chip Flash */
   FLASH_BANK0_SEC15_DO_NOT_USE     : origin = 0x08FFF0, length = 0x000010  /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
#ifdef __TI_COMPILER_VERSION__
  #if __TI_COMPILER_VERSION__ >= 20012000
}  crc(_ccs_flash_checksum, algorithm=C28_CHECKSUM_16)
  #endif
#endif

}


SECTIONS
{


   codestart        : > BEGIN, ALIGN(8)
   .boot            : > FLASH_BANK0_SEC0, ALIGN(8)
   .text            : >> FLASH_BANK0_SEC3 | FLASH_BANK0_SEC4 | FLASH_BANK0_SEC5| FLASH_BANK0_SEC6 | FLASH_BANK0_SEC7,   ALIGN(8)
   .cinit           : > FLASH_BANK0_SEC15,  ALIGN(8)
   .switch          : > FLASH_BANK0_SEC15,  ALIGN(8)
   .reset           : > RESET,                  TYPE = DSECT /* not used, */

   .stack           : > RAMM1

   .init_array      : > FLASH_BANK0_SEC15,  ALIGN(8)
   .bss             : > RAMLS4567
   .bss:output      : > RAMLS4567
   .bss:cio         : > RAMGS0
   .const           : > FLASH_BANK0_SEC15,  ALIGN(8)
   .data            : > RAMLS4567
   .sysmem          : > RAMLS4567

    ramgs0 : > RAMGS0

    /*  Allocate IQ math areas: */
   IQmath           : > RAMLS4567
   IQmathTables     : > RAMLS4567

  .TI.ramfunc      : LOAD = FLASH_BANK0_SEC15,
                  RUN = RAMGS0,
                  LOAD_START(RamfuncsLoadStart),
                  LOAD_SIZE(RamfuncsLoadSize),
                  LOAD_END(RamfuncsLoadEnd),
                  RUN_START(RamfuncsRunStart),
                  RUN_SIZE(RamfuncsRunSize),
                  RUN_END(RamfuncsRunEnd),
                  ALIGN(8)

   /* crc/checksum section configured as COPY section to avoid including in executable */
   .TI.memcrc          : type = COPY

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

此致、

Revathi

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

    您好!

    当我尝试从_c_int00跳转到 main 时 ,收到错误"C28xx_cpu1: autorun: target not run 因为符号"main"未定义。"

    这本身并不是具体的错误。 默认情况下、调试器会在程序加载后尝试自动运行到 main、如果没有找到主函数、则调试器会立即运行上面的消息。

    我的问题是您的程序是否确实有 main。 如果是、您是否在另一主题中提到的模块视图中看到它?

    谢谢

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

    我不小心把我的最后一篇帖子设置为建议的答案。 请拒绝该建议。

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

    Ki、您好!

    我 也无法在模块视图/功能中找到主功能。  而 我的 main.c 文件位于/Modules Views /Files 的列表中。 我 不清楚为什么 加载该文件中很少的函数而缺少的函数很少。 我甚至尝试将路径直接添加到链接器文件。  您能帮助我解决这个问题吗?

    此致、

    Revathi

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

    Ki、您好!

    您能帮助我吗? 感谢您的帮助。

    此致、

    Revathi

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

    我会提请编译器专家注意该主题。

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

    请重新编译整个项目。  一种方法是右键单击项目名称、然后选择 重建项目 。  然后将"Console"(不是"Problems")视图的内容保存到文本文件。  使用名为的图标 复制构建日志 。  当您为日志文件命名时、请确保使用文件扩展名 .txt 。  请 在下一篇文章中附加该文本文件。

    同时提交链接器映射文件。 它的命名类似于 项目名称.map 。  它位于构建配置后命名的目录中、 调试 版本 。  由于论坛仅接受几种不同类型的文件、因此添加文件扩展名 .txt 要形成类似于的文件名 name_of_project.map.txt

    谢谢。此致、

    -乔治

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

    您好、 George、

    以下附件是您请求的文件,请 告诉我,如果我需要任何其他东西. 提前感谢您的帮助

    e2e.ti.com/.../Copy-Build-Log.txte2e.ti.com/.../0844.linker.txte2e.ti.com/.../myproject.map.txt

    此致、

    Revathi

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

    我可以提供一些说明。  我无法告诉您解决问题的最佳方法。

    实际上没有名为 。  因此,CCS 的这一诊断...

    Unknown 说:
    我收到错误"C28xx_cpu1: autorun:没有运行目标,因为符号"main"没有定义。"

    ... 角色。

    入口点符号_c_int00通常在编译器 RTS 库的启动代码中定义。  此处的情况并非如此。  以下是链接器映射文件中的重要行。

    .boot      0    00082000    000000a0     
                      00082000    00000078     main.obj (.boot:_c_int00)
                      00082078    00000019     main.obj (.boot:jump_to_image_location)
                      00082091    0000000f     main.obj (.boot:initFlashSectors)
    

    生成 main.c 文件时会遇到一些问题。

    Building file: "../src/apps/main.c"
    Invoking: C2000 Compiler
    "C:/ti/ccs1210/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/bin/cl2000" -v28 -ml -mt --float_support=fpu32 --idiv_support=idiv0 --tmu_support=tmu0 -Ooff --include_path="C:/Users/Revathi/Desktop/BMS/BMS" --include_path="C:/Users/Revathi/Desktop/BMS/BMS/src/lib/Flash_API/include/FlashAPI" --include_path="C:/Users/Revathi/Desktop/BMS/BMS/src/lib/Flash_API/include/FlashAPI/Constants" --include_path="C:/Users/Revathi/Desktop/BMS/BMS/device/driverlib" --include_path="C:/Users/Revathi/Desktop/BMS/BMS/device" --include_path="C:/Users/Revathi/Desktop/BMS/BMS/src/apps" --include_path="C:/Users/Revathi/Desktop/BMS/BMS/src/include" --include_path="C:/Users/Revathi/Desktop/BMS/BMS/src" --include_path="C:/ti/ccs1210/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/include" --advice:performance=all --define=_FLASH --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency="src/apps/main.d_raw" --obj_directory="src/apps"  "../src/apps/main.c"
    "../src/apps/main.c", line 108: warning #225-D: function "write_Bootinfo" declared implicitly
    "../src/apps/main.c", line 159: warning #225-D: function "initFlashSectors" declared implicitly
    "../src/apps/main.c", line 197: warning #14-D: extra text after expected end of preprocessing directive
    "../src/apps/main.c", line 114: warning #552-D: variable "image_bootinfo2" was set but never used
    "../src/apps/main.c", line 214: warning #161-D: declaration is incompatible with previous "initFlashSectors" (declared at line 159)
    "../src/apps/main.c", line 309: warning #190-D: enumerated type mixed with another type
    "../src/apps/main.c", line 359: warning #225-D: function "read_imageinfo" declared implicitly
    "../src/apps/main.c", line 366: warning #225-D: function "FlashErasebootinfo" declared implicitly
    "../src/apps/main.c", line 367: warning #225-D: function "write_Bootinfo" declared implicitly
    "../src/apps/main.c", line 323: warning #179-D: variable "image_bootinfo1" was declared but never referenced
    "../src/apps/main.c", line 323: warning #179-D: variable "image_bootinfo2" was declared but never referenced
    Finished building: "../src/apps/main.c"

    应研究所有这些警告诊断。  特别是关于 隐式声明的函数"name_here" 。  这意味着调用这些函数时不会显示函数原型。  因此、可能会以不起作用的方式调用该函数或返回其结果。

    这通常不是 CCS 工程的组织方式。  我建议您先从 C2000Ware 中的示例开始、了解其组织方式、并在其上为您的项目建模。

    谢谢。此致、

    -乔治