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.

MSP4305438A IAP远程升级问题

Other Parts Discussed in Thread: MSP430F5438A, MSP430FR5969

最近在研究MSP430F5438A IAP远程升级功能,但有些地方被迷惑了,请团队帮忙理解一下问题。

1. 不像MSP430F1系列的FLASH分布,5438FLASH代码空间有两段,而且在RAM中还多一个复用中断向量表。

我想知道能否合理的利用,在第一段FLASH存自己的BOOT代码,中断向量不变;把APP代码放到第二段里,

然后用户的中断向量表使用RAM中的复用中断向量表,可以吗?

2.在xcl文件里,有两个Const data标识,两个Code标识,两大类的地址空间差一个 10040-45BFF,在做IAP的时候BOOT和APP中该怎么分别修改?用的IAR开发环境,

  • 请您在下面的链接下载 Custom MSP430 Bootloader package,里面包含了相关的BSL程序

    software-dl.ti.com/.../index_FDS.html
  • 好的,-Z(CONST)DATA16_C,DATA16_ID,DIFUNCT,CHECKSUM=5C00-FF7F 这句里的FLASH地址在引导程序里需要修改吗?
  • 嗯,限于硬件问题 BSL是实现不了了,所以只能自己做BOOT了,关键问题是对xcl文件里这两项的可能的操作,暂时无法深入研究IAR xcl文件,麻烦针对问题确定一下我的想法基本就算ok了,文档及问题附件如下:

    lnk430f5438a.txt
    // ************************************************
    //
    // XLINK configuration file for MSP430F5438A
    //
    // Copyright 1996-2018 IAR Systems AB.
    //
    // See the file 430/doc/licenses/IARSourceLicense.txt for detailed
    // license information.
    //
    // $Revision: $
    //
    // ************************************************
    
    // ---------------------------------------------------------
    // Description
    //
    
    //
    // Usage:
    //
    //   xlink [file file ...] -f lnk430f5438a.xcl
    //
    // -----------------------------------------------
    // Device summary
    //
    
    //
    // Core:                               MSP430Xv2
    //
    // Special vectors:                    64
    //
    // Peripheral units:                   00100-00FFF
    //
    // Information memory (FLASH):         01800-019FF
    //
    // Read/write memory (RAM):            01C00-05BFF
    //
    // Read-only memory (FLASH):           05C00-0FFFF
    //                                 10000-45BFF
    //
    
    
    // -----------------------------------------------
    // Segments
    //
    
    // -------------------------------------
    // Data read/write segments (RAM)
    //
    
    //
    // The following segments are available for both
    // the DATA16 and DATA20 segment groups.
    //
    // segment         Usage
    // -------         --------------------------
    // DATA<nn>_Z      Data initialized to zero
    // DATA<nn>_I      Data initialized by copying from DATA<nn>_ID
    // DATA<nn>_N      Data defined using __no_init
    // DATA<nn>_HEAP   The heap used by 'malloc' and 'free'
    //
    // segment         Usage
    // -------         --------------------------
    // CSTACK          Runtime stack
    // TLS16_I         Thread-local storage for main thread
    //
    
    
    // -------------------------------------
    // Program and data read-only segments (FLASH)
    //
    
    //
    // The following segments are available for both
    // the DATA16 and DATA20 segment groups.
    //
    // segment         Usage
    // -------         --------------------------
    // DATA<nn>_C      Constant data, including string literals
    // DATA<nn>_ID     Initializers for DATA<nn>_I
    //
    // segment         Usage
    // -------         --------------------------
    // INFO            Information memory
    // INFOA           Information memory, bank A
    // INFOB           Information memory, bank B
    // INFOC           Information memory, bank C
    // INFOD           Information memory, bank D
    // CSTART          Program startup code
    // CODE            Program code
    // ISR_CODE        Program code for interrupt service routines
    // DIFUNCT         Dynamic initialization vector used by C++
    // CHECKSUM        Checksum byte(s) generated by the -J option
    // INTVEC          Interrupt vectors
    // RESET           The reset vector
    // TLS16_ID        Thread-local initializers for main thread
    //
    // Notes:
    //
    // * The segments CSTART, ISR_CODE, and DIFUNCT, as well as the segments in
    //   the DATA16 and TLS16 segment groups must be placed in in the range
    //   0000-FFFD.
    //
    // * The INFOx and INFO segments overlap, this allows data either to be
    //   placed in a specific bank or anywhere in the info memory.
    //
    // * The INTVEC and RESET segments overlap. This allows an application to
    //   either use the reset vector provided by the runtime library, or
    //   provide a reset function by defining an interrupt function associated
    //   with the reset vector.
    //
    
    
    // ---------------------------------------------------------
    // Configuation
    //
    
    // -----------------------------------------------
    // Stack and heap sizes
    //
    
    // Uncomment for command line use
    //-D_STACK_SIZE=160
    //-D_DATA16_HEAP_SIZE=160
    //-D_DATA20_HEAP_SIZE=160
    
    
    // -----------------------------------------------
    // Define cpu
    //
    
    -cmsp430
    
    // Compensate for hardware bug in CPU
    -D?CPU30_OFFSET=2
    
    
    // -----------------------------------------------
    // Support for placing functions in read/write memory
    //
    
    -QCODE_I=CODE_ID
    
    
    // -----------------------------------------------
    // Support for thread local storage
    //
    
    -QTLS16_I=TLS16_ID
    
    
    // -----------------------------------------------
    // Hardware multiplier location
    //
    
    -D__iar_HWMUL=4C0
    
    
    // ---------------------------------------------------------
    // Placement directives
    //
    
    // -----------------------------------------------
    // Information memory
    //
    
    -Z(CONST)INFO=1800-19FF
    -Z(CONST)INFOA=1980-19FF
    -Z(CONST)INFOB=1900-197F
    -Z(CONST)INFOC=1880-18FF
    -Z(CONST)INFOD=1800-187F
    
    
    // -----------------------------------------------
    // RAM memory
    //
    
    -Z(DATA)DATA16_I,DATA16_Z,DATA16_N,TLS16_I=1C00-5BFF
    -Z(DATA)DATA16_HEAP+_DATA16_HEAP_SIZE
    -Z(DATA)CODE_I
    -Z(DATA)DATA20_I,DATA20_Z,DATA20_N,DATA20_HEAP+_DATA20_HEAP_SIZE
    -Z(DATA)CSTACK+_STACK_SIZE#
    
    
    // -----------------------------------------------
    // Read-only memory
    //
    
    // -------------------------------------
    // Low memory 0-0FFFF
    //
    
    // ---------------------------
    // Constant data
    //
    
    -Z(CONST)DATA16_C,DATA16_ID,TLS16_ID,DIFUNCT,CHECKSUM=5C00-FF7F  (没什么疑问)
    
    // ---------------------------
    // Code
    //
    
    -Z(CODE)CSTART,ISR_CODE,CODE16=5C00-FF7F  (没什么疑问)
    
    
    // -------------------------------------
    // All memory 0-FFFFF
    //
    
    // ---------------------------
    // Code
    //
    
    -P(CODE)CODE=5C00-FF7F, 10000-45BFF (代码分了两段)
    1.在BOOT程序里 后面10000-45BFF段可否删除?
    2.在APP程序里 后面10000-45BFF段可否删除?
    3.假设我APP程序太大,5C00-FF7F段用完了,会自动往10000-45BFF段里存储吗?
    4.能否把BOOT程序放到5C00-FF7F段,APP程序单独放到10000-45BFF段
    
    // ---------------------------
    // Constant data
    //
    
    -Z(CONST)DATA20_C,DATA20_ID,CODE_ID=5C00-FF7F,10040-45BFF (代码分了两段)
    1.在BOOT程序里 后面10000-45BFF段可否删除?
    2.在APP程序里 后面10000-45BFF段可否删除?
    
    
    // -------------------------------------
    // Special vectors
    //
    
    -Z(CODE)INTVEC=FF80-FFFF
    -Z(CODE)RESET=FFFE-FFFF
    

  •  关于MSP4305438A升级,网上有详细的讲解的

    https://wenku.baidu.com/view/32e61bcd2e3f5727a4e96254.html

  • 你好,这个文档我看过了,它不但修改而且还删除了某些段,不确定其正确性。
  • 如果您的BSL应用程序大于2KB或者硬件无法实现BSL,则需要使用主内存引导程序,我建议以MSP-Boot为例。

    www.ti.com/.../slaa600d.pdf

    software-dl.ti.com/.../index_FDS.html

    目前给出的示例都是基于CCS的

    您的附件我先看一下哈
  • 我看一下xcl文件,由于我的IAR已经到期且没有续费,所以不太方便上手为您实验。

    给您附上之前移植到MSP430FR5969的MSPBOOT步骤,您可以参考一下

    Migrating_MSPBoot_FR5969.docx

  • 谢谢,对那些问题已经基本理解了,现在关心的是在BOOT中定义的变量、常量、使用的引脚或串口,跳转到APP中后会不会有冲突或者影响呢,会自动清除BOOT遗留状态吗?
  • 不会清除BOOT遗留状态的,,需要注意APP和BOOT的中断函数不要有冲突或重复。
  • yes Susan,这正是最后关心的问题。
    1. BOOT和APP的中断向量表,一般为了避免麻烦在BOOT不用中断,假如在BOOT里真要使用中断方式,如何解决跳转冲突问题呢?
    2.BOOT和APP重复初始化相同外设会不会导致卡死或其他异常?
  • 关于这个问题,我没有实际操作过。您可以看一下

    www.ti.com/.../slaa600d.pdf

    给出的方式

    2.2.2 Vector Redirection 以及 2.2.3 Interrupt Vectors in Flash Devices

    但根据之前网友的经验分享,貌似还是有问题

    blog.csdn.net/.../84986730

    我先研究一下哈
  • 好的,能给俺解释明白就够了。