Part Number: TMS320C6655
Tool/software: TI C/C++ Compiler
Using C6000_8.3.3 as compiler, I have a problem with printing float values in Log_printf2. If first value is not a float, and the second value is a float, the following call:
Log_printf2(TRACE_BUFFER, "Int1 = %d, Float2 = %f", integer_var, float_var);
generates this output: " Int1 = 112, Float2 = -0.000002"
If the first parameter is a float, the float value is printed correct, but the second parameter is printed as random values (same value, though). It hence looks like a problem with the size of floats in memory.
In description of module xdc.runtime.Log the description states:
The %f format specifier is used to print a single precision float value. Note that %f assumes that sizeof(Float) <= sizeof(IArg). Most clients that interpret float values expect that they are represented in IEEE 754 floating point format. Therefore, it is recommended that the float values be converted into that format prior to supplying the values to Log functions in cases where targets do not generate the float values in IEEE 754 floating point format by default.
I hence tried to
Log_printf2(TRACE_BUFFER, "Float1 = %f, Float2 = %f", floatToArg(111.222), floatToArg(333.444));
which resulted in:
Float1 = 14422259099496722221374511718750000000000000000000000000000000000000000.000000, Float2 = -0.000002
So the floatToArg doesn't solve the problem - it makes it worse.....
Is anybody able to help?