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.
最近在研究MSP430F5438A IAP远程升级功能,但有些地方被迷惑了,请团队帮忙理解一下问题。
1. 不像MSP430F1系列的FLASH分布,5438FLASH代码空间有两段,而且在RAM中还多一个复用中断向量表。
我想知道能否合理的利用,在第一段FLASH存自己的BOOT代码,中断向量不变;把APP代码放到第二段里,
然后用户的中断向量表使用RAM中的复用中断向量表,可以吗?
2.在xcl文件里,有两个Const data标识,两个Code标识,两大类的地址空间差一个 10040-45BFF,在做IAP的时候BOOT和APP中该怎么分别修改?用的IAR开发环境,
嗯,限于硬件问题 BSL是实现不了了,所以只能自己做BOOT了,关键问题是对xcl文件里这两项的可能的操作,暂时无法深入研究IAR xcl文件,麻烦针对问题确定一下我的想法基本就算ok了,文档及问题附件如下:
// ************************************************ // // 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
我看一下xcl文件,由于我的IAR已经到期且没有续费,所以不太方便上手为您实验。
给您附上之前移植到MSP430FR5969的MSPBOOT步骤,您可以参考一下