Issue using MLIB 4.2 with DSP 56800EX

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

Issue using MLIB 4.2 with DSP 56800EX

1,321 Views
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,

Labels (1)
Tags (4)
0 Kudos
4 Replies

1,148 Views
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 Kudos

1,148 Views
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 Kudos

1,148 Views
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 Kudos

1,148 Views
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 Kudos