MSP430의 Information Memory에 CODE 배치

기술노트 39271






2018-02-28 오전 2:31


The MSP430 family have (up to) 256 bytes of flash memory in an area with the name "Information Memory". If your application is made for one of the smaller MSP430 derivatives then it can be useful to place parts of the application in the "Information Memory".


You can use the quick solution Using "Function placement into named segments"

or you can use the more efficient solution Change the .xcl file.

Using "Function placement into named segments"

You can either use the @-operator or the “#pragma location” directive to place a specific function in the INFO memory. It would look like:

void g(void) @ "INFO"

#pragma location="INFO"
void h(void)

Change the .xcl file

The above suggestion is quick and simple, but it does not allow the linker to place the code for you. To make IAR XLINK Linker optimize the placement (i.e. select and place functions to fill out the Information Memory) you need to edit (your own copy of) the .xcl file for your derivative.

(This example is based on the MSP430F1101A, Program Memory 1 kB flash, Information Memory 128 B flash, 128 B RAM.)

  • Make a copy of the lnk430F1101.xcl from the \430\config\ directory.
  • Place the copy in the same folder as the .ewp (project) file.
  • Open IAR Embedded Workbench for MSP430. Select: Project > Options > Linker > Config > Linker command file > mark "Override Default"
    Change from...
  • $PROJ_DIR$\lnk430F1101.xcl
  • Open the copied lnk430F1101.xcl file. Change from....

  • -Z(CODE)CODE=1080-10FF,FC00-FFDF
    ... and save the changes.

IAR XLINK Linker will now also place CODE in the Information Memory.

Note: If the .xcl file is not changed in any other way, then will symbols (data and/or functions) placed in the segment INFO have precedence over symbols placed in the segment CODE. The reason for this is that the -Z option for INFO is placed earlier in the .xcl file, than the -Z option for CODE.)

All product names are trademarks or registered trademarks of their respective owners.

죄송하지만, 당사 사이트에서는 Internet Explorer를 지원하지 않습니다.보다 편안한 사이트를 위해 Chrome, Edge, Firefox 등과 같은 최신 브라우저를 사용해 주시길 부탁드립니다.