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:TM4C1294 EVK

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

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

器件型号:TM4C1294NCPDT
主题中讨论的其他器件:EK-TM4C1294XL

大家好、

我正在使用  TM4C1294 EVK ,这里我正在 尝试通过以太网固件升级来刷写.hex 文件,我可以通过以太网将 hex 文件写入闪存,使用 TCP IP 与外部应用程序从笔记本电脑加载二进制文件

但以太网在打开时也会写入其他应用程序(铬)中的垃圾值,以及 hex 文件  

您能建议如何解决此问题吗?  

您是否还能帮助我们 使用  TM4C1294 EVK 的 TCP IP 数据包、与引导加载程序一起或不一起共享用于以太网固件升级的任何工作示例代码  

请帮助我们完成以太网固件升级的示例项目和文档  

请  尽快响应

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    我可以通过以太网将 hex 文件写入闪存,使用 带有外部应用程序的 TCP IP 从笔记本电脑加载二进制文件

    您正在使用什么外部应用? 您可以使用 LM 闪存编程器或命令行 C:\ti\TivaWare_C_Series-2.2.0.295\tools\bin\eflash.exe 将固件通过以太网下载到闪存。 如果您使用的是第三方工具、则我不支持它。 请理解。  

    Unknown 说:
    您还可以帮助我们共享任何   用于以太网固件升级的工作示例代码、无论是否带有用于 TM4C1294 EVK 的 TCP IP 数据包的引导加载程序 

    我们有以太网引导加载程序示例。 您可以找到引导加载程序、它是位于闪存上0x0的一小段固件。 引导加载程序 示例 CCS 工程可以在 C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\boot_emac_flash 中找到。 引导加载程序附带了另一个应用程序示例。 此应用示例可在 C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\boot_demo_emac_flash 中找到。 引导加载程序(BOOT_EMAC_FLASH)将使用 TCP/IP 协议通过以太网加载示例应用程序(BOOT_DEMO_EMAC_FLASH)。 如前所述、在主机 PC 上运行的下载工具可以是 LM Flash 程序员或 eflash.exe。 这对示例开箱即可使用。 为什么不首先尝试库存示例? 我从未听说过在固件更新期间其他无用值会与应用程序固件混合。  

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

    您好!

     假设您使用 LM 闪存编程器来更新您的固件。 但思路与要使用的其他工具相同、例如 eflash.exe。  在 LM 闪存编程器中、您需要指定客户端 IP 地址和 MAC 地址。 您是这么做的吗? 常见的 TivaWare 引导加载程序是一款重量非常轻的堆栈、不包含 DHCP 应用层(OSI 层7)代码。 boot_demo_EMAC_flash 也是如此。 要将 IP 地址输入到 LM 闪存编程器中、您需要运行另一个示例、例如 enet_lwip 或 enet_io 或任何获取 IP 地址的示例。  获取 IP 地址后、您将在引导加载程序示例的 LM 闪存编程器中输入该地址。 原因是 DHCP IP 地址通常由网络上的 DHCP 服务器租用给您。 IP 地址将保留一段时间。 必须将该 IP 地址和 MAC 地址对输入充当 BootP/TFTP 服务器的 LM 闪存编程器。  

     我强烈建议您首先运行常用示例; boot_emac_flash 作为引导加载程序、boot_demo_emac_flash 作为 LaunchPad 上的应用固件。 在继续进行自定义引导加载程序之前、请确保它能够正常工作。

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

    FW   通过应用代码的 TCP 传输到 TM4c、并存储在辅助存储器中。 成功传输固件后、系统必须使用新固件启动。

    如果有2个选项、选项1 -使用新的固件地址重新启动;选项2 -重新启动以引导代码、检查固件升级标志、并从辅助存储器刷写应用程序启动地址、然后清除固件升级标志、然后再次重新启动。

    探索这2个选项。 我们已尝试在闪存起始地址中加载引导(引导)、并在闪存的另一个地址中加载应用(应用)。 我们可以通过 CCS 工具单独调试这两个应用。

    我想将从引导切 换到应用程序:我已经尝试使用来重新配置 NVIC 寄存器(HWREG (NVIC_VTABLE))

    • APP  地址-> HWREG (NVIC_VTABLE)= 0x00002838;(或)  
    • APP 的初始化函数-> HWREG (NVIC_VTABLE)= 0x00002aa1;

    _asm (" LDR R1、[r0]\n"
    " mov sp、r1");

     _asm (" LDR r0、[r0、#4]\n"
     " bx r0\n");

    但是、当 NVIC 的 HWREG 完成时、会调用 RESET_ISR、但不会切换到 APP。

    已尝试使用"(*(void (*)(void)))(*(uint32_t *) 0x00002838))();"。 错误"在没有可用调试信息的地址"0xfffffe"处中断、或程序代码之外。" LED 矩阵。

    请建议我从 引导切换到应用的方法以及这两个 cmd 文件需要哪些更改。

    引导中的 CMD 文件:


    --retain=g_pfnVectors

    /*应用的起始地址。 正常情况下、中断矢量*/
    /*必须位于应用程序的开头。 */
    #define APP_BASE 0x00000000
    #define RAM_BASE 0x20000000

    /*系统内存映射*/

    内存
    {
    /*存储在内部闪存中并从内部闪存执行的应用程序*/
    FLASH (RX):origin = APP_BASE,length = 0x00002000
    FLASH_APP1 (RWx):origin = 0x00002838、length = 0x00002000
    FLASH_APP2 (RWx):origin = 0x00006578、length = 0x00002000

    /*应用程序使用内部 RAM 进行数据*/
    SRAM (rwx):origin = 0x20000000、length = 0x00040000

    /*内存中的段分配*/

    部分
    {
    .intvecs:> app_base
    .text :>闪存
    .const :>闪存
    cinit :>闪存
    请输入您的密码:> FLASH
    init_array:> FLASH

    .vtable:> RAM_BASE
    .data :> SRAM
    bss :> SRAM
    .sysmem:> SRAM
    .stack:> SRAM
    #ifdef __TI_Compiler_version__
    #if __TI_Compiler_version__>= 15009000
    .TI.ramfunc:{}load=flash、run=SRAM、table (BINIT)
    #endif
    #endif

    __STACK_TOP =_STACK + 512;

    应用程序中的 CMD 文件

    --retain=g_pfnVectors

    /*应用的起始地址。 正常情况下、中断矢量*/
    /*必须位于应用程序的开头。 */
    #define APP_BASE 0x00000000
    #define RAM_BASE 0x20000000

    /*系统内存映射*/

    内存
    {
    /*存储在内部闪存中并从内部闪存执行的应用程序*/
    FLASH (RX):origin = APP_BASE,length = 0x00002000
    FLASH_APP1 (RWx):origin = 0x00002838、length = 0x00002000
    FLASH_APP2 (RWx):origin = 0x00006578、length = 0x00002000

    /*应用程序使用内部 RAM 进行数据*/
    SRAM (rwx):origin = 0x20000000、length = 0x00040000

    /*内存中的段分配*/

    部分
    {
    .intvecs:> FLASH_APP1
    .text:> FLASH_APP1
    .const:> FLASH_APP1
    .cinit:> FLASH_APP1
    .pinit:> FLASH_APP1
    init_array:> flash_app1

    .vtable:> RAM_BASE
    .data :> SRAM
    bss :> SRAM
    .sysmem:> SRAM
    .stack:> SRAM
    #ifdef __TI_Compiler_version__
    #if __TI_Compiler_version__>= 15009000
    .TI.ramfunc:{}load=flash_app1、run=sram、table (BINIT)
    #endif
    #endif

    __STACK_TOP =_STACK + 512;

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

    内存
    {
    /*存储在内部闪存中并从内部闪存执行的应用程序*/
    FLASH (RX):origin = APP_BASE,length = 0x00002000
    FLASH_APP1 (RWx):origin = 0x00002838、length = 0x00002000
    FLASH_APP2 (RWx):origin = 0x00006578、length = 0x00002000

    /*应用程序使用内部 RAM 进行数据*/
    SRAM (rwx):origin = 0x20000000、length = 0x00040000

    [/报价]

    若干意见:

    -你的 FW 真的只有8kB 每个? 听起来很小、但它适合您的应用。 我只是好奇。

    -您的固件不是以1024字节的倍数开始。 起始地址必须与闪存页边界对齐。 0x2838 iand 0x6578未与闪存页边界对齐。 为什么不制作 FW1 0x4000和 FW2 0x8000? 请参见 bl_config.h 文件。 请参见下方的。  

    //*****************************************************************************
    //
    // The starting address of the application.  This must be a multiple of 1024
    // bytes (making it aligned to a page boundary).  A vector table is expected at
    // this location, and the perceived validity of the vector table (stack located
    // in SRAM, reset vector located in flash) is used as an indication of the
    // validity of the application image.
    //
    // The flash image of the boot loader must not be larger than this value.
    //
    // Depends on: None
    // Exclusive of: None
    // Requires: None
    //
    //*****************************************************************************
    #define APP_START_ADDRESS       0x00004000
    
    //*****************************************************************************
    //
    // The address at which the application locates its exception vector table.
    // This must be a multiple of 1024 bytes (making it aligned to a page
    // boundary).  Typically, an application will start with its vector table and
    // this value should be set to APP_START_ADDRESS.  This option is provided to
    // cater for applications which run from external memory which may not be
    // accessible by the NVIC (the vector table offset register is only 30 bits
    // long).
    //
    // Depends on: None
    // Exclusive of: None
    // Requires: None
    //
    //*****************************************************************************
    #define VTABLE_START_ADDRESS    0x00004000

     引导加载程序必须知道固件启动的位置。 在常用 BOOT_EMAC_FLASH 示例的 bl_config.h 文件中、APP_START_ADDRESS 为0x4000。 此地址必须与固件链接到的位置相同。 如前所述、0x2838不是正确的边界。 即使正常、您也必须更改 APP_START_ADDRESS、以便引导加载程序知道从引导跳转到应用的位置。

     -该示例只能识别一个 FW 起始地址。 由于您有两个 FW、因此您必须向引导加载程序添加智能功能、以便它知道何时跳转到 FW1或 FW2。 现在、它将跳转至在 APP_START_ADDRESS 中定义的任何起始地址。  

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

    当我尝试将固件地址 chage 到 0x40000000

    IAM 出现以下错误  

    您好、这是我的.cmd 文件您可以更改 地址值并请恢复  

    /******************************************************************************
     *
     * blinky_ccs.cmd - CCS linker configuration file for blinky.
     *
     * Copyright (c) 2013-2020 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.
     * 
     * This is part of revision 2.2.0.295 of the EK-TM4C1294XL Firmware Package.
     *
     *****************************************************************************/
    
    --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 0x40000000
    #define RAM_BASE 0x20000000
    
    /* System memory map */
    
    MEMORY
    {
        /* Application stored in and executes from internal flash */
        FLASH (RWX) : origin = APP_BASE, length = 0x00002000
    	//FLASH_APP1 (RWX)    : origin = 0x00002838, length = 0x00002000
    	//FLASH_APP2 (RWX)    : origin = 0x00006578, length = 0x00002000
    
        /* Application uses internal RAM for data */
        SRAM (RWX) : origin = 0x20000000, 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
    #ifdef  __TI_COMPILER_VERSION__
    #if     __TI_COMPILER_VERSION__ >= 15009000
        .TI.ramfunc : {} load=FLASH, run=SRAM, table(BINIT)
    #endif
    #endif
    }
    
    __STACK_TOP = __stack + 4096;
    

    我还附上了应用代码、我确切地不知道如何切换指针、您能否检查一下 编码并恢复

    您能帮助我解决此问题吗?

    //*****************************************************************************
    //
    // blinky.c - Simple example to blink the on-board LED.
    //
    // Copyright (c) 2013-2020 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.
    // 
    // This is part of revision 2.2.0.295 of the EK-TM4C1294XL Firmware Package.
    //
    //*****************************************************************************
    
    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_memmap.h"
    #include "driverlib/debug.h"
    #include "driverlib/gpio.h"
    #include "driverlib/sysctl.h"
    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_gpio.h"
    #include "inc/hw_flash.h"
    #include "inc/hw_i2c.h"
    #include "inc/hw_memmap.h"
    #include "inc/hw_nvic.h"
    #include "inc/hw_ssi.h"
    #include "inc/hw_sysctl.h"
    #include "inc/hw_types.h"
    #include "inc/hw_uart.h"
    #include "driverlib/uart.h"
    #include "driverlib/rom.h"
    //*****************************************************************************
    //
    //! \addtogroup example_list
    //! <h1>Blinky (blinky)</h1>
    //!
    //! A very simple example that blinks the on-board LED using direct register
    //! access.
    //
    //*****************************************************************************
    
    //*****************************************************************************
    //
    // The error routine that is called if the driver library encounters an error.
    //
    //*****************************************************************************
    #ifdef DEBUG
    void
    __error__(char *pcFilename, uint32_t ui32Line)
    {
        while(1);
    }
    #endif
    
    //*****************************************************************************
    //
    // Blink the on-board LED.
    //
    //*****************************************************************************
    int
    main(void)
    {
    
        bool FWUp = true;
       if(FWUp == true)
       {
           (*((void (*)(void)) (*(uint32_t *)  0x00002aa1)))();
    
           HWREG(NVIC_VTABLE) = 0x00002aa1;
    
    //    // Load the stack pointer from the application's vector table.
    
       __asm(" ldr r1, [r0]\n"
       " mov sp, r1");
    
    //    // Load the initial PC from the application's vector table and branch to
    //    // the application's entry point.
    
       __asm(" ldr r0, [r0, #4]\n"
       " bx r0\n");
    
        }
    
        while(1)
        {
    
        }
    }
    

    您能否检查这些文件并根据更改返回我  

    请告知(.bin) 测试二进制地址 待修改

    如果可能、您还可以向我发送测试二进制.cmd 文件  

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

    当我尝试将固件地址 chage 到 0x40000000

    [/报价]

    为什么要将应用程序起始地址设置为0x40000000? 下一个通道为1GB。 MCU 仅具有1MB 闪存。 您正在设置的应用起始地址超出了有效存储器空间。 我让您使用0x4000。 您无法使用0x4000的原因是什么?