Other Parts Discussed in Thread: MATHLIB
When we use the functions sin(x) or cos(x) we sometimes get faulty results. It usually works when we only use one sin(x) and one cos(x) function, but if we also add e.g. a tan(x) and a acos(x) function to the program, the sin(x) and cos(x) returns faulty values. With input 0.5235988, the sin(x) function returns 0.5235988 and the cos(x) function returns 1.0, which obviously is faulty.
We are using c6000_7.4.1 version of CCS to produce the executable code.
The relevant code simply looks like this:
#include "C:\TI\ccsv5\tools\compiler\c6000_7.4.1\include\math.h"
float ARG_IN, SIN_OUT, COS_OUT, TAN_OUT, ACOS_OUT;
TAN_OUT = tan( ARG_IN );
ACOS_OUT = acos( ARG_IN );
SIN_OUT = sin( ARG_IN );
COS_OUT = cos( ARG_IN );
These are the libraries we link in. I don't know which of them contains the math functions:
INCLUDE_LIB_PATHS = \
-i"C:/TI/ccsv5/tools/compiler/c6000_7.4.1/lib" \
-i"C:/TI/ccsv5/tools/compiler/c6000_7.4.1/include" \
-i"C:/TI/pdk_C6678_1_1_2_5/packages/ti/platform/evmc6678l/platform_lib/lib/debug" \
-i"C:/TI/pdk_C6678_1_1_2_5/packages/ti/csl/lib"
-l"ti.platform.evm6678l.ae66" \
-l"ti.csl.ae66" \
-l"ti.csl.intc.ae66" \
-l"libc.a" \
Compiler switches are:
GENERAL_OPTIONS = -mv6600 --symdebug:none -O3 -ms0 -mf5 --asm_listing --src_interlist --optimizer_interlist --display_error_number --diag_suppress=552 --diag_warning=225 --abi=eabi
Compilation command:
$(COMPILER) $(GENERAL_OPTIONS) -z -m"DSP3.map" --warn_sections $(INCLUDE_LIB_PATHS) --reread_libs --rom_model -o"DSP3.out" $(ORDERED_OBJS)
Has anyone experienced similar problems?