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.

Switching to compiler version 4.2.x causes compile issues.



I recently updated CCS to 5.5, which at the time included MSP430 compiler version 4.2.1. In the project I was working on, which compiled and ran fine, the program makeup was:

FLASH = 9519 bytes

RAM = 462 bytes

When I switched the compiler version to 4.2.1 in the project properties, the project compiles but yields some odd results:

FLASH = 1052 bytes

RAM = 88 bytes

Also the firmware doesn't run at all, despite the project building properly. The firmware depends upon another project in the workspace which is generating a library. I have tried both versions of the compiler in this project as well with no change in result.

Last night I updated to the latest CCS version, which included compiler version 4.2.2. This yields the same result.

What is different between the 4.1.x and 4.2.x versions of the compiler that could cause this issue? Is there some other requirement for the code or linker file that would cause this?

  • You should try updating your linker file in the project folder to the version that comes with the new compiler. Changes there might cause some symbols not being defined so the linker doesn't link from the runtime or standard library what it should link.
    Also check the project defaults. Maybe when importing your project, some have been 'updated'. The difference in size almost looks like the floating point math functions haven't been linked. But that's plain guessing.

  • I never re-imported the project after install. It was already in the workspace, and it has a linker file that was present with it. There are no math library functions, but there are certainly floating point calcs.

    I will test the linker file today. Where would I find the linker file that works with the new compiler?

    Thanks for the help.

  • Do you still have access to the CCS 5.4 build? If so, I would suggest comparing the two builds by looking at
    1) the CCS build console for both builds (to see if the same set of files/options are being passed in both cases)
    2) the link map file (.map) generated by both builds to see where the code size differences are coming from

    If after analyzing these you still need assistance from us, please post both link map files and the build logs for us to take a look at.

  • Okay so I created a new project using the same settings and with compiler v4.2.2. I compared the linker file generated with one in another project and they are exactly the same.

    One thing I noticed is that when I compile the same project with the two compiler versions, the result in the Memory Allocation tab is different. In the 4.2.2 compile, the INT0,1,2, etc. lines go away. See images below.

    Linker cmd file:

    /****************************************************************************/
    /* SPECIFY THE SYSTEM MEMORY MAP                                            */
    /****************************************************************************/
    
    MEMORY
    {
        SFR                     : origin = 0x0000, length = 0x0010
        PERIPHERALS_8BIT        : origin = 0x0010, length = 0x00F0
        PERIPHERALS_16BIT       : origin = 0x0100, length = 0x0100
        RAM                     : origin = 0x0200, length = 0x0200
        INFOA                   : origin = 0x10C0, length = 0x0040
        INFOB                   : origin = 0x1080, length = 0x0040
        INFOC                   : origin = 0x1040, length = 0x0040
        INFOD                   : origin = 0x1000, length = 0x0040
        FLASH                   : origin = 0xC000, length = 0x3FE0
        INT00                   : origin = 0xFFE0, length = 0x0002
        INT01                   : origin = 0xFFE2, length = 0x0002
        INT02                   : origin = 0xFFE4, length = 0x0002
        INT03                   : origin = 0xFFE6, length = 0x0002
        INT04                   : origin = 0xFFE8, length = 0x0002
        INT05                   : origin = 0xFFEA, length = 0x0002
        INT06                   : origin = 0xFFEC, length = 0x0002
        INT07                   : origin = 0xFFEE, length = 0x0002
        INT08                   : origin = 0xFFF0, length = 0x0002
        INT09                   : origin = 0xFFF2, length = 0x0002
        INT10                   : origin = 0xFFF4, length = 0x0002
        INT11                   : origin = 0xFFF6, length = 0x0002
        INT12                   : origin = 0xFFF8, length = 0x0002
        INT13                   : origin = 0xFFFA, length = 0x0002
        INT14                   : 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             */
    
        .text       : {} > FLASH              /* CODE                              */
        .cinit      : {} > FLASH              /* INITIALIZATION TABLES             */
        .const      : {} > FLASH              /* CONSTANT DATA                     */
        .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
    
        /* MSP430 INTERRUPT VECTORS          */
        .int00       : {}               > INT00
        .int01       : {}               > INT01
        PORT1        : { * ( .int02 ) } > INT02 type = VECT_INIT
        PORT2        : { * ( .int03 ) } > INT03 type = VECT_INIT
        .int04       : {}               > INT04
        ADC10        : { * ( .int05 ) } > INT05 type = VECT_INIT
        .int06    	 : {} 				> INT06
        .int07       : {} 				> INT07
        TIMER0_A1    : { * ( .int08 ) } > INT08 type = VECT_INIT
        TIMER0_A0    : { * ( .int09 ) } > INT09 type = VECT_INIT
        .int10       : {} 				> INT10
        .int11       : {} 				> INT11
        .int12       : {} 				> INT12
        .int13       : {} 				> INT13
        .int14       : {} 				> INT14
        .reset       : {}               > RESET  /* MSP430 RESET VECTOR         */
    }
    
    /****************************************************************************/
    /* INCLUDE PERIPHERALS MEMORY MAP                                           */
    /****************************************************************************/
    
    -l msp430g2553.cmd
    
  • Scott,

    Sorry about the delayed reply on this issue. If you are still experiencing this problem, could you please attach the project here so we can try compiling it with different versions of the compiler tools and see where/why the differences appear? If you are unable to share the project, we would need to at least take a look at the linker command files used in both builds, link map files generated by both builds, and also the build output in the CCS build console.