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.

[参考译文] TM4C1294NCPDT:TM4C1294NCPDT

Guru**** 2465890 points
Other Parts Discussed in Thread: TM4C1294NCPDT

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1471966/tm4c1294ncpdt-tm4c1294ncpdt

器件型号:TM4C1294NCPDT

工具与软件:

我需要将 hex 文件加载到 RAM 中进行固件升级和从 RAM 引导,您能帮助我在链接器文件中进行更改吗
对于引导加载程序的 VTABLE 部分、并为固件升级十六进制文件写入 hex 文件并从中进行引导使用 RAM  

当我尝试在分配用于执行的存储器区域之外的空间中写入 RAM 段时、它仅写入"0"零。

您能否建议如何为 应用 VTABLE 部分对 RAM 进行分区以及 通过以太网写入固件升级十六进制文件。

您还可以查看链接器文件以了解要进行的任何更改吗

/******************************************************************************
 * Copyright (c) 2013-2017 Texas Instruments Incorporated.  All rights reserved.
 * Software License Agreement
 * 
 * Texas Instruments (TI) is supplying this software for use solely and
 * exclusively on TI's microcontroller products. The software is owned by
 * TI and/or its suppliers, and is protected under applicable copyright
 * laws. You may not combine this software with "viral" open-source
 * software in order to form a larger program.
 * 
 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
 * NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
 * NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
 * CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
 * DAMAGES, FOR ANY REASON WHATSOEVER.
 * 
 *
 *****************************************************************************/

--retain=g_pfnVectors

/* The following command line options are set as part of the CCS project.    */
/* If you are building using the command line, or for some reason want to    */
/* define them here, you can uncomment and modify these lines as needed.     */
/* If you are using CCS for building, it is probably better to make any such */
/* modifications in your CCS project and leave this file alone.              */
/*                                                                           */
/* --heap_size=0                                                             */
/* --stack_size=256                                                          */
/* --library=rtsv7M3_T_le_eabi.lib                                           */

/* The starting address of the application.  Normally the interrupt vectors  */
/* must be located at the beginning of the application.                      */
#define APP_BASE	0x00000000
#define RAM_BASE	0x20000000
#define RAM_BASE_DATA	0x20007000
#define EX_RAM_BASE	0x60000000
#define APP_LENGTH	0x00016000

/* System memory map */

MEMORY
{
   /* Application stored in and executes from internal flash */
    FLASH (RX) : origin = APP_BASE, length = APP_LENGTH
    /* Application uses internal RAM for data */
    SRAM (RWX) : origin = RAM_BASE, length = 0x00060000



    EXSRAM (RWX) : origin = EX_RAM_BASE, length = 0x00040000
}

/* Section allocation in memory */

SECTIONS
{
    .intvecs:   > APP_BASE
    .text   :   > FLASH
    .const  :   > FLASH
    .cinit  :   > FLASH
    .pinit  :   > FLASH
    .init_array : > FLASH

    .vtable :   > RAM_BASE
    .data   :   > SRAM
    .bss    :   > SRAM
    .sysmem :   > SRAM
    .stack  :   > SRAM



    .vtable :   > EX_RAM_BASE
    .data   :   > EXSRAM
    .bss    :   > EXSRAM
    .sysmem :   > EXSRAM
    .stack  :   > EXSRAM


#ifdef  __TI_COMPILER_VERSION__
#if     __TI_COMPILER_VERSION__ >= 15009000
    .TI.ramfunc : {} load=FLASH, run=SRAM, table(BINIT)
    .TI.ramfunc : {} load=FLASH, run=EXSRAM, table(BINIT)
#endif
#endif
}

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

    您好!

     您是否有机会在以下网址参考此 TI 参考设计?

    TIDM-TM4CFLASHSRAM -并发并行 XIP 闪存和 SRAM 设计、用于在高性能 MCU 上下载和执行代码。 您可以在 /cfs-file/__key/communityserver-discussions-components-files/908/tidcaj1.zip 上找到此 TI 设计的配套软件

    上述参考设计软件示例 使用 TM4C1294NCPDT 的内部闪存来保留自定义引导加载程序、并将 RW 存储器映射到外部 SRAM。 引导加载程序将配置 EPI 模块、以启用16位并行闪存和 SRAM、从而下载和执行代码

    [报价 userid="524025" url="~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1471966/tm4c1294ncpdt-tm4c1294ncpdt "]

    当我尝试在分配用于执行的存储器区域之外的空间中写入 RAM 段时、它仅写入"0"零。

    [报价]

    我不明白您的问题。 您的内部 SRAM 部分的长度只有0x00060000。 为什么要尝试写入超过0x60000的内容?  

    如果要写入位于0x60000000的外部 SRAM、则需要确保 EPI 模块已初始化、然后才能写入。  

    请 看一下我在上面指出的参考设计示例。

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

    您能否也解释一下要在.cmd 文件中进行哪些更改来添加 外部 SDRAM 部分存储器

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

    /******************************************************************************
    
     * Copyright (c) 2013-2017 Texas Instruments Incorporated.  All rights reserved.
     * Software License Agreement
     * 
     * Texas Instruments (TI) is supplying this software for use solely and
     * exclusively on TI's microcontroller products. The software is owned by
     * TI and/or its suppliers, and is protected under applicable copyright
     * laws. You may not combine this software with "viral" open-source
     * software in order to form a larger program.
     * 
     * THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
     * NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
     * NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     * A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
     * CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
     * DAMAGES, FOR ANY REASON WHATSOEVER.
     * 
     *
     *****************************************************************************/
    
    --retain=g_pfnVectors
    
    /* The following command line options are set as part of the CCS project.    */
    /* If you are building using the command line, or for some reason want to    */
    /* define them here, you can uncomment and modify these lines as needed.     */
    /* If you are using CCS for building, it is probably better to make any such */
    /* modifications in your CCS project and leave this file alone.              */
    /*                                                                           */
    /* --heap_size=0                                                             */
    /* --stack_size=256                                                          */
    /* --library=rtsv7M3_T_le_eabi.lib                                           */
    
    /* The starting address of the application.  Normally the interrupt vectors  */
    /* must be located at the beginning of the application.                      */
    #define APP_BASE	0x00000000
    #define RAM_BASE	0x20000000
    #define SD_RAM_BASE	0x60000000
    #define APP_LENGTH	0x00016000
    
    /* System memory map */
    
    MEMORY
    {
       /* Application stored in and executes from internal flash */
        FLASH (RX) : origin = APP_BASE, length = APP_LENGTH
        /* Application uses internal RAM for data */
        SRAM (RWX) : origin = RAM_BASE, length = 0x00060000
    
        SDRAM (RWX) : origin = SD_RAM_BASE, length = 0x00040000
    
    }
    
    /* Section allocation in memory */
    
    SECTIONS
    {
        .intvecs:   > APP_BASE
        .text   :   > FLASH
        .const  :   > FLASH
        .cinit  :   > FLASH
        .pinit  :   > FLASH
        .init_array : > FLASH
    
        .vtable :   > RAM_BASE
        .data   :   > SRAM
        .bss    :   > SRAM
        .sysmem :   > SRAM
        .stack  :   > SRAM
    
        .vtable :   > SD_RAM_BASE
        .data   :   > SDRAM
        .bss    :   > SDRAM
        .sysmem :   > SDRAM
        .stack  :   > SDRAM
    
    
    #ifdef  __TI_COMPILER_VERSION__
    #if     __TI_COMPILER_VERSION__ >= 15009000
        .TI.ramfunc : {} load=FLASH, run=SRAM, table(BINIT)
    #endif
    #endif
    }

    链接器文件更改是否正确、请查看  

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

    要不是要在外部 RAM 中运行代码、还是只读取数据? 您可以看到下面一行。 这意味着您需要在内部 SRAM 之外运行代码。 如果您没有使用外部 SRAM 运行代码、那么为什么需要将矢量表重新映射到 SD_RAM_BASE。 无论您要使用内部 RAM 还是外部 RAM 来运行代码、都必须先初始化 EPI 模块、然后将代码从闪存复制到内部 RAM 或外部 RAM 中执行。

    .TI.ramfunc:{}load=flash、run=sram、table (BINIT)

    我强烈建议您看一看 TIDM-TM4CFLASHSRAM 及其软件同事。 根据此示例、程序映像(ektm4c129_epiflash_boot_demo)由引导加载程序(ektm4c129_epiflash_bootloader)通过 EPI 接口复制到外部闪存。 程序映像仅具有以下链接器文件。 将程序映像复制到外部闪存后、引导加载程序将跳转到0x60020000处的应用。 SRAM 部分映射到位于0xA0000000的外部 SRAM。   

    #define APP_BASE 0x60020000
    #define RAM_BASE 0xA0000000

    /* System memory map */

    MEMORY
    {
    /* Application stored in and executes from internal flash */
    FLASH (RX) : origin = APP_BASE, length = 0x00400000
    /* Application uses internal RAM for data */
    SRAM (RWX) : origin = 0xA0000000, length = 0x00040000
    }

    /* Section allocation in memory */

    SECTIONS
    {
    .intvecs: > APP_BASE
    .text : > FLASH
    .const : > FLASH
    .cinit : > FLASH
    .pinit : > FLASH
    .init_array : > FLASH

    .vtable : > RAM_BASE
    .data : > SRAM
    .bss : > SRAM
    .sysmem : > SRAM
    .stack : > SRAM
    }

    __STACK_TOP = __stack + 256;

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

    您好、Charles

    我们会将代码复制到外部  RAM、并需要从外部 RAM 运行代码  

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

    随后、 TIDM-TM4CFLASHSRAM 将是一个很好的参考起点。 如前所述、此示例包含名为 ektm4c129_epiflash_bootloader (见下文)的自定义引导加载程序、它会通过 EPI 接口将名为 ektm4c129_epiflash_boot_demo 的示例应用程序复制到外部闪存中。 将代码复制到外部闪存和 RAM 后、引导加载程序将跳转至外部闪存以开始执行。

      

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

    我没有任何用于 TM4C1294 EVK 的外部 SRAM ,但我只有与 TM4C1294NCPDT 连接的定制 SDRAM

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

    要在此.cmd 文件中进行的任何更改、请查看它  

    /******************************************************************************
     *
     *
     * Copyright (c) 2013-2017 Texas Instruments Incorporated.  All rights reserved.
     * Software License Agreement
     * 
     * Texas Instruments (TI) is supplying this software for use solely and
     * exclusively on TI's microcontroller products. The software is owned by
     * TI and/or its suppliers, and is protected under applicable copyright
     * laws. You may not combine this software with "viral" open-source
     * software in order to form a larger program.
     * 
     * THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
     * NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
     * NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     * A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
     * CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
     * DAMAGES, FOR ANY REASON WHATSOEVER.
     * 
     *
     *****************************************************************************/
    
    --retain=g_pfnVectors
    
    /* The following command line options are set as part of the CCS project.    */
    /* If you are building using the command line, or for some reason want to    */
    /* define them here, you can uncomment and modify these lines as needed.     */
    /* If you are using CCS for building, it is probably better to make any such */
    /* modifications in your CCS project and leave this file alone.              */
    /*                                                                           */
    /* --heap_size=0                                                             */
    /* --stack_size=256                                                          */
    /* --library=rtsv7M3_T_le_eabi.lib                                           */
    
    /* The starting address of the application.  Normally the interrupt vectors  */
    /* must be located at the beginning of the application.                      */
    #define APP_BASE	0x00000000
    #define RAM_BASE	0x20000000
    #define APP_LENGTH	0x00016000
    #define EXSRAM_BASE	0x60000000
    
    /* System memory map */
    
    MEMORY
    {
       /* Application stored in and executes from internal flash */
        FLASH (RX) : origin = APP_BASE, length = APP_LENGTH
        /* Application uses internal RAM for data */
        SRAM (RWX) : origin = RAM_BASE, length = 0x00040000
    
    	EXSRAM (RWX) : origin = EXSRAM_BASE, length = 0x00040000
    
    
    }
    
    /* Section allocation in memory */
    
    SECTIONS
    {
        .intvecs:   > APP_BASE
        .text   :   > FLASH
        .const  :   > FLASH
        .cinit  :   > FLASH
        .pinit  :   > FLASH
        .init_array : > FLASH
    
        .vtable :   > RAM_BASE
        .data   :   > SRAM
        .bss    :   > SRAM
        .sysmem :   > SRAM
        .stack  :   > SRAM
    
        .vtable :   > EXSRAM_BASE
        .data   :   > EXSRAM
    
    
    
    #ifdef  __TI_COMPILER_VERSION__
    #if     __TI_COMPILER_VERSION__ >= 15009000
        .TI.ramfunc : {} load=FLASH, run=SRAM|EXSRAM, table(BINIT)
    #endif
    #endif
    }
    

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [报价 userid="524025" url="~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1471966/tm4c1294ncpdt-tm4c1294ncpdt/5656729 #5656729"]

    但我无法从存储器浏览器访问  

    请查看代码要进行的更改、以便在存储器浏览器中查看代码

    [报价]

    您需要检查 GEL 文件。 默认 GEL 文件仅具有为 EPI 模块声明的0xA0000000地址、而不是0x60000000。 用户可以修改 GEL 文件、还包括从  0x60000000开始的地址范围。 另请注意、在允许调试器读取外部存储器前、必须先初始化 EPI 模块。


    [报价 userid="524025" url="~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1471966/tm4c1294ncpdt-tm4c1294ncpdt/5656908 #5656908"]

    要在此.cmd 文件中进行的任何更改、请查看它  

    全屏
    55.
    56.
    57.
    58.
    59.
    60.
    61.
    62.
    63.
    64
    65
    66
    67
    68
    69
    70
    71.
    72.
    73.
    74.
    75
    76.
    /*存储器中的段分配*/
    部分中)
    .intvecs:> app_base
    .text :>闪存
    .const :> FLASH
    .cinit :>闪存
    . Pinit :>闪存
    .init_array :> FLASH
    .vtable :> RAM_BASE
    .data :> SRAM
    . bss :> SRAM
    .sysmem :> SRAM.
    .stack :> SRAM.
    . vtable :> EXSRAM_BASE
    .data :> EXSRAM.
    [报价]

    我已经向您展示了 ektm4c129_epiflash_boot_demo 的.cmd 文件。 我不知道您为什么要使用上述.cmd 文件。 您自己试过吗? 我认为这会使链接器混淆。 将.vtable 和.data 段映射到内部和外部存储器。 您没有收到错误吗?