[MPC5748G] FCCU NCF Timeout

cancel
Showing results for 
Search instead for 
Did you mean: 

[MPC5748G] FCCU NCF Timeout

542 Views
travis_kuo
Contributor III

Hi,

I made some tests on FCCU with faked event sent with API below.

FCCU_DRV_SetNcfFake()

If I enable NCF timeout (reg NCF_TOE = 1) with timeout value 0 (NCF_TO = 0), MCU will switch to fault mode.

However, if I set timeout value to 1, it will never switch to fault mode.

May I know how to set the timeout value? 

PS: I use S32DS SDK.

pastedImage_1.png

Labels (1)
0 Kudos
8 Replies

185 Views
travis_kuo
Contributor III

Hi Peter,

Thanks for your quick reply. Both NCFE abd FCCU_NCF_TOE are enabled.

I just altered time out value in the S32DS fccu component. See my test example attached.

Press  SW2 on the EVB and it will send fake event.

If EVB doesn't halt, you will continue to get "continue" string in the serial console once SW2 is pressed.

The UART baud rate is 9600.

0 Kudos

185 Views
travis_kuo
Contributor III

Hi petervlna

Maybe would you please share an example for the NCF timeout?

0 Kudos

185 Views
petervlna
NXP Employee
NXP Employee

Hi,

It is already posted here :

https://community.nxp.com/docs/DOC-329719 

Peter

0 Kudos

185 Views
travis_kuo
Contributor III

Hi petervlna

I already checked this example. The NCF timeout is enabled but the timeout value is not set.

Would you please share a working example with NCF timeout value is specified?

I cannot make it work and suspect it a silicon bug.

0 Kudos

185 Views
petervlna
NXP Employee
NXP Employee

Hi,

Nah, there is no silicon bug.

I do not have time to make such example now.

Here is the correct configuration from example I have posted with AN. The timeout value is set to max. You should set it to for example 0x1000. have in mind that it must be less then FOSU counter. Otherwise FOSU will trigger destructive reset on its counter expire if no action is taken in fault state.

void FCCU_CONFIG (void)
{
  /* Unlock configuration */
  FCCU.TRANS_LOCK.R = 0xBC;  

  /* provide Config state key */
  FCCU.CTRLK.R = 0x913756AF;        //key for OP1
 
  /* enter config state - OP1 */
  FCCU.CTRL.R = 0x1;            //set OP1 - set up FCCU into the CONFIG
  /* wait for successful state transition */
  while (FCCU.CTRL.B.OPS != 0x3);    //operation status succesful

  /* FCCU moves into the ALARM state if the respective fault is enabled */
  FCCU.NCF_TOE[0].R = 0xFFFFFFFF;    //ALARM Timeout Enable
 
  FCCU.NCF_E[0].B.NCFE7 = 0x1;        //Enable reaction on fault NCF[7]

  FCCU.IRQ_ALARM_EN[0].R = 0x80;    //Enable ALARM interrupt on fault NCF[7]
 
  /* set up the NOMAL mode of FCCU */
  FCCU.CTRLK.R = 0x825A132B;        //key for OP2    
  FCCU.CTRL.R = 0x2;            //set the OP2 - set up FCCU into the NORMAL mode
  while (FCCU.CTRL.B.OPS != 0x3);    //operational status successful
 
}//FCCU_CONFIG

Here is exact example for alarm state and action after timer expire. (It is for different micro, but the FCCU module configuration is the same).

Example MPC5746R FCCU Alarm State GHS716 

0 Kudos

185 Views
travis_kuo
Contributor III

Hi petervlna

I saw your code enables all channels by setting NCF_TOE register.

But the timeout value is set in another register NCF_TO. I cannot find the setting in your code.

Would you please remind me which value you set?

pastedImage_1.png

pastedImage_2.png

0 Kudos

185 Views
petervlna
NXP Employee
NXP Employee

Hi,

by default there is some reset value in TO register. (for my MPC5748G it is 0x6)

When you need to set timeout, set it shorted then FOSU watchdog. Otherwise your alarm state with active fault and FOSU watchdog expire will be reset by FOSU destructive reset.

Peter

0 Kudos

185 Views
petervlna
NXP Employee
NXP Employee

Hello,

Well you didn't share much information with us.

TO register:

Defines the preset value of the timer for the recovery of enabled noncritical faults. Once FCCU enters Alarm state, following the assertion of a noncritical fault that is enabled (NCFEa and NCFTOEa are set), the timer starts the countdown. If the fault is not recovered within the timeout period, the FCCU moves from the Alarm state to the Fault state.

1. Do you have your fault enabled in NCFE register?

2. Do you have alarm state enabled?

Noncritical Fault Timeout Enable (FCCU_NCF_TOEn)

pastedImage_3.png

Peter

0 Kudos