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.

[参考译文] TMS320F28069:十六进制实用程序:生成用于未配置内存的十六进制文件

Guru**** 2558800 points


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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1087133/tms320f28069-hex-utility-generation-of-hex-files-for-unconfigured-memory

部件号:TMS320F28069

您好,

目前,我们正在达到上述 UC 的内存限制。 为了解决这个问题,一些代码片段存储在外部 EEPROM 中。 对于功能齐全的工作人员和 CLA 部门来说,这相对容易,效果也不错。 对链接器文件等的修改可以在几个小时内完成。 现在是一个具有挑战性的部分:我们有大型二进制结构,目前存储在闪存中,并且一段时间内只使用一次。 这样做的目的是将它们存储在外部内存中,并在需要时将它们固定装入。 其目的是在链接器文件中创建一个虚拟部分,并命令链接器将该结构放置在虚拟部分中。 链接完成后,我想使用 HEX2000实用程序创建上述部分的十六进制文件。 不幸的是,该实用程序告诉我,这将属于未配置的内存,因此将跳过。 是否有任何想法要如何“强制”实用程序只将此部分写入十六进制文件? 但是,链接器本身在链接外部部分方面没有问题,当我尝试加载或处理链接的二进制文件时,问题就会开始。

提前感谢托比亚斯·F

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

    请更详细地描述这一部分...

    [引用 userid="251194" url="~/support/icros/c2000微控制器-group/c2f/c2000微控制器-forume/1087133/tms320f28069-hex-utility-generation hex-file-forum-forum-unconfigured 内存中的十六进制文件]我们目前有一个大的二进制结构,只能在闪存中存储一次,并且一次使用。 这样做的目的是将它们存储在外部内存中,并在需要时将它们固定装入。 其目的是在链接器文件中创建一个虚拟部分,并命令链接器将该结构放置在虚拟部分中。

    请将链接器命令文件附加到下一个帖子。  为了让论坛接受它,请将文件扩展名.txt 添加到它。

    谢谢,此致,

    乔治

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

    /*
    //###########################################################################
    //
    // FILE:    F28069.cmd
    //
    // TITLE:   Linker Command File For F28069 Device
    //
    //###########################################################################
    // $TI Release: F2806x C/C++ Header Files and Peripheral Examples V150 $ 
    // $Release Date: June 16, 2015 $ 
    // $Copyright: Copyright (C) 2011-2015 Texas Instruments Incorporated -
    //             http://www.ti.com/ ALL RIGHTS RESERVED $
    //###########################################################################
    */
    
    /* ======================================================
    // For Code Composer Studio V2.2 and later
    // ---------------------------------------
    // In addition to this memory linker command file,
    // add the header linker command file directly to the project.
    // The header linker command file is required to link the
    // peripheral structures to the proper locations within
    // the memory map.
    //
    // The header linker files are found in <base>\F2806x_headers\cmd
    //
    // For BIOS applications add:      F2806x_Headers_BIOS.cmd
    // For nonBIOS applications add:   F2806x_Headers_nonBIOS.cmd
    ========================================================= */
    
    /* ======================================================
    // For Code Composer Studio prior to V2.2
    // --------------------------------------
    // 1) Use one of the following -l statements to include the
    // header linker command file in the project. The header linker
    // file is required to link the peripheral structures to the proper
    // locations within the memory map                                    */
    
    /* Uncomment this line to include file only for non-BIOS applications */
    /* -l F2806x_Headers_nonBIOS.cmd */
    
    /* Uncomment this line to include file only for BIOS applications */
    /* -l F2806x_Headers_BIOS.cmd */
    
    /* 2) In your project add the path to <base>\F2806x_headers\cmd to the
       library search path under project->build options, linker tab,
       library search path (-i).
    /*========================================================= */
    
    /* Define the memory block start/length for the F2806x
       PAGE 0 will be used to organize program sections
       PAGE 1 will be used to organize data sections
    
       Notes:
             Memory blocks on F28069 are uniform (ie same
             physical memory) in both PAGE 0 and PAGE 1.
             That is the same memory region should not be
             defined for both PAGE 0 and PAGE 1.
             Doing so will result in corruption of program
             and/or data.
    
             Contiguous SARAM memory blocks can be combined
             if required to create a larger memory block.
    */
    
    //Cla1Prog_Start = Cla1funcsRunStart;
    -heap 10
    -stack 944
    
    // 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
    
    MEMORY
    {
    PAGE 0 :   /* Program Memory */
               /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
       OTP         : origin = 0x3D7800, length = 0x0003F6     /* on-chip OTP | keep distance to OTP_KEY and OTP_BMODE */
    
       RAML3       : origin = 0x009000, length = 0x001000	  /* Cla Programm Ram */
       //RAML5	   : origin = 0x00C000, length = 0x002000	  // ramfuncs TODO move ramfuncs to L7 and place taskdata / heap here
       RAML7       : origin = 0x010000, length = 0x002000     	/* on-chip RAM block L7 */
    
    
       FLASHH      : origin = 0x3D8000, length = 0x004000     /* on-chip FLASH*/
       FLASHG      : origin = 0x3DC000, length = 0x004000     /* on-chip FLASH */
       FLASHEF	   : origin = 0x3E0000, length = 0x008000	  /* fusion of flash E and Flash F*/
       FLASHD      : origin = 0x3E8000, length = 0x004000     /* on-chip FLASH */
       FLASHC      : origin = 0x3EC000, length = 0x004000     /* on-chip FLASH */
       FLASHB      : origin = 0x3F0000, length = 0x004000     /* on-chip FLASH */
       FLASHA      : origin = 0x3F4000, length = 0x003F80     /* 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_P0  : origin = 0x3F7FF8, length = 0x000008     /* Part of FLASHA.  CSM password locations in FLASHA */
    
    // LUT in Boot Rom
       FPUTABLES   : origin = 0x3FD860, length = 0x0006A0	  /* FPU Tables in Boot ROM */
       IQTABLES    : origin = 0x3FDF00, length = 0x000B50     /* IQ Math Tables in Boot ROM */
       IQTABLES2   : origin = 0x3FEA50, length = 0x00008C     /* IQ Math Tables in Boot ROM */
       IQTABLES3   : origin = 0x3FEADC, length = 0x0000AA	  /* IQ Math Tables in Boot ROM */
    
       ROM         : origin = 0x3FF3B0, length = 0x000C10     /* Boot ROM */
       RESET       : origin = 0x3FFFC0, length = 0x000002     /* part of boot ROM  */
       VECTORS     : origin = 0x3FFFC2, length = 0x00003E     /* part of boot ROM  */
    
       EXT_MEM	   : origin = 0x000, length = 0x7530          /* eeprom workaround*/
    
    PAGE 1 :   /* Data Memory */
               /* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
               /* Registers remain on PAGE1                                                  */
       BOOT_RSVD   : origin = 0x000000, length = 0x000050     /* Part of M0, BOOT rom will use this for stack */
    
       RAMM0       : origin = 0x000050, length = 0x0003B0     // used as stack
       RAMM1       : origin = 0x000400, length = 0x000400     // used as c stack
    
       RAML0       : origin = 0x008000, length = 0x000800     	// used for rtos task stack
       RAML4       : origin = 0x00A000, length = 0x002000     	// dito and as heap extension
       RAML5	   : origin = 0x00C000, length = 0x002000		// dito
       RAML6       : origin = 0x00E000, length = 0x002000     	// used as heap highest stack pointer range !!!
    
       //RAML7       : origin = 0x010000, length = 0x002000     	/* on-chip RAM block L7 */
       RAML8       : origin = 0x012000, length = 0x002000     	/* on-chip RAM block L8 */
       USB_RAM     : origin = 0x040000, length = 0x000800     	/* USB RAM		  */
    
       CLARAM0     : origin = 0x008800, length = 0x000400 		/* Replaces RAML1 */
       CLARAM1     : origin = 0x008C00, length = 0x000400
    
       CLA1_MSGRAMLOW       : origin = 0x001480, length = 0x000080
       CLA1_MSGRAMHIGH      : origin = 0x001500, length = 0x000080
    }
    
    /* 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              : > FLASHEF | FLASHH,  PAGE = 0, crc_table(FlashCrc)
       .text               : >> FLASHA | FLASHB | FLASHC | FLASHD | FLASHG | FLASHEF, PAGE = 0, crc_table(FlashCrc)
       codestart           : > BEGIN,      PAGE = 0
    
    /*
       .TI.ramfunc           : LOAD = FLASHH,
                             RUN = RAML5,
                             LOAD_START(TiRamfuncsLoadStart),
                             LOAD_END(TiRamfuncsLoadEnd),
                             RUN_START(TiRamfuncsRunStart),
    						 LOAD_SIZE(TiRamfuncsLoadSize),
                             crc_table(RamfuncsCrc)		// also add to Flash Crc Table
    */
    
       .TI.ramfunc		   : > RAML7, RUN_START(TiRamfuncsRunStart), RUN_SIZE(TiRamfuncsLoadSize), PAGE = 0, crc_table(RamfuncsCrc)
    
       csmpasswds          : > CSM_PWL_P0, PAGE = 0
       csm_rsvd            : > CSM_RSVD,   PAGE = 0
    
       /* Allocate uninitalized data sections: */
       .stack              : > RAMM0,      PAGE = 1				// stack
       .ebss               : > RAML8,      PAGE = 1				// generic ram data
       .bss                : >> RAML8 | USB_RAM,PAGE = 1     	// generic ram data
       .esysmem            : > RAML8,      PAGE = 1				// heap
       .sysmem			   : > RAML8,	   PAGE = 1
    
       /* Initalized sections to go in Flash */
       /* For SDFlash to program these, they must be allocated to page 0 */
       .const			   : >> FLASHG | FLASHEF | FLASHH, PAGE = 0, crc_table(FlashCrc)
       .init_array		   : > FLASHEF, PAGE = 0, crc_table(FlashCrc)
       .switch             : > FLASHEF, PAGE = 0, crc_table(FlashCrc)
    
       .data			   : > RAML8, PAGE = 1
    
       /* Allocate IQ math areas: */
       IQmath              : > FLASHA,     PAGE = 0
       IQmathTables        : > IQTABLES,   PAGE = 0, TYPE = NOLOAD
       
       /* Allocate FPU math areas: */
       FPUmathTables       : > FPUTABLES,  PAGE = 0, TYPE = NOLOAD
       
       DMARAML5	           : > RAML6,      PAGE = 1
       DMARAML6	           : > RAML6,      PAGE = 1
       //DMARAML7	           : > RAML7,      PAGE = 1
       DMARAML8	           : > RAML8,      PAGE = 1
    
    	/* Cla Stuff */
       .scratchpad      : > CLARAM0,   PAGE = 1
       .bss_cla         : > CLARAM0,   PAGE = 1
       .const_cla       : > CLARAM0,   PAGE = 1
    
       Cla1ToCpuMsgRAM  : > CLA1_MSGRAMLOW,   PAGE = 1
       CpuToCla1MsgRAM  : > CLA1_MSGRAMHIGH,  PAGE = 1
    /*
       Cla1Prog         : LOAD = FLASHH, PAGE = 0,
                         RUN = RAML3,
                         LOAD_START(Cla1funcsLoadStart),
                         LOAD_END(Cla1funcsLoadEnd),
                         RUN_START(Cla1funcsRunStart),
                         LOAD_SIZE(Cla1funcsLoadSize),
    					 crc_table(ClaCrc)
    */
       Cla1Prog			: > RAML3, PAGE = 0, RUN_START(Cla1ProgRunStart), RUN_SIZE(Cla1ProgRunSize), crc_table(ClaCrc)
    
       Cla1DataRam0		: > CLARAM0,		  PAGE = 1
       Cla1DataRam1		: > CLARAM1,		  PAGE = 1
    /*
       CLA1mathTables	: LOAD = EEPROM, PAGE = 0,
    					  RUN = CLARAM1, PAGE = 1,
                          LOAD_START(Cla1mathTablesLoadStart),
                          LOAD_END(Cla1mathTablesLoadEnd),
                          LOAD_SIZE(Cla1mathTablesLoadSize),
                          RUN_START(Cla1mathTablesRunStart),
                          crc_table(ClaCrc)
    */
    
       CLA1mathTables	: > CLARAM1, PAGE = 1, RUN_START(Cla1mathTablesRunStart), RUN_SIZE(Cla1mathTablesLoadSize), crc_table(ClaCrc)
    
       CLAscratch       :
                         { *.obj(CLAscratch)
                         . += CLA_SCRATCHPAD_SIZE;
                         *.obj(CLAscratch_end) } > CLARAM0,
    					 PAGE = 1
    
    	/* used for rtos heap */
    	rtos_heap		: > RAML6		PAGE = 1
    	//rtos_heap_ext	: > RAML5		PAGE = 0
    	rtos_heap_m1	: > RAMM1		PAGE = 1 (HIGH)
    	rtos_heap_l4 	: > RAML4		PAGE = 1
    
       /* Data Section for Task Stack Memory */
       task_data		: >> RAML0 | RAMM0 | RAML4,		PAGE = 1
       /* Data Section in Flash for Settings etc */
       .cio 			: > RAML8,		PAGE = 1
       .TI.crctab		: > FLASHEF | FLASHH,	PAGE = 0
       .clean 			: > FLASHD,	PAGE = 0
    
       .c28xabi.extab	: > FLASHEF, PAGE = 0 		// crc tables maybe work in the future until then we have to hope for the best
       .c28xabi.exidx   : > FLASHH, PAGE = 0
    
       OTP_ROM			: > FLASHEF, PAGE = 0		// someday this is copied into otp, maybe
    
       /*config and cli elements in external eeprom*/
       .config 			: {*Config*.* (.const)} > FLASHEF, PAGE = 0
       .cli_scmd		: {CliCmdDeflated.obj (.const)} > EXT_MEM, PAGE = 0, RUN_SIZE(CliScmdSize)
    
    /*
       Flash28_API:
       {
           	-l flash_api_f2806x_eabi.lib(.text)
            -l flash_api_f2806x_eabi.lib(.const)
            -l flash_api_f2806x_eabi.lib(.econst)
       }
       	 LOAD = FLASHF,
         RUN = RAML5,
         LOAD_START(Flash28_API_LoadStart),
         LOAD_SIZE(Flash28_API_LoadSize),
         LOAD_END(Flash28_API_LoadEnd),
         RUN_START(Flash28_API_RunStart),
         PAGE = 0,
         crc_table(FlashCrc)
    */
    
      /* 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.
    //===========================================================================
    */
    
    

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

    目前,.CLI_SCMD 部分很有趣,可以看到,该部分链接到从0开始的外部内存。 通常这不是问题,除非有时空指针仍然有效,但这在这里不是问题

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

    我怀疑.CLI_SCMD 输出部分不能按您的意愿工作。  让我们来看看它是如何被指定的...

       .cli_scmd		: {CliCmdDeflated.obj (.const)} > EXT_MEM, PAGE = 0, RUN_SIZE(CliScmdSize)
    

    这表明要创建名为.CLI_SCMD 的输出部分。  它由一个输入部分组成,即来自 CliCmdDeflated.obj 的.const 部分。  它分配给内存范围 EXT_MEM 中的地址。   

    因此,整个程序假定此输出部分始终位于 EXT_MEM 中的该地址。  是这样吗?  如果是,为什么创建了符号 CliScmdSize?  它的用途是什么?

    谢谢,此致,

    乔治

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

    你好,乔治,

    到目前为止,您的假设是正确的,因为外部存储器只读任何外部引用都是在运行时通过自定义处理程序加载的。 截面的大小用于标识生成的 blob 中该特定截面的起始位置。 目前,外部 EEPROM 中有多个部分,因此我必须计算它们的起始地址(使用 ext_mem)和大小。 函数和 CLA prog 以及数学表遵循相同的方案。
    该问题位于 HEX 实用程序中,如果我只想为上述的.CLI_SCMD 部分创建十六进制文件,该实用程序将返回错误。

    提前感谢托比亚斯·法辛鲍尔

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [引用 userid="251194" url="~ë/support/intrans/c2000微控制器组/CC2000 /f/c2000微控制器-forume/1087133/tms320f28069-hex-utility-generation hex-file-forum/4027457#4027457"]我只想为该部分创建一个文件[quote_clim]]

    要将十六进制实用程序的输出限制为仅一个部分,请创建包含 sections 指令的十六进制命令文件。  有关详细信息, 请在 C28x 汇编工具手册中搜索 标题 为 Hex Conversion Utility Description (十六进制转换实用程序说明)的章节。  在此处,单击标题为 “Sections Directive (指令部分)”的子章节。

    谢谢,此致,

    乔治

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

    到目前为止,我已经解决了这个问题,单靠章节指令是不够的,我还必须使用 ROM 指令。 我可以在这里指定外部内存,现在它就像一个魅力。

    感谢您抽出时间参加 Tobias Faschingbaauer 的会议