Issue using MLIB 4.2 with DSP 56800EX

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

Issue using MLIB 4.2 with DSP 56800EX

1,340 次查看
plinioandrade
Contributor I

I'm using the FSLESL library Rev. 4.2 with micro MC56F84452 (56800EX core) and I'm having a very intriguing issue when I try to put some math operation in the same line of code as in here:

code1.PNG

After line 792 is executed the value of park1.Ds is wrongly defined to -1056178177. However, if I separate the operation in three steps (multiply, multiply, then sum) as lines 793-795 show, the value of park1.Ds after line 795 is executed is 49419 which is the expected value:

code2.PNG

Does anyone have a good explanation for this behavior?

Sincerely,

标签 (1)
标记 (4)
0 项奖励
4 回复数

1,167 次查看
sutter_zhou
NXP Employee
NXP Employee

Hi Plinio,

What is the version of the CodeWarrior you are using? Is it possible to attach a simple project which can reproduce this issue? 

0 项奖励

1,167 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Plinio,

Regarding your question, I have checked that the 49419 in decimal is 0xC10B, the -1056178177 in decimal is 0x3EF4 0001, the 0xC10B is complementary of 0x3EF4. So they are the same value with different format.

Pls check the variable type of the park1.Ds  variable.

BR

XiangJun Rong

0 项奖励

1,167 次查看
plinioandrade
Contributor I

XiangJun,

Very interesting points. However, it's still hard to understand why the same logic works when it's executed line by line. If I use the function MLIB_Mul_A32 instead of MLIB_MulSat_A32 it works just fine.

Anyways, park1.Ds is a acc32_t variable just like a and b.

Sincerely,

0 项奖励

1,167 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Plinio,

I suggest you use Hex format to display the variable, then check what  the difference is.

BR

Xiangjun Rong

0 项奖励