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.

MSP432E401Y: IQMath Library for MSP432 does not compile all math functions

Part Number: MSP432E401Y

i am using an MSP432 chip both the MSP432P401R or the MSP432E401Y with the Qmath and IQmath libraries.

I created a simple file with the Qmath functions which builds and works fine. When I convert the same file that used the Qmath functions to an IQmath version some of the math functions do not build.

#include "msp432.h"

#include <stdint.h>

#define PI      3.1415926536

/* Select the global Q value and include the Qmath header file. */
#define GLOBAL_IQ    11
#include "IQmathLib.h"

volatile float res;         // floating point variable to verify results
volatile float res2;         // floating point variable to verify results

int main(void)
{
    _iq qA, qB, qC, qD, qE;          // Q variables using global type

    WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD;     // stop watchdog timer

    /* Basic global Q operations. */
    qA = _IQ(1.0);
    qB = _IQ(2.5);
    qC = qA + qB;
    res=_IQtoF(qC);                // 3.5 = 1.0 + 2.5

    qD = _IQmpy4(qB);

    qE = _IQmpy(qA, qB);
    res2=_IQtoF(qE);          // 8.75 = 3.5 * 2.5


    while(1);
}

The IQmath function _IQmpy4(qB) builds and runs. However, the function to multiply two numbers _IQmpy(qA, qB) and the function to convert from a Qnumber format to floating _IQtoF(qC) do not build.

The console error shown is:

<Linking>

undefined first referenced
symbol in file
--------- ----------------
_IQ11mpy ./QmathLib_empty_ex1.obj
_IQ11toF ./QmathLib_empty_ex1.obj

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "IQmathLib_empty_ex1_MSP432.out" not built

>> Compilation failure

  • Hi John,

    Yes, I found the same.  I'll have to get with our QMath expert on this one.  In the mean time, you can use the precompiled libraries.  I did on your code and saw no errors.

    To test on your side, copy the IQmathLib_CCS_MSP432.lib to your projects top level directory (where you have your main.c) and change your project properties as follows:

  • Thanks using the precompiled libraries works. Is there any down side to using the precompiled libraries, instead of the uncompiled libraries?

  • No.  It's actually better because you don't have to take the extra time to re-compile these files each time in your project.  For now, I will go ahead and select this posting as resolved and you have up to 30 days to respond with additional information or relevant questions.  After which, the posting will be locked, but you can start a new posting and provide a link to the original post.