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.

I am using MSP430FR6989. With Code Composer V6.1.1. I cannot get the MSPMATHLIB to work.

Other Parts Discussed in Thread: MSP430FR6989, MSPMATHLIB

I am using MSP430FR6989. With Code Composer V6.1.1. How can I get the MSPMATHLIB to work. I have followed instructions from SLAU499 to ADD "MSPMATHLIB_CCS_msp430_5xx_6xx_FRxx_small_code_small_dada.lib" into Project Explorer and replace <math.h> with "msp430_math.h".

But "msp430_math.h" is not found by the linker.

Where Can I find the user guide of MSPMATLIB?

Thanks

  • Wing,

    I have attached a link to the CCS v6.1 for MSP430 User's Guide below:

    www.ti.com/.../slau157al.pdf

    Section 2.1.3 has some steps for enabling the use of MSPMathLib. Go through these and see if it helps link the files!

    Best regards,
    Michael Arriete
  • Code Composer user guide section 2.1.3 instructs:

    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.

    Within MSP430Linker there is no Search Path that allow us to inlude library command.

    Inside MSP430 Linker window : We see configuration, command, and command-line pattern, and Summary Of flags set.

    Where do I include libmath.a 

    Please help

  • Hi Wing,

    Please expand the drop down menu to see the option for File Search Path. Once you have opened File Search Path you should be able to add libmath.a to the section "Include library file or command file as input (--library, -l)." Please make sure that you move libmath.a above all other libraries listed here.

    Below are some screenshots:

  • I have to add #include<math.h> to the main C source code to get line 11 to compiler correctly.

    I am not sure whether math.h is the correct file to include.

    Thanks for your help.

    include <stdio.h>
    #include <msp430FR6989.h>
    #include <math.h>
    /*
    * hello.c
    */
    float result;
    int main(void) {
    PM5CTL0 &=~LOCKLPM5;
    WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
    result = exp(1);// seem working but not sure whether this is from MSPMATLIB
    printf("Hello World!\n");//This is working
    printf("float %f\n",result);//No value has printed out
    printf("float exp %e\n",result);//No value has printed out
    printf("float %g\n",result);//No value has printed out
    printf("float exp %G\n",result);//No value has printed out
    printf(" integer %d\n",(int)result);//Correct. 2 was printed

    return 0;
    }

    //display show at console

    Hello World!
    float
    float exp
    float
    float exp
    integer 2

  • Have you tried including "msp430_math.h" instead of the regular "math.h"?

    - Michael Arriete
  • If I include <msp430_math.h> instead of the regular <math.h> to got error in building the project as follow.
    "../hello.c", line 3: fatal error #1965: cannot open source file "msp430_math.h"
    I has tried <msp430math.h> , it did not work.
    Although <math.h> work when compiled. But it does not appear any speed improvement.
    Thanks
  • I apologize for not catching this sooner.. But it seems that you are using CCS V6.1.1. If you refer to the CCS v6.1 for MSP430 User's Guide Section 2.1.3, TI's MSPMathlib is part of CCSv5.5 and newer releases. This means that the math.h already includes all the declarations and speed improvements you are looking to gain from msp430_math.h.

    The reason that you are not seeing the values in console might be because you have not enabled full printf support in your Project Properties. Under Project Properties -> Build -> MSP430 Compiler -> Advanced Options -> Library Function Assumptions, change the level of printf support to full.

    Best regards,
    Michael Arriete

**Attention** This is a public forum