I have a simple C code which will update static variable with floating variable. Let's say I have
static float32 totalcount = 60.73f;
I want to know how to get float values from Lauterbach trace32. I have tried to print the float values using below t32api64.dll and ctype method.
error = ctypes.c_int32(0)
result = ctypes.c_float32(0)
t32api.T32_Cmd (b"InterCom mycore Var totalcount")
error = t32api.T32_EvalGet(ctypes.byref(result));
if (error == 0):
print("OK");
print (result.value)
else:
print("Nok error")
But I am getting some different ouputt.
Output:
$ python test.py
OK
8.96831017167883e-44
After some research, I understood that t32api.T32_EvalGet() function is not supporting float values. So I would like to know how to print the float values from trace32 using python. Please suggest some method to print float values?
You can either use
T32_ExecuteFunction_Double()orT32_EvalGetString():Example for
int T32_ExecuteFunction_Double(const char *pExpression, char *pBuffer, uint32_t BufferSize, double *pResult)Example for
int T32_ReadVariableString(const char *symbol, char *string, int maxlen)Example using the pyrcl package: