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.

including msp430 mathlib library into project.

Other Parts Discussed in Thread: MSP430FR5739, MSPMATHLIB, MATHLIB

Hello,

I am using code composer studio 6 and I want to use trigonometric and inverse trigonometric function in my project. Controller - MSP430FR5739

I want to use MSP430 floating point library, so I included msp430_math.h header but I am not able to compile.

I am getting the following error 

**** Build of configuration Debug for project math_test_math ****

"c:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
'Building file: ../main.c'
'Invoking: MSP430 Compiler'
"c:/ti/ccsv6/tools/compiler/msp430_4.3.1/bin/cl430" -vmspx --abi=eabi --code_model=small --data_model=small --include_path="c:/ti/ccsv6/ccs_base/msp430/include" --include_path="C:/ti/ccsv6/ccs_base/msp430/lib/5xx_6xx_FRxx" --include_path="c:/ti/ccsv6/tools/compiler/msp430_4.3.1/include" --advice:power="all" -g --define=__MSP430FR5739__ --diag_warning=225 --display_error_number --diag_wrap=off --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --printf_support=minimal --preproc_with_compile --preproc_dependency="main.pp" "../main.c"
"../main.c", line 2: fatal error #1965: cannot open source file "msp430_math.h"

1 catastrophic error detected in the compilation of "../main.c".
>> Compilation failure
Compilation terminated.
gmake: *** [main.obj] Error 1
gmake: Target `all' not remade because of errors.

- I have tried to compile in CCS v5 also but no luck. 

- libmath.a is included in the "include library file or command file as input(--library,-l)" tab in properties 

Please let me know if any specific setting are to be done in order to compile.

Thank you very much :-)

Regards,

Pradeep

 

  • http://www.ti.com/lit/ug/slau499/slau499.pdf

  • I had already tried all the steps mentioned in this pdf file.. 

    Still no luck in compiling  :-(

    Any other suggestions..?

  • I found the problem why I am not able to compile. The header file "msp430_math.h" is missing.

    As per the Installation guide of CCS V6, the msp430_math library comes preinstalled.

    I dont know how the msp430_math.h header file is missing. I searched my complete hard disk.

    Could any body help me in getting this header file or give me a link where I can download the complete library. The link in TI website points to the latest version of CCS to download, but not to msp430_math library.

    Thanks..

  • Pradeep Patil3 said:
    I found the problem why I am not able to compile. The header file "msp430_math.h" is missing.

    Well, that's exactly what the compiler error was telling you. :)

    Pradeep Patil3 said:
    I dont know how the msp430_math.h header file is missing. I searched my complete hard disk.

    I remember a similar thread not long ago. If you use the forum search /e.g. search for "msp430_math.h"), you should be able to find it.

    Edit: you apparently already discovered the thread I mentioned: http://e2e.ti.com/support/microcontrollers/msp430/f/166/t/323323.aspx

  • Hi everybody,

    I can confirm the msp430_math.h header file doesn't exist in the current installation.

    As described in the slau499 all

    #include <math.h>

    should be substituted by

    #include <msp430_math.h>

    but the msp430_math.h header file which should be part of the MSPMATHLIB library doesn't exist.

    So, please could someone explain where to find it ?

    Best Regards,

    Luigi

  • Hi Luigi,

    I believe in CCS v6.0, the MSPMATHLIB is the default math library for MSP430, so you basically need to do nothing, as the CCS will directly use the MSPMATHLIB as its math library. The app note was written in the time where the MSP430 compiler has its own math library, and we released the MSPMATHLIB.

  • Hi Leo,
    thanks for your feedback.
    In this case i think someone should make a revision of the slau499, because the actual content is misleading.

    Another question is if someone are using the previous version of CCS, how can the library be installed and used ?
    I say this because i cannot find a standalone installer of the library, and i think the msp430_math.h header should be used with the previous version of CCS, is it ?

    Best Regards,
    Luigi

  • Luigi,

    this is documented in: http://www.ti.com/lit/ug/slau157ad/slau157ad.pdf - chapter 2.1.3 "Using Math Library for MSP430 (MSPMathlib) in CCS v5.5 and Newer"

    2.1.3 Using Math Library for MSP430 (MSPMathlib) in CCS v5.5 and Newer
    TI's MSPMathlib is part of CCSv5.5 and newer releases. This optimized library provides up to 26x better performance in applications that use floating point scalar math. For details, see the MSPMathlib web page (http://www.ti.com/tool/mspmathlib).

    MSPMathlib is active by default in CCSv5.5+ for all new projects on all supported devices. For imported projects, it is used only if the project already uses MSPMathlib or if it has been manually enabled.

    To disable MSPMathlib: Remove libmath.a under Project → Properties → Build → MSP430 Linker → File Search Path in the "Include library file or command file as input (--library, -l)" field.

    To enable MSPMathlib: Add libmath.a under Project → Properties → Build → MSP430 Linker → File Search Path in the "Include library file or command file as input (--library, -l)" field. Important: Put libmath.a before other libraries that may be listed here.

  • Leo,

    thank you so much for your reference.

    Best Regards,

    Luigi

  • Hi Leo,
    i still have a question, if i want to use MSPMathlib ,i should include the header file "math.h", is that right?
  • originally, the optimized mathlib was separate from the default math code in the standard runtime library, so a different header file was needed to be included. Now it has replaced the original math code as default, and the usual math.h header file contains the required declarations.
    However, if you do not include "math.h", the compiler doesn't know that the math functions exist at all. So yes, you need to include it.

**Attention** This is a public forum