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/TMS320C6748: Problem in using Mathlib function

Part Number: TMS320C6748
Other Parts Discussed in Thread: MATHLIB, TEST2

Tool/software: Code Composer Studio

Hello,

I am having a problem in using mathlib functions in my standalone project. I am using C6748 core and using mathlib_c674x_3_1_2_1. Now when i use the standard demo projects for example log2sp_674LE_LE_ELF and use the following lines 

double test1,test2,test3;

test1 = log2sp (8.5);
test2 = log2sp_c (8.5);
test3 = log2sp_i (8.5);

this gives me accurate result but when i move to my standalone project and use the same lines

double test1,test2,test3;

test1 = log2sp (8.5);

the result i get is test1 =  3.405775e+09. Same thing happen when i use any other mathlib functions.

In my standalone project i have added lib in cmd file as -l ../DSP_lib/mathlib.lib where DSP_lib is a folder in my workspace containing mathlib.lib and mathlib.ae674

Also i am using C6000 compiler version 8.3.3 for both demo and my standalone project.

The rest of the setting for my project are:

"C:/ti_ccsv5.5/ccsv5/tools/compiler/ti-cgt-c6000_8.3.3/bin/cl6x" -mv6740 --abi=eabi --include_path="C:/ti_ccsv5.5/ccsv5/tools/compiler/ti-cgt-c6000_8.3.3/include" --define=c6748 -g --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="main.pp"  "../main.c"

'Invoking: C6000 Linker'
"C:/ti_ccsv5.5/ccsv5/tools/compiler/ti-cgt-c6000_8.3.3/bin/cl6x" -mv6740 --abi=eabi --define=c6748 -g --diag_warning=225 --diag_wrap=off --display_error_number -z -m"DETC.map" --heap_size=0x800 --stack_size=0x800 -i"C:/ti_ccsv5.5/ccsv5/tools/compiler/ti-cgt-c6000_8.3.3/lib" -i"C:/ti_ccsv5.5/ccsv5/tools/compiler/ti-cgt-c6000_8.3.3/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="DETC_linkInfo.xml" --rom_model -o "DETC.out" "./mb79_core1_data.obj" "./main.obj" "./DETC_SimoProcessing.obj" "./DETC_PeaksAboveCfarThreshold.obj" "./DETC_MimoProcessing.obj" "./DETC_HighPeakRemoval.obj" "./DETC.obj" "../C6748.cmd" "../DSP_lib/dsplib.lib" "../DSP_lib/dsplib_cn.lib" "../DSP_lib/mathlib.lib" -l"libc.a"

Also while compiling my file i see a warning ""../main.c", line 10: warning #225-D: function "log2sp" declared implicitly" even though i have included c6x.h.

Can somebody tell me what i am doing wrong

Thanks for yours help

  • Hello, 

    Deepak Joshi said:
    Also while compiling my file i see a warning ""../main.c", line 10: warning #225-D: function "log2sp" declared implicitly" even though i have included c6x.h.

    You need to include a header file for your mathlib library. 
    Right now, the compiler assumes that your function takes int and returns int. 

    According to your manual: mathlib_c674x_3_1_2_1/docs/doxygen/html/index.html

    Add MATHLIB API Calls

    Add calls to MATHLIB kernels within the system source code as necessary. Any system source file that contains calls to an MATHLIB kernel will require that the MATHLIB header file mathlib.h is included