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.

CCS/MSP430F5528: A compiler errror is generated when an array spans Info D and C.

Part Number: MSP430F5528

Tool/software: Code Composer Studio

Hi,  I have defined an array of unsigned longs in my project called flash_VRS[].  It is placed into flash memory starting at Info D, and ending at Info C.  Given that the array requires exactly 256 bytes of flash memory, and each info segment contains 128 bytes, I think it should fit.

#define LOFVRS   64 // length of Flash VRS, occupies memory segment D and C

// For storage of non-volatile data in the flash memory
// segment of the VRS[]
#pragma NOINIT( flash_VRS );
#pragma location = 0x1800; // begins at start of Info D
QUADLET flash_VRS[ LOFVRS ];

However, when I clean and compile, the following error occurs:

<a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/10099.html">#10099-D</a>  program will not fit into available memory.  run placement with alignment fails for section ".TI.bound:flash_VRS" size 0x100 EXP-4    C/C++ Problem

Is there a workaround for this ?

Thanks for your help.

Roy

  • Roy Nordstrom1 said:
    Is there a workaround for this ?

    The only method is changing the linker command file.  I don't like recommending this method.  The MSP430 linker command files are carefully maintained by device experts.  It is best if you rely on their expertise.

    Your project contains a linker command file named lnk_msp430f5528.cmd .  All of the changes are made to this file.

    These lines must removed or commented out ...

        INFOC                   : origin = 0x1880, length = 0x0080
        INFOD                   : origin = 0x1800, length = 0x0080

    And replaced with something similar to this ...

        INFOCD                  : origin = 0x1800, length = 0x0100

    These lines must be removed or commented out ...

        .infoC     : {} > INFOC
        .infoD     : {} > INFOD

    To understand the explanation for these changes, you first need to gain an understanding of the terms input section, output section, and memory range from the wiki article titled Linker Command File Primer.  With the original linker command file, you tried to make an input section span across multiple memory ranges.  The linker does not allow that.  In this specific case, the input section .TI.bound:flash_VRS tried to span the memory ranges INFOD and INFOC.  The changes above remove both of those memory ranges, and the references to them, and replaces them with a new memory range INFOCD.  INFOCD is a combination of the former INFOD and INFOC.  

    Thanks and regards,

    -George