Hello,
I'm having trouble with getting a program to fit into flash on an MSP430F5438A. The code size is ~50K, and the total flash memory on the MSP430F5438A is 256K. This uC has 4 flash sections (SLAS612C, p. 14). If I force things around, the program will sometimes load "successfully" but Code Composer will never reset the CPU (the program will just load, but will not execute).
My entire code size is a little larger than the first flash section defined in the datasheet (SLAS612C, p. 14)
Here's the error (entire project attached as well):
Program will not fit into available memory. placement with alignment fails for section ".cinit" size 0x34 . Available memory ranges: FLASH size: 0xa380 unused: 0x28 max hole: 0x28 lnk_msp430f5438a.cmd line 124 C/C++ Problem
I understand what the error message means, but if I change any of the FLASH or FLASH2 sections, I create all sorts of strange overlaps, and end up blowing the security fuse. Basically my question is: how do I get a large .code base to allocate all the 256K of memory? I have all optimizations turned on for size in linker options, but I cannot figure out how to specify .code to span all 4 flash sections.
msp430f5438a.cmd
MEMORY
{
.....
//Here is where the flash range is defined
FLASH : origin = 0x5C00, length = 0xA380
FLASH2 : origin = 0x10000,length = 0x35C00
INT00 : origin = 0xFF80, length = 0x0002
.....
INT62 : origin = 0xFFFC, length = 0x0002
RESET : origin = 0xFFFE, length = 0x0002
}
SECTIONS
{
.bss : {} > RAM /* GLOBAL & STATIC VARS */
.data : {} > RAM /* GLOBAL & STATIC VARS */
.sysmem : {} > RAM /* DYNAMIC MEMORY ALLOCATION AREA */
.stack : {} > RAM (HIGH) /* SOFTWARE SYSTEM STACK */
.text : {} >> FLASH | FLASH2 /* CODE */ Error usually here
.text:_isr : {} > FLASH2 /* ISR CODE SPACE */
.cinit : {} > FLASH /* INITIALIZATION TABLES */
.const : {} > FLASH | FLASH2 /* CONSTANT DATA */ Error usually here
.cio : {} > RAM /* C I/O BUFFER */
.pinit : {} > FLASH /* C++ CONSTRUCTOR TABLES */
.init_array : {} > FLASH /* C++ CONSTRUCTOR TABLES */
.mspabi.exidx : {} > FLASH /* C++ CONSTRUCTOR TABLES */
.mspabi.extab : {} > FLASH /* C++ CONSTRUCTOR TABLES */
.infoA : {} > INFOA /* MSP430 INFO FLASH MEMORY SEGMENTS */
.infoB : {} > INFOB
.infoC : {} > INFOC
.infoD : {} > INFOD
.......
}
Best regards,
Russell