Floating-Point Assist Exception in MPC555

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Floating-Point Assist Exception in MPC555

496件の閲覧回数
GuYuXiang
Contributor I
We encountered an issue where a floating-point exception caused the program to freeze during programming. According to the MPC555 data sheet, this might be triggered by a floating-point assist exception, but we are unsure how to handle such an exception. Specifically, we want to know:
  1. Does the floating-point assist exception require writing an interrupt service routine (ISR) to clear the exception flag, similar to other interrupts?
  2. Are there any example routines for handling floating-point assist exceptions on MPC555?
Currently, we have temporarily mitigated the issue by enabling Non-IEEE mode and disabling floating-point exception enable as suggested in the manual. However, we need a proper solution to handle these exceptions rather than just disabling them.
Could any engineers provide guidance or example code for handling floating-point assist exceptions on MPC555, particularly regarding flag clearing and ISR implementation?
0 件の賞賛
返信
2 返答(返信)

470件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @GuYuXiang 

It is possible to write a software wrapper to handle full IEEE floating point operation and the FPU in the MPC500 parts works exactly as they are supposed to work. It is not an easy task to write the wrapper however. For vast majority of applications that the MPC500 parts were designed for, the non-IEEE mode is sufficient. Copied from RCPU reference manual:

“3.4.4 Working Without the Software Envelope

Even when the processor is operating in non-IEEE mode, the software envelope may be invoked when denormalized numbers are used as the input to the calculation or when an enabled IEEE exception is detected. To ensure that the software envelope is never invoked, the user needs to do the following:

  • Set the NI bit in the FPSCR to enable non-IEEE mode.
  • Disable all floating-point exceptions.
  • Avoid using denormalized numbers as inputs to floating-point calculations.”

It’s responsibility of user to clear all the flags in the wrapper.

We do not have SW example for the wrapper.

Regards,

Lukas

0 件の賞賛
返信

443件の閲覧回数
GuYuXiang
Contributor I

Hi, @lukaszadrapa 

Thank you for your response. The Non-IEEE mode does meet our requirements, but the MPC555 still crashes when dealing with denormalized numbers. Therefore, I'd like to attempt writing a floating-point assist function to clear the exception flags. Currently, I'm using the following code for testing, but there's no printed information. Could you please check if there's an issue with my code and suggest how to fix it?

Thank you

In the `eppc_exception.asm` file:

.org 0xE00
IntPrologue
li r3,0x0E00
lis r4,FP_Assist_handler@h
ori r4,r4,FP_Assist_handler@l
mtlr r4
blrl
epilogue

In other C language files: 

void FP_Assist_handler(long a) {
    printf("enter FP Assist\r\n");
}

 

0 件の賞賛
返信