I am using CCS v5.1.0.09000 with the MSP430 C compiler v4.0.0 and developing code for the MSP4305419A part and using the EABI output format. At first my code (and data) fit within the lower 64K of memory so I have been using the small code and small data memory models with no problems. Now my code has grown large enough that it does not fit within the lower 64K, so I switched to the large code model, but kept using the small data memory model.
However, with this configuration, I get the following error:
<Linking>
"../lnk_msp430f5419a.cmd", line 126: error #10099-D: program will not fit into
available memory. placement with alignment fails for section ".cinit" size
0x10f . Available memory ranges:
FLASH size: 0xa17e unused: 0x0 max hole: 0x0
error #10010: errors encountered during linking; "Controller.out" not built
Looking at the linker command file (see file contents below) shows that the .cinit section should only be placed in the lower 64K of Flash. Looking at the map file, it appears that the .text section is being placed into Flash first, which completely fills the Flash, leaving no room for the .cinit section. The .cinit directive comes first in the linker command file, so why is the .text section being allocated first?
Thanks for your help, Austin
Linker command file contents:
MEMORY
{
SFR : origin = 0x0000, length = 0x0010
PERIPHERALS_8BIT : origin = 0x0010, length = 0x00F0
PERIPHERALS_16BIT : origin = 0x0100, length = 0x0100
RAM : origin = 0x1C00, length = 0x4000
INFOA : origin = 0x1980, length = 0x0080 /* DO NOT FILL! */
INFOB : origin = 0x1900, length = 0x0080, fill = 0x3FFF
INFOC : origin = 0x1880, length = 0x0080, fill = 0x3FFF
INFOD : origin = 0x1800, length = 0x0080, fill = 0x3FFF
ASSERT_LOG : origin = 0x5C00, length = 0x0200, fill = 0x3FFF
FLASHCRC : origin = 0x5E00, length = 0x0002, fill = 0xCCCC
FLASH : origin = 0x5E02, length = 0xA17E
FLASH2 : origin = 0x10000,length = 0x15C00
INT00 : origin = 0xFF80, length = 0x0002
<<< all of the other interrupt vectors >>>
INT62 : origin = 0xFFFC, length = 0x0002
RESET : origin = 0xFFFE, length = 0x0002
}
/****************************************************************************/
/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */
/****************************************************************************/
SECTIONS
{
.bss : {} > RAM /* GLOBAL & STATIC VARS */
.data : {} > RAM /* GLOBAL & STATIC VARS */
.sysmem : {} > RAM /* DYNAMIC MEMORY ALLOCATION AREA */
// .stack : {} > RAM (HIGH) /* SOFTWARE SYSTEM STACK (ORIGINAL) */
.ramstart : 0x1C00 /* First (16-bit) location in RAM */
.cvstart : 0x58E0 /* Store critical variable copies */
.stackstart: 0x58FA /* SOFTWARE SYSTEM STACK START */
.stack : 0x58FC /* SOFTWARE SYSTEM STACK */
.stackend : 0x5BFC /* SOFTWARE SYSTEM STACK END */
.ramend : 0x5BFE /* Last (16-bit) location in RAM */
.uniqueID : 0x5E02 /* Device Unique ID */
.fwVer : 0x5E04 /* Firmware Version Number */
//#ifdef (__LARGE_DATA_MODEL__)
// .const : {} > FLASH | FLASH2 /* CONSTANT DATA */
//#else
.const : {} > FLASH /* CONSTANT DATA */
//#endif
.cinit : {} > FLASH /* INITIALIZATION TABLES */
.text:_isr : {} > FLASH /* ISR CODE SPACE */
.text : {}>> FLASH | FLASH2 /* CODE */
.cio : {} > RAM /* C I/O BUFFER */
.pinit : {} > FLASH /* C++ CONSTRUCTOR TABLES */
.infoA : {} > INFOA /* MSP430 INFO FLASH MEMORY SEGMENTS */
.infoB : {} > INFOB
.infoC : {} > INFOC
.infoD : {} > INFOD
.int00 : {} > INT00 /* MSP430 INTERRUPT VECTORS */
<<< all of the other interrupt vectors >>>
.int62 : {} > INT62
.reset : {} > RESET /* MSP430 RESET VECTOR */
}