S32K3 SPD FCCU initialization

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

S32K3 SPD FCCU initialization

Jump to solution
530 Views
jinjingyang
NXP Employee
NXP Employee

Hello, sir, I'm trying to integrate S32K3 SPD into an example.

I configure FCCU NCF1 fault as "Reset Reaction", Timeout disable, Alarm state disable.

So once this fault detected, the MCU enters fault state, namely triggers FCCU FUNC reset immediately.

Then MCU start again from startup code and enters main function and run the MCU initialization again.

Here I use the function "eMcem_InjectFault" to inject FCCU NCF1 fault.

The problem is that I cannot use the function "eMcem_GetErrors" to read the fault that caused previous FCCU FUNC reset. It looks like the function "eMcem_GetErrors" will not return any faults if no DCM faults flags are set but only FCCU NCF_S0 is set. Am I correct on understanding of the function ""eMcem_GetErrors""? Is it correct method to using function "eMcem_GetErrors" before calling "eMcem_Init"?

And could you please advise a suitable method to inject fault of FCCU NCF1 fault that allows me to use the function "eMcem_GetErrors" to get the fault information?

As for the function "eMcem_Init", is it suitable to call it before MCU clock initialization or after it or either is OK?

Regards,
Jason Yang

0 Kudos
1 Solution
509 Views
martinkaspar-r3
NXP Employee
NXP Employee

I tried to inject a fault with the function "eMcem_InjectFault (nFault_Id)", and found that it just get the NCF_ID and inject fault at FCCU. So this function just inject fault at the group level and it doesn't inject a specific fault. It looks like the "eMcem_InjectFault" function can inject specific fault that is included in eMcem_EIM but it cannot inject specific fault included in eMcem_DCM faults. Is it true?

Exactly. There is no register for DCM to inject a fake fault so this information about injected faults for DCM is managed internally via some helper variables. When injecting a fault, the helper variable for DCM will be set together with related FCCU 'group' fault.

 

As for the eMcem_Init() function, what is the suitable position to call this function during MCU initialization? Should I call it before or after the IntCtrl initialization (ISR settings and interrupts enable)? And should I call it before or after the peripherals initialization?

The eMCEM is mainly dependent on the interrupts so it shall be definitely called after IntCtrl initialization and probably even after the peripherals are initialized. Only thing is that FCCU alarm interrupt shall be enabled after the eMCEM has been initialized. You can check the demo application for the initialization steps.

 

I tried to verify the INTM faults monitoring. The FCCU NCF6 fault is configured as no reset reaction, Alarm and timeout enable, NMI enable. When INTM error occurs, I think the CPU should first run eMcemUserAlarmHandler. If alarm state timeout, it enters NMI notification. But actually the MCU goes to NMI notification directly when INTM error occurs. Is this expected behaviour?

This is not expected behaviour. The problem could be short alarm state timeout configured or improperly configured/enabled FCCU alarm interrupt.

View solution in original post

0 Kudos
3 Replies
524 Views
martinkaspar-r3
NXP Employee
NXP Employee

Hello,

On S32K3, the FCCU faults are just fault groups rather than just single faults. Each of the 8 fault groups (NCFs) consist of several DCM faults. So there is a group configuration, but the specific faults are defined and configured within these groups. When you are injecting a fault or retrieving info about it, you shall use the DCM faults (defines).

This fault list is mentioned in the eMCEM module user manual (Table 60 - Fault List). These DCM status fault flags are then masked by the related NCF status flag (parent FCCU group). So if you are about to inject a fault into NCF1 - you shall pick any of the DCM faults related to this fault group (define name contains ...DCM_NCF_1...).

Even though the FCCU flags stay up after reset, the DCM is probably being reset, therefore no signaling of fault when using eMcem_GetErrors API function.

If you would like to get to know which NCF flag is up, you would need to manually read the FCCU.NCF_S register.

0 Kudos
522 Views
jinjingyang
NXP Employee
NXP Employee

Hello, Martin,

Thank you. The "Table 60 Fault List" in eMcem user manual is very helpful.

I tried to inject a fault with the function "eMcem_InjectFault (nFault_Id)", and found that it just get the NCF_ID and inject fault at FCCU. So this function just inject fault at the group level and it doesn't inject a specific fault. It looks like the "eMcem_InjectFault" function can inject specific fault that is included in eMcem_EIM but it cannot inject specific fault included in eMcem_DCM faults. Is it true?

As for the eMcem_Init() function, what is the suitable position to call this function during MCU initialization?
Should I call it before or after the IntCtrl initialization (ISR settings and interrupts enable)?
And should I call it before or after the peripherals initialization?

I tried to verify the INTM faults monitoring. The FCCU NCF6 fault is configured as no reset reaction, Alarm and timeout enable, NMI enable. When INTM error occurs, I think the CPU should first run eMcemUserAlarmHandler. If alarm state timeout, it enters NMI notification. But actually the MCU goes to NMI notification directly when INTM error occurs. Is this expected behaviour?

 

0 Kudos
510 Views
martinkaspar-r3
NXP Employee
NXP Employee

I tried to inject a fault with the function "eMcem_InjectFault (nFault_Id)", and found that it just get the NCF_ID and inject fault at FCCU. So this function just inject fault at the group level and it doesn't inject a specific fault. It looks like the "eMcem_InjectFault" function can inject specific fault that is included in eMcem_EIM but it cannot inject specific fault included in eMcem_DCM faults. Is it true?

Exactly. There is no register for DCM to inject a fake fault so this information about injected faults for DCM is managed internally via some helper variables. When injecting a fault, the helper variable for DCM will be set together with related FCCU 'group' fault.

 

As for the eMcem_Init() function, what is the suitable position to call this function during MCU initialization? Should I call it before or after the IntCtrl initialization (ISR settings and interrupts enable)? And should I call it before or after the peripherals initialization?

The eMCEM is mainly dependent on the interrupts so it shall be definitely called after IntCtrl initialization and probably even after the peripherals are initialized. Only thing is that FCCU alarm interrupt shall be enabled after the eMCEM has been initialized. You can check the demo application for the initialization steps.

 

I tried to verify the INTM faults monitoring. The FCCU NCF6 fault is configured as no reset reaction, Alarm and timeout enable, NMI enable. When INTM error occurs, I think the CPU should first run eMcemUserAlarmHandler. If alarm state timeout, it enters NMI notification. But actually the MCU goes to NMI notification directly when INTM error occurs. Is this expected behaviour?

This is not expected behaviour. The problem could be short alarm state timeout configured or improperly configured/enabled FCCU alarm interrupt.

0 Kudos