my program is a little strange, i looks like this:
s1: enable SWT()
s2: wait for SWT timeout
s3: disable SWT()
s4: configure FCCU()
at s4 i find NCF_S0 = 0x4000, i know this means SWT has generated a fault. so i cann't configue FCCU.
I wander at this situation, how can i clear the "NCF_S0". Is there any way i can configure FCCU?
Thank you very much!
Hi, Peter
How to rsest to PHASE1 to clear FCCU SWT fault,could you provide the code for me?
Thanks
This is quite simple,
Just do external reset via debugger.
Or you can do SW reset via MC_ME module via mode transition to mode 0. (but your program should not get into situation when SWT expire)
Peter
Hi Peter,
I met the same problem about SWT reset. When SWT fault occur, and after fccu_read_fault function we can read the NCF_S0=0x4000. But after running the fccu_clear_fault function, this fault flag cannot be cleared and NCF_S0 is still 0x4000. The FCCU is normal state, not fault state. I cannot understand why not work...
From your reply above, only sw reset via MC_ME module can clear the SWT fault flag?
Thanks.
Hi,
I explained it here on forum many times.
If you clear active NCF[14] it is cleared. But, as the fault source is still active (SWT still hold fault line to FCCU) the NCF[14] is immediately after clearing set again.
Only way to clear fault line between SWT and FCCU after SWT expire is RESET.
Peter
Hi Peter,
I use MC_ME to make a SW reset while check FCCU.NCF_S[0] = 0x4000, the result without debug tool is that the mcu is still reset. We can get a can message 0x300, cannot get a canid=0x100 message.
Thanks.
The code is as following:
void Sw_Reset(void)
{
MC_ME.MCTL.R = 0x5AF0;
MC_ME.MCTL.R = 0xA50F;
}
void main(void)
{
SWT_0.SR.R = 0xC520;
SWT_0.SR.R = 0xD928;
SWT_0.CR.B.WEN = 0;
SystemClock_Init();
Tim_Init();
Can_Init();
FCCU_clear_faults();
FCCU_read_faults();
if((FCCU.NCF_S[0] & 0x4000) != 0)
{
Can_SendFrame(0); //canid = 0x300
Sw_Reset();
}
FCCU_Init();
Can_SendFrame(1);//canid = 0x100
Wdg_Init();
for(;;)
{
}
}
Hello,
I have the similar issue. How did you fix it ?
Can you please share me the reset register settings.
Hi, pay attention to following document:
http://www.nxp.com/files/microcontrollers/doc/app_note/AN5284.pdf
Hope it helps