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.

[参考译文] SW-TM4C:在自有闪存中重写自有代码段的示例代码

Guru**** 2535160 points
Other Parts Discussed in Thread: EK-TM4C1294XL, TM4C1290NCPDT

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1328737/sw-tm4c-sample-code-of-re-write-own-code-section-in-own-flash

器件型号:SW-TM4C
主题中讨论的其他器件:TM4C1290NCPDT、EK-TM4C1294XL

您好

我对 Tiva 软件有疑问吗?

我的客户正在使用 TM4C1290NCPDT。

是否有在自己的闪存中重写自己代码段的示例代码?
(用于代码更新的二进制文件可以通过 SPI 下载)

谢谢。

GR

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

    您好、GR、

     我想您是指使用 SSI 接口的引导加载程序。 是的、这在我们的 TivaWare SDK 中基于 ROM 的引导加载程序和基于闪存的引导加载程序中都受支持。  

    请参阅 bl_config.h 文件、为 SSI 引导加载配置引导加载程序。 我们没有展示 SSI 引导加载的示例。 我建议您先从 UART 引导加载程序开始、并了解其工作原理。 然后可以迁移到 SSI 引导加载程序。  

    //*****************************************************************************
    //
    // Selects the SSI port as the port for communicating with the boot loader.
    //
    // Depends on: None
    // Exclusive of: CAN_ENABLE_UPDATE, ENET_ENABLE_UPDATE, I2C_ENABLE_UPDATE,
    //               UART_ENABLE_UPDATE, USB_ENABLE_UPDATE
    // Requires: SSI_CLOCK_ENABLE, SSIx_BASE, SSI_CLKPIN_CLOCK_ENABLE, 
    //           SSI_CLKPIN_BASE, SSI_CLKPIN_PCTL, SSI_CLKPIN_POS, 
    //           SSI_FSSPIN_CLOCK_ENABLE, SSI_FSSPIN_BASE, SSI_FSSPIN_PCTL,
    //           SSI_FSSPIN_POS, SSI_MISOPIN_CLOCK_ENABLE, SSI_MISOPIN_BASE,
    //           SSI_MISOPIN_PCTL, SSI_MISOPIN_POS, SSI_MOSIPIN_CLOCK_ENABLE,
    //           SSI_MOSIPIN_BASE, SSI_MOSIPIN_PCTL and SSI_MOSIPIN_POS
    //
    //*****************************************************************************
    //#define SSI_ENABLE_UPDATE
    
    //*****************************************************************************
    //
    // Selects the clock enable for the SSI peripheral module
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSIx_BASE
    //
    //*****************************************************************************
    //#define SSI_CLOCK_ENABLE          SYSCTL_RCGCSSI_R0
    
    //*****************************************************************************
    //
    // Selects the base address of the SSI peripheral module
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_CLOCK_ENABLE
    //
    //*****************************************************************************
    //#define SSIx_BASE          SSI0_BASE
    
    //*****************************************************************************
    //
    // Selects the clock enable for the GPIO corresponding to SSI CLK pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_CLKPIN_BASE, SSI_CLKPIN_PCTL and SSI_CLKPIN_POS
    //
    //*****************************************************************************
    //#define SSI_CLKPIN_CLOCK_ENABLE          SYSCTL_RCGCGPIO_R0
    
    //*****************************************************************************
    //
    // Selects the base address for the GPIO corresponding to SSI CLK pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_CLKPIN_CLOCK_ENABLE, SSI_CLKPIN_PCTL and SSI_CLKPIN_POS
    //
    //*****************************************************************************
    //#define SSI_CLKPIN_BASE          GPIO_PORTA_BASE
    
    //*****************************************************************************
    //
    // Selects the port control value for the GPIO corresponding to SSI CLK pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_CLKPIN_CLOCK_ENABLE, SSI_CLKPIN_BASE and SSI_CLKPIN_POS
    //
    //*****************************************************************************
    //#define SSI_CLKPIN_PCTL          0x2
    
    //*****************************************************************************
    //
    // Selects the pin number for the GPIO corresponding to SSI CLK pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_CLKPIN_CLOCK_ENABLE, SSI_CLKPIN_BASE and SSI_CLKPIN_PCTL
    //
    //*****************************************************************************
    //#define SSI_CLKPIN_POS          2
    
    //*****************************************************************************
    //
    // Selects the clock enable for the GPIO corresponding to SSI FSS pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_FSSPIN_BASE, SSI_FSSPIN_PCTL and SSI_FSSPIN_POS
    //
    //*****************************************************************************
    //#define SSI_FSSPIN_CLOCK_ENABLE          SYSCTL_RCGCGPIO_R0
    
    //*****************************************************************************
    //
    // Selects the base address for the GPIO corresponding to SSI FSS pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_FSSPIN_CLOCK_ENABLE, SSI_FSSPIN_PCTL and SSI_FSSPIN_POS
    //
    //*****************************************************************************
    //#define SSI_FSSPIN_BASE          GPIO_PORTA_BASE
    
    //*****************************************************************************
    //
    // Selects the port control value for the GPIO corresponding to SSI FSS pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_FSSPIN_CLOCK_ENABLE, SSI_FSSPIN_BASE and SSI_FSSPIN_POS
    //
    //*****************************************************************************
    //#define SSI_FSSPIN_PCTL          0x2
    
    //*****************************************************************************
    //
    // Selects the pin number for the GPIO corresponding to SSI FSS pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_FSSPIN_CLOCK_ENABLE, SSI_FSSPIN_BASE and SSI_FSSPIN_PCTL
    //
    //*****************************************************************************
    //#define SSI_FSSPIN_POS          3
    
    //*****************************************************************************
    //
    // Selects the clock enable for the GPIO corresponding to SSI MISO pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_MISOPIN_BASE, SSI_MISOPIN_PCTL and SSI_MISOPIN_POS
    //
    //*****************************************************************************
    //#define SSI_MISOPIN_CLOCK_ENABLE          SYSCTL_RCGCGPIO_R0
    
    //*****************************************************************************
    //
    // Selects the base address for the GPIO corresponding to SSI MISO pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_MISOPIN_CLOCK_ENABLE, SSI_MISOPIN_PCTL and SSI_MISOPIN_POS
    //
    //*****************************************************************************
    //#define SSI_MISOPIN_BASE          GPIO_PORTA_BASE
    
    //*****************************************************************************
    //
    // Selects the port control value for the GPIO corresponding to SSI MISO pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_MISOPIN_CLOCK_ENABLE, SSI_MISOPIN_BASE and SSI_MISOPIN_POS
    //
    //*****************************************************************************
    //#define SSI_MISOPIN_PCTL          0x2
    
    //*****************************************************************************
    //
    // Selects the pin number for the GPIO corresponding to SSI MISO pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_MISOPIN_CLOCK_ENABLE, SSI_MISOPIN_BASE and SSI_MISOPIN_PCTL
    //
    //*****************************************************************************
    //#define SSI_MISOPIN_POS          5
    
    //*****************************************************************************
    //
    // Selects the clock enable for the GPIO corresponding to SSI MOSI pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_MOSIPIN_BASE, SSI_MOSIPIN_PCTL and SSI_MOSIPIN_POS
    //
    //*****************************************************************************
    //#define SSI_MOSIPIN_CLOCK_ENABLE          SYSCTL_RCGCGPIO_R0
    
    //*****************************************************************************
    //
    // Selects the base address for the GPIO corresponding to SSI MOSI pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_MOSIPIN_CLOCK_ENABLE, SSI_MOSIPIN_PCTL and SSI_MOSIPIN_POS
    //
    //*****************************************************************************
    //#define SSI_MOSIPIN_BASE          GPIO_PORTA_BASE
    
    //*****************************************************************************
    //
    // Selects the port control value for the GPIO corresponding to SSI MOSI pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_MOSIPIN_CLOCK_ENABLE, SSI_MOSIPIN_BASE and SSI_MOSIPIN_POS
    //
    //*****************************************************************************
    //#define SSI_MOSIPIN_PCTL          0x2
    
    //*****************************************************************************
    //
    // Selects the pin number for the GPIO corresponding to SSI MOSI pin
    //
    // Depends on: SSI_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: SSI_MOSIPIN_CLOCK_ENABLE, SSI_MOSIPIN_BASE and SSI_MOSIPIN_PCTL
    //
    //*****************************************************************************
    //#define SSI_MOSIPIN_POS          4

    UART 引导加载程序示例可以在 C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\boot_serial 中找到。 您还可以找到引导加载程序附带的示例 UART 应用程序。 此示 例位于 C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\boot_deme1。 boot_serial 将通过 UART 接口引导并加载 boot_deme1。 一旦您使其正常工作、就可以适应 SSI 接口。  

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

    Tsai、您好!

    感谢您的信息。

    我明白了。

    我将引用 UART bootloadar。

    此致、

    GR