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.

[参考译文] TMS320F28386S:使用库闪存命令进行的操作是非法的。

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1200421/tms320f28386s-illegal-operation-with-library-flash-command

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

在该文件的 CopyData()中:

C:\ti\cc2000\C2000Ware_4_01_00_00\driverlib\f2838x\examples\C28x_dual\flash_kernel\flash_kernel_c28x_dual_ex1_boot_cpu1.c

我的程序在第二次调用时发生了一个非法操作崩溃

oReturnCheck = Fapi_doBlankCheck ((uint32_t *) sectorAddress、
                                                            扇区大小、
                                                            &oFlashStatusWord);

显示调试跟踪

Intterupt_illegalOperationHandler () at interrrupt:158 0x0874A0

这是一个没有源代码的库函数、所以我无法对其进行调试。

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

    您好、John:

    该函数是放置在闪存中还是 RAM 中?

    您能否检查函数的内容在放置函数的存储器中是否完好无损?

    谢谢。此致、

    Vamsi

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

    谢谢 Vamsi 的想法,你是对的。 该函数的 pragma 前导码与链接器文件中的段名不匹配。 我修复了这个问题、现在已经暴露了一个新问题。 错误是:

    "../2838x_flash_lnk_cpu1.cmd"、第67行:错误#10099-D:程序将无法装入可用内存、或该段包含的调用站点需要无法为此段生成的 trampoline。 对齐/阻塞对齐的运行放置在"lfuFuncsCpu1Cpu1"大小为0x914页0的段中失败。  可用存储器范围:
      RAMLS1_5    大小:0x2800      未使用:0x458       最大孔:0x458  

    这意味着有未使用的存储器、所以您认为这是 trampoline 问题吗? 这是我的 cmd 文件。

    MEMORY
    {
    
       BOOT_RSVD        : origin = 0x000002, length = 0x0001AE     /* Part of M0, BOOT rom will use this for stack */
       RAMM0_1          : origin = 0x0001B0, length = 0x000648
       // RAMM1_RSVD       : origin = 0x0007F8, length = 0x000008         /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
       CLA_MSGRAMLOW    : origin = 0x001480, length = 0x000080
       CLA_MSGRAMHIGH   : origin = 0x001500, length = 0x000080
       RAMD0_1          : origin = 0x00C000, length = 0x001000
       RAMLS0           : origin = 0x008000, length = 0x000800
       RAMLS1_5         : origin = 0x008800, length = 0x002800
       RAMLS6           : origin = 0x00B000, length = 0x000800
       RAMLS7           : origin = 0x00B800, length = 0x000800
       RAMGS0_1         : origin = 0x00D000, length = 0x002000
       RAMGS2_4         : origin = 0x00F000, length = 0x003000
       RAMGS5_6         : origin = 0x012000, length = 0x002000
       RAMGS7           : origin = 0x014000, length = 0x001000
       RAMGS8_9         : origin = 0x015000, length = 0x002000
       RAMGS10_15       : origin = 0x017000, length = 0x005FF8
       // RAMGS15_RSVD     : origin = 0x01CFF8, length = 0x000008         /* 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
    GROUP {      /* GROUP memory ranges for crc/checksum of entire flash */
       #endif
    #endif
       /* BEGIN is used for the "boot to Flash" bootloader mode   */
       BEGIN            : origin = 0x080000, length = 0x000002
       /* Flash sectors */
       FLASH0           : origin = 0x080002, length = 0x001FFE  /* on-chip Flash */
       FLASH1           : origin = 0x082000, length = 0x002000  /* on-chip Flash */
       FLASH2_5         : origin = 0x084000, length = 0x014000  /* on-chip Flash */
       FLASH6           : origin = 0x098000, length = 0x008000  /* on-chip Flash */
       FLASH7           : origin = 0x0A0000, length = 0x008000  /* on-chip Flash */
       FLASH8           : origin = 0x0A8000, length = 0x008000  /* on-chip Flash */
       FLASH9           : origin = 0x0B0000, length = 0x008000  /* on-chip Flash */
       FLASH10_11       : origin = 0x0B8000, length = 0x004000  /* on-chip Flash */
       FLASH12_13       : origin = 0x0BC000, length = 0x003FF0  /* on-chip Flash */
       // FLASH13_RSVD     : origin = 0x0BFFF0, 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(_table_name, algorithm=C28_CHECKSUM_16)
      #endif
    #endif
    
       CPUTOCMRAM      : origin = 0x039000, length = 0x000800
       CMTOCPURAM      : origin = 0x038000, length = 0x000800
       CPU1TOCPU2RAM   : origin = 0x03A000, length = 0x000800
       CPU2TOCPU1RAM   : origin = 0x03B000, length = 0x000800
    
       RESET            : origin = 0x3FFFC0, length = 0x000002
    
       EMIF1_CS0n      : origin = 0x80000000, length = 0x01000000
    }
    
    SECTIONS
    {
       codestart           : > BEGIN, ALIGN(4)
       .text               : > FLASH2_5, ALIGN(4)
       .cinit              : > FLASH1, ALIGN(4)
       .switch             : > FLASH1, ALIGN(4)
       .reset              : > RESET, TYPE = DSECT /* not used, */
       .stack              : > RAMM0_1
    
          lfuFuncsCpu1Cpu1 :  LOAD = FLASH6 | FLASH7 | FLASH8
    	                       RUN = RAMLS1_5, //RAMGS10_15,
    		                   LOAD_START(lfuFuncsCpu1Cpu1LoadStart),
    		                   LOAD_SIZE (lfuFuncsCpu1Cpu1LoadSize),
    		                   LOAD_END  (lfuFuncsCpu1Cpu1LoadEnd),
    		                   RUN_START (lfuFuncsCpu1Cpu1RunStart),
    		                   RUN_SIZE  (lfuFuncsCpu1Cpu1RunSize),
    		                   RUN_END   (lfuFuncsCpu1Cpu1RunEnd),
    		                   ALIGN(8)
    
    #if defined(__TI_EABI__)
       .init_array      : > FLASH1, ALIGN(4)
       .bss             : > RAMGS2_4
       .bss:output      : > RAMGS2_4
       .bss:cio         : > RAMGS2_4
       .data            : > RAMGS5_6
       .sysmem          : > RAMGS2_4
       /* Initalized sections go in Flash */
       .const           : > FLASH12_13, ALIGN(4)
    #else
       .pinit           : > FLASH1, ALIGN(4)
       .ebss            : > RAMGS2_4
       .esysmem         : > RAMGS2_4
       .cio             : > RAMGS2_4
       /* Initalized sections go in Flash */
       .econst          : >> FLASH12_13, ALIGN(4)
    #endif
    
       .farbss          : > EMIF1_CS0n
       .farconst        : > EMIF1_CS0n
       .em1_cs0         : > EMIF1_CS0n
    
    /*** CLA Compiler Required Sections ***/
       .scratchpad         : > RAMLS7                /* Scratchpad memory for the CLA C Compiler */
       .const_cla          : > RAMLS7
    
       ramgs0 : > RAMGS0_1, type=NOINIT
       
       MSGRAM_CPU1_TO_CPU2 : > CPU1TOCPU2RAM, type=NOINIT
       MSGRAM_CPU2_TO_CPU1 : > CPU2TOCPU1RAM, type=NOINIT
       MSGRAM_CPU_TO_CM    : > CPUTOCMRAM, type=NOINIT
       MSGRAM_CM_TO_CPU    : > CMTOCPURAM, type=NOINIT
    
       #if defined(__TI_EABI__)
           .TI.ramfunc : {} LOAD = FLASH0,
                            RUN = RAMLS0,
                            LOAD_START(RamfuncsLoadStart),
                            LOAD_SIZE(RamfuncsLoadSize),
                            LOAD_END(RamfuncsLoadEnd),
                            RUN_START(RamfuncsRunStart),
                            RUN_SIZE(RamfuncsRunSize),
                            RUN_END(RamfuncsRunEnd),
                            ALIGN(4)
        #else
           .TI.ramfunc : {} LOAD = FLASH0,
                            RUN = RAMLS0,
                            LOAD_START(_RamfuncsLoadStart),
                            LOAD_SIZE(_RamfuncsLoadSize),
                            LOAD_END(_RamfuncsLoadEnd),
                            RUN_START(_RamfuncsRunStart),
                            RUN_SIZE(_RamfuncsRunSize),
                            RUN_END(_RamfuncsRunEnd),
                            ALIGN(4)
        #endif
    
       DataBufferSection   : > RAMGS7, ALIGN(4)
       LogSection          : > RAMD0_1, ALIGN(4)
       ParamSection        : > RAMGS8_9, ALIGN(4)
       ClaToCpuMsgRAM      : > CLA_MSGRAMLOW              /* Link to CLA Message RAM */
       CpuToClaMsgRAM      : > CLA_MSGRAMHIGH             /* Link to CLA Message RAM */
       ClaData             : > RAMLS6                     /* Link to CLA Data RAM */
       .bss_cla            : > RAMLS6                     /* Link to CLA Data RAM */
    
       /* Link to CLA Program RAM */
       Cla1Prog            : LOAD = FLASH10_11,
                             RUN = RAMLS1_5,
                             LOAD_START(ClaProgLoadStart),
                             RUN_START(ClaProgRunStart),
                             LOAD_SIZE(ClaProgLoadSize) ,
                             ALIGN(4)
    
       /* crc/checksum section configured as COPY section to avoid including in executable */
       .TI.memcrc          : type = COPY
    
    }
    
    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */
    

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

    您好、John:

    以下文章可以提供帮助。  请查看:

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/898282/compiler-tms320f28379d-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 

    谢谢。此致、

    Vamsi

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

    您好、John

    我把它分配给了一位专家来帮助您。  请期待一两天内得到回复。

    谢谢。此致、
    Vamsi

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

    再次大家好、Vamsi、

    我阅读了您参考的文档、并认为我使用的技术与以下这些行:

         lfuFuncsCpu1Cpu1: 负载= Flash6 | FLASH7 | FLASH8、
                             运行= RAMLS1_5、//RAMGS10_15、

    事实证明、我需要将第二行更改为

        运行= RAMGS10_15、

    因为 LS1_5显然不够大。 我的程序不断崩溃、因为我不断查找需要添加链接器 pragma 的新函数。 我完全没想到会在头文件中找到实际的函数定义。 我想、我已经将必要的闪存 API 文件复制到了工程目录中、并已从我的 include 选项中删除闪存 API。 所以这是乏味的,但我认为我是在正确的道路上。 你问这个函数是闪存还是 RAM 中的、然后我就立即知道我忽略了什么。

    我会让这个问题一直没有解决,直到我得到一个干净的运行,但我认为它是解决了。 最令人关注的是尝试设置链接文件、以便可以将库函数加载到闪存中并在 RAM 中运行。 在这种情况下、不能使用应用 pragma 语句的简单窍门。

    再次感谢、

    John