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.

CCS/K2GICE: MATHLIB usage

Part Number: K2GICE

Tool/software: Code Composer Studio

Hi

I have following code and i have following problem with using MATHLIB. What could be causing the error.

#10010 null: errors encountered during linking; "from_empty_dsp.out" not built	from_empty_dsp		 	C/C++ Problem
<a href="processors.wiki.ti.com/.../10234">  null: unresolved symbols remain	from_empty_dsp		 	C/C++ Problem
gmake: *** [all] Error 2	from_empty_dsp		 	C/C++ Problem
gmake[1]: *** [from_empty_dsp.out] Error 1	from_empty_dsp		 	C/C++ Problem
unresolved symbol cosdp, first referenced in ./main.obj	from_empty_dsp		 	C/C++ Problem
unresolved symbol sindp, first referenced in ./main.obj	from_empty_dsp		 	C/C++ Problem
unresolved symbol sqrtdp, first referenced in ./main.obj	from_empty_dsp		 	C/C++ Problem

#define SOC_K2G
#include <xdc/std.h>

#include <ti/drv/gpio/GPIO.h>
#include <ti/drv/gpio/soc/GPIO_soc.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>

#include <stdio.h>
#include <string.h>
#include "GPIO_board.h"
#include "ti/mathlib/mathlib.h"

volatile uint32_t gpio_intr_triggered = 0;
uint32_t gpioBaseAddr;
uint32_t gpioPin;

double           A = 1, B = -0.5, C = -0.5;
double           theta = 1.570796327;
double           X = 0, Y = 0, Z = 0;
double           co = 0, si = 0;
double           D = 0, Q = 0;
double           i = 0;


static void Board_initGPIO(void)
{
    Board_initCfg boardCfg;

    GPIO_v0_HwAttrs gpio_cfg;

    /* Get the default SPI init configurations */
    GPIO_socGetInitCfg(GPIO_LED0_PORT_NUM, &gpio_cfg);
    GPIO_socGetInitCfg(GPIO_LED1_PORT_NUM, &gpio_cfg);

    /* Setup GPIO interrupt configurations */
    GPIO_socSetIntMux(GPIO_LED0_PORT_NUM, GPIO_LED0_PIN_NUM, NULL, GPIO_MUX_SEL);
    GPIO_socSetIntMux(GPIO_LED1_PORT_NUM, GPIO_LED1_PIN_NUM, NULL, GPIO_MUX_SEL);


    boardCfg = BOARD_INIT_PINMUX_CONFIG |
        BOARD_INIT_MODULE_CLOCK |
        BOARD_INIT_UART_STDIO;

    Board_init(boardCfg);

    /* Modify the default GPIO configurations if necessary */
}

/*
 *  ======== taskFxn ========
 */

void AppGpioCallbackFxn(void)
{

    /* Toggle LED1
    GPIO_toggle(USER_LED1);
    AppLoopDelay(DELAY_VALUE);
    gpio_intr_triggered = 1; */
}

void gpio_test(UArg arg0, UArg arg1)
{

    /* GPIO initialization */
    GPIO_init();

    /* Set the callback function */
    GPIO_setCallback(USER_LED0, AppGpioCallbackFxn);
    GPIO_setCallback(USER_LED1, AppGpioCallbackFxn);

    /* Enable GPIO interrupt on the specific gpio pin */
    GPIO_enableInt(USER_LED0);
    GPIO_enableInt(USER_LED1);



    while(1)
    {
        i = 0;

        while(i < 5000000) {
            X = (2*A - B - C)*(1/sqrtdp(6));
            Y = (B - C)*(1/sqrtdp(2));
            Z = (A + B + C)*(1/sqrtdp(3));

            co = cosdp(theta);
            si = sindp(theta);

            D = co*X + si*Y;
            Q = co*Y - si*X;
            i++;
        }

        GPIO_toggle(USER_LED0);
    }
}


/*
 *  ======== main ========
 */
Int main()
{
    Board_initGPIO();
    /* Start BIOS */
    BIOS_start();
    return (0);

}