s32k144 when math.h is included while debugging getting the error for acos function

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

s32k144 when math.h is included while debugging getting the error for acos function

Jump to solution
814 Views
sona1
Contributor I

I am using s32k144 i am getting this error

Multiple errors reported.

1) Unable to create variable object

2) Failed to execute MI command:
-var-create - * "(float)((i_alpha * acos((double)theta_elec)) + (i_beta * asin((double)theta_elec)))"
Error message from debugger back end:
'acos' has unknown return type; cast the call to its declared return type

3) Failed to execute MI command:
-data-evaluate-expression "(float)((i_alpha * acos((double)theta_elec)) + (i_beta * asin((double)theta_elec)))"
Error message from debugger back end:
'acos' has unknown return type; cast the call to its declared return type

4) Failed to execute MI command:
-var-create - * "(float)((i_alpha * acos((double)theta_elec)) + (i_beta * asin((double)theta_elec)))"
Error message from debugger back end:
'acos' has unknown return type; cast the call to its declared return type

0 Kudos
Reply
1 Solution
739 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @sona1 

Try just casting the call to the proper return type. 

The debugger requires some information before calling the functions if you call a function that returns a value, but generates code as though the function returned a scalar value, calling the function will corrupt the stack of the thread on which the function was called, ruining your debug session.

View solution in original post

0 Kudos
Reply
3 Replies
793 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @sona1 

Did you already add the math library in the Project Settings? Check the following thread. It has information related to the topic. 

atan2f in math.h with S32DS S32K144

 

B.R.

VaneB

0 Kudos
Reply
790 Views
sona1
Contributor I

Yes I have added math.h 

0 Kudos
Reply
740 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @sona1 

Try just casting the call to the proper return type. 

The debugger requires some information before calling the functions if you call a function that returns a value, but generates code as though the function returned a scalar value, calling the function will corrupt the stack of the thread on which the function was called, ruining your debug session.

0 Kudos
Reply