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.

Cannot use math.h with CCS V5.1

Other Parts Discussed in Thread: MSP430F2012, MSP430G2553

Hi All,

I have a working code that used a function from math.h. The code was compiled by CCS V4.

However, I just updated CCS V4 to CCS V5.1 and recompiled the code.

With CCS V5.1, I got errors. One was error #10010: errors encountered during linking; "aaaaa.out" not built

Another one was error #10099-D: program will not fit into available memory.

I did not think the errors came from my code because the code worked with CCS V4. Also, if I commented the function from math.h out, I can compile the code.

I am wondering if anyone know how to setup CCS V5.1 to use math.h.

Thank you,

GP

  • Hi Gridsada,

    what target are you using?  What settings differences are there between v4 and v5?  (eg compiler version, heap/stack setup, linker command file, etc)  How did you import your project to v5?   What exact errors do you get?

    Best Regards,
    Lisa

  • Hi Lisa,

    I use MSP430g2553 with MSP-EXP430G2 LaunchPad and MSP430f2012 with USB eZ430-F2013. I also use the default setting of V4 and V5.

    I did not import my project to v5. I created a new project from v5 and edited my code.

    I think the errors came from the include files and lib files of v5 because when I added a function from math.h to a basic example code (Blink The LED) from CSS V5, I still got the errors, #10010: errors encountered during linking; "aaaaa.out" not built and error #10099-D: program will not fit into available memory.

    So, I tried to replace the include and lib folders of v5 with those of v4. Then, I recompiled the code. It seemed that the code worked and I did not get any error.

    I think it is not a good idea to replace the include and lib folders of v5. However, I don't know how to use math.h of v5.

    Do you have any idea how to use it?

    Thank you,

    GP

     

  • Hi Gridsada,

    how did you include math.h?  Ie what exactly are you doing in the project?  When it compiles, exactly what did you redirect/change to the v4 install tree?

    Best Regards,
    Lisa

  • Hi Lisa,

    This is my code.

    #include <msp430.h>
    #include <math.h>

    int main(void)
    {
      WDTCTL = WDTPW + WDTHOLD;             // Stop watchdog timer

      float p = exp(0);

      P1DIR |= 0x01;                        // Set P1.0 to output direction

      for (;;)
      {
        volatile unsigned int i;            // volatile to prevent optimization

        P1OUT ^= 0x01;                      // Toggle P1.0 using exclusive-OR

        i = 10000;                          // SW Delay
        do i--;
        while (i != 0);
      }
    }

    I add the line, float p = exp(0);. I tried to use an exp() function for my code.

    The math.h and lib are in "${CG_TOOL_ROOT}/include" and "${CG_TOOL_ROOT}/lib". I copied  files from the include and lib folders of V4 and replaced them in the include and lib folders of V5. (My computer has only CCS V5. I copied the files from another PC.)

    Thank you,

    GP

  • Hi Gridsada,

    ok, let me see if I can get some feedback from the compiler team as to what might have caused this difference between the two versions.

    Can you please check which compiler/code generation tool version was used in each case?  We have seen the newer compiler versions creating larger code sizes for some MSPs (due at least in large part to settings).

    Best Regards,
    Lisa

  • Hello Lisa,

    The compiler for CCS v5 is TI V4.0.0

    The compiler for CCS v4 is 3.2.1.

    Thank you,

    GP

  • Hi Gridsada,

    I have found out that this is a known issue that has been filed for fixing.

    There are a couple options for you

    One is to install and use version 3.2.1 as before in v5.  This is what is recommended for now and the steps are

    1 - check whether v5 already has this version.  You can do this under Window->PReferences->Code Composer Studio->Buikld->Code Generation Tools.

    2 - If it is there then please see if you can select it in your project options or retry selecting this version when you create the project

    3 - If it is not you can point CCS to your 3.2.1 from v4 (perfectly fine to do) and install it under Window->PReferences->Code Composer Studio->Buikld->Code Generation Tools.

    The second method is a workaround of modifying math.h and rebuilding the runtime library. It is mentioned in the post below. But in my opinion,  the easier solution would be to use the older version of CGT for now rather than go down the path of learning how to rebuild the lib

     

    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/145713/577649.aspx#577649

    Please keep us informed how the above goes.

    Best Regards,

    Lisa

  • Dear Lisa,

    I've have the same problem and have applied the fix stated above with no luck. The link to rebuild the runtime library is dead. I was wondering if there is another fix or you could assist me with the problem. 

    Regards,

    -Sean