Using AMCLIB / GFLIB into an ISR

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

Using AMCLIB / GFLIB into an ISR

835 Views
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 Replies

731 Views
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

731 Views
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 Kudos