I made some tests on FCCU with faked event sent with API below.
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.
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.
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.
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.R = 0xFFFFFFFF; //ALARM Timeout Enable
FCCU.NCF_E.B.NCFE7 = 0x1; //Enable reaction on fault NCF
FCCU.IRQ_ALARM_EN.R = 0x80; //Enable ALARM interrupt on fault NCF
/* 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
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).
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?
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.
Well you didn't share much information with us.
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)