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.

CCSTUDIO: How to tell CCS to put code in Information Memory when out of program space

Part Number: CCSTUDIO
Other Parts Discussed in Thread: MSP430F2001

Hi, I'm using a MSP430F2001 and running out of code space. I have lots of free information memory though. How do I tell the linker it's ok to use segments B,C,D of information memory to store code? I don't want to use segment A because of the oscillator calibration data that's there. I guess I would also have to tell the debugger to erase segments B,C,D before loading code there. Is there an app note on this? I'm an experienced C coder but not familiar with the linker setup on CCS.

Thanks,

Lloyd

  • Hey Lloyd,

    To try and do this, you will have to modify the linker command file. I don't know of an example of what you are asking for, but I found this page that describes the different fields in the https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_Linker-Command-File-Primer.html  

    Now, I would be careful using the Info memory space.  Usually this memory will be smaller segments and may require it's own permissions/password to erases/write to as It's really meant to be used for storing configuration data.  

    Good luck!

    JD

  • Since I hadn't heard from TI in a week, I dug out the linker manual and worked it out myself.

    First you have to tell the linker it can use information memory. I didn't want to use segment A because it has calibration data in it written by TI. I also reserved segment D in case I needed it for my own data. To do this, find the section in the linker command file (the .cmd file) that looks like this:

    .text : {} > FLASH /* Code */
    .cinit : {} > FLASH /* Initialization tables */

    and change it so it looks like this:

    .text : {} >> FLASH | INFOB | INFOC /* Code */
    .cinit : {} > INFOB /* Initialization tables */

    The linker will find C functions and initialized variables that will fit in the info mem segments and put them there.

    Then you have to tell the debugger that it can erase and program the info memory segments, but not segment A (again, to preserve the calibration data that TI puts there). To do that, click on the project name and go to this menu:

    Properties -> Debug -> MSP430 Flash Settings

    and select the button for

    Erase main and information memory

    This selection preserves segment A.

    This seems to be working fine.

    Lloyd