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.

linker issues with CCS6 and MSP430

Other Parts Discussed in Thread: MSP430F235

The new version of CCS (6.1.2.00015) does not successfully link a program which works fine with CCS 5.5.0. The part we use is the MSP430F235, which is the correct part listed in the linker cmd file: -l msp430f235.cmd When I check the map file, it appears as if .text is placed at 0x0000, rather than 0xC000, which is the start of FLASH. The message is as follows: 

remark #10372-D: (ULP 4.1) Detected uninitialized Port 1 in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins. "../lnk_msp430f235.cmd", line 96: error #10099-D: program will not fit into available memory. placement with alignment fails for section ".text" size 0x5654 . Available memory ranges: >> Compilation failure FLASH size: 0x3fde unused: 0x3f14 max hole: 0x3f14 error #10010: errors encountered during linking; "ElectraFLO.out" not built gmake: *** [ElectraFLO.out] Error 1 gmake: Target `all' not remade because of errors.]

the code size calculation reported is not correct.  In debug mode on CCS5.5 the build is about 13K.  No support from my direct inquiry to TI, so wondered if the users can help me.  I did notice the compiler was change from the v3.3.3 to v4.4.1.

  • Sorry, I rechecked and the compiler version for CCS6 is v4.4.5
  • William,

    I moved your thread to the CCS forums as I think your issue may be CCS related rather than specific to the 430. If it ends up being more 430 related, we can move it back.

    Mike
  • William Sell said:
    error #10099-D: program will not fit into available memory. placement with alignment fails for section ".text" size 0x5654 . Available memory ranges: >> Compilation failure FLASH size: 0x3fde unused: 0x3f14 max hole: 0x3f14

    This message is saying that the size of the .text section generated by the compiler is greater than the amount of memory available for its allocation.

    Note that it says the size of the .text section is 0x5654. Can you take a look at the link map file created with CCS 5.5 and check the size of the .text section in that build?

    Since you are using different versions of the compiler, it is possible that the .text section increased in size, and is no longer able to fit in the memory region it is allocated to. Another factor that could be contributing to the difference is the output format (EABI or COFF). Can you check if that matches up for both builds (Project Properties->General->Output Format)?

  • Thanks Aarti,

    Here is the report from the map file for the CCS5.5 build:

    .text      0    0000c000    00003728

    Here is the report from the map file for the CCS6 build:

    .text      0    00000000    00005654     FAILED TO ALLOCATE

    I do not think the code would bloat by nearly 8k, but if that was true this is a pretty lousy compiler.  The point to note here is the placement of the .text.  In the linker command file it clearly maps .text to the start of flash for the device (0xc000), but places it at 0x0.   This is the essence of the problem.  I can send you the project if you like to see if you can reproduce the problem.  Right now I have an upgraded computer and IDE and I am unable to build the project.  Not good...

  • William Sell said:
    The point to note here is the placement of the .text.  In the linker command file it clearly maps .text to the start of flash for the device (0xc000), but places it at 0x0.  

    It is not actually placing it at 0x0. It defaults to showing address 0x0 when the allocation fails. 

    William Sell said:
    I can send you the project if you like to see if you can reproduce the problem.

    Yes I can take a look at the project if you are willing to send it. Can you zip it up and attach it here?

  • sure, no problem. except I cannot see a place to attach the file!
  • When you reply to the message, click on "Use rich formatting", then there should be an option for attaching files.

  • William Sell said:
     I did notice the compiler was change from the v3.3.3 to v4.4.1.

    I imported your SensorWorkingCopy project into a CCS 6.1.2 installation which only had v4.4.x compilers installed.

    After importing the project, the project properties show that compiler version v4.4.6 will be used, because the v3.3.3 specified in the project isn't installed, and also shows that the Output format is set to "legacy COFF":

    When the project was built with the v4.4.6 compiler using the legacy COFF format the linker was able to successfully create the program, with the flash allocation as:

      FLASH                 0000c000   00003fde  000038fa  000006e4  RWIX

    The linker generated the following warning (which I didn't investigate):

    <Linking>
    "../lnk_msp430f235.cmd", line 72: warning #10424-D: Linker command file has no
       sections of type=VECT_INIT, but does contain .intXX sections.  This file may
       be out of date.  Generating interrupt pointers for all .intXX sections.  The
       default handler provided in the RTS will be used if no other handler is
       found.  It is recommend that you update your linker command file to the
       latest version.

    In the CCS project properties the compiler version was changed from v3.3.3 to v4.4.6, which caused CCS to also change the Output format to "eabi (ELF)":

    With the output format set to "eabi (ELF)" the v4.4.6 compiler then failed to link the program due to lack of flash space:

    "../lnk_msp430f235.cmd", line 60: error #10099-D: program will not fit into
       available memory.  placement with alignment fails for section ".text" size
       0x567e .  Available memory ranges:
       FLASH        size: 0x3fde       unused: 0x3f14       max hole: 0x3f14    
    error #10010: errors encountered during linking; "Dual.out" not built
    

    The reason why the change of output format from "legacy COFF" to "eabi (ELF)" causes the code size bloat is that the code calls log10, sqrt and pow which take double arguments. In COFF double is 32-bits but is 64-bits in ELF. If you want to use the v4.4.6 compiler with ELF, changing the code to call log10f, sqrtf and powf to explicitly use the float versions of the maths functions may reduce the code size sufficiently. Failing that, in the CCS 6 project properties change the output format to "legacy COFF".

    [I was also going to suggest installed the v3.3.3 compiler into CCS 6, but in CCS 6 the oldest compiler version available to be installed is v4.0.1]

  • William,

    I observe the same thing as Chester, and his analysis and suggestions to resolve the error are spot on.  

  • Thanks guys!  Changed to the legacy Coff and no problems at all.  Really appreciate the help...