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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
819 次查看
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 项奖励
回复
1 解答
744 次查看
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 项奖励
回复
3 回复数
798 次查看
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 项奖励
回复
795 次查看
sona1
Contributor I

Yes I have added math.h 

0 项奖励
回复
745 次查看
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 项奖励
回复