Using AMCLIB / GFLIB into an ISR

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

Using AMCLIB / GFLIB into an ISR

1,032 次查看
robert_metzerot
Contributor II

Hello,

 

 i use MPC5777C with S32-studio.

 

I tried to multiply in an ISR. If i call for example the function MLIB_Mul(FRAC32(0.185), FRAC32(0.195), F32), an IVOR1-exception occurs.

Then i tried the function  MLIB_Abs() within this ISR. Its output result is the same as input (negative sign) - not ok.

 

In any loop, which is called from the main loop, all this functions works fine. Only in any ISR is no function.

 

Can you give support?

 

Thank you,

Robert.

2 回复数

928 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I'm not AMMCLIB expert, I have just one general idea which sometimes causes troubles:

When IVOR4 is entered, FP and SPE bits in MSR register are automatically cleared. If user wants to use FP or SPE instructions, it must be enabled by the software again. For example:

void SPE_enable(void)

{

  mfmsr r3

  e_add2is r3,0x0200

  mtmsr r3

}

Maybe this could help.

Regards,

Lukas

928 次查看
petrz_
NXP Employee
NXP Employee

Indeed, the MLIB_Mul_F32 function on MPC5777C uses the evmwhsmf SPE instruction so the SPE unit must be enabled for it to work.

Regards,

Petr

0 项奖励
回复