Watchdog is resetting the ECU Continuously when there is no communication on the CAN bus

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Watchdog is resetting the ECU Continuously when there is no communication on the CAN bus

2,455 次查看
surya_phaniteja
Contributor II

Dear NXP Support, I am working on S32K146 Controller. I have an issue with Watchdog.
My current watchdog configuration contains below data
WdgMSupervisionCycle: 10ms
WdgMSupervisionReferenceCycle: 10
Total Supervision Reference cycle: 10*10 = 100ms
WdgMExpectedAliveIndications: 10
WdgMMaxMargin: 1
WdgMMinMargin: 1
Min Count of ExpectedAliveIndications: 10-1 = 9
Max Count of ExpectedAliveIndications: 10+1 = 11
This means the WdgM should expect 9, 10 or 11 occurrences within one supervised reference cycle, which is fixed to 100ms (which is 10 WdgM supervision cycle).
I have checkpoint to invoke for every 10ms, then there are 10 or 11 "ExpectedAliveIndications" within 100ms which will satisfy the configuration .
Normal Scenario when there is Issue in the code like Commenting the watchdog checkpoint. In this case, there are 0 Alive_indications in 100ms which will create a watchdog reset (which is working as expected)
1. I am triggering Nm Frames from the canalyzer periodically.
2. Executing the software.
3. Keeping the breakpoint at Application Init Function
4. Able to see the communication with error Frames and Init Function is invoked after everytime reset.
There is another scenario when there is no issue in the code.
In this case, when I am triggering the Nm Frames periodically. watchdog is not resetting the ECU (Didn't observe error frames during communication). But when I stop sending Nm Frames then the watchdog is resetting the ECU continuously.
So, Can you please help me regarding this issue?
0 项奖励
回复
2 回复数

2,231 次查看
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello,

I'm very sorry for the delay. I have already contacted you in your first case in the ticket portal.

It seems that the watchdog is not fed when the frames are not sending. However, it is hard to detect the source of the issue without the code.
Do you use internal or external watchdog?

Thank you.

Best Regards,

Diana

0 项奖励
回复

2,231 次查看
surya_phaniteja
Contributor II

Hello Diana,

I am very sorry for the late reply. I am currently using internal watchdog. I have debugged the issue. After analysis I found Out the below Issue

There are 2 API’s “Wdg_ChannelTrigger” which will invoke from Gpt_Notification for every 500ms and “Wdg_ChannelSetTriggerCondition” which is invoking during WdgM_MainFunction (Which will trigger for every 10ms).

There are 2 global variables “Wdg_au16Timeout[Wdg_Instance]” and “Wdg_au16GptPeriod[Wdg_Instance]”

I am using only 1 instance (So, Wdg_Instance value is 0). During the Initialization time, “Wdg_au16Timeout[0]” is loading with 1000 and “Wdg_au16GptPeriod[0]” is loading with 500 (which is constant).

The API “Wdg_ChannelSetTriggerCondition” is invoking for 50 times for every 1 time invocation to “Wdg_ChannelTrigger”

When the First time “Wdg_ChannelSetTriggerCondition” invoked, the variable “Wdg_au16Timeout[0]” is updating with 150.

During Second time “Wdg_ChannelSetTriggerCondition” invoked, the variable “Wdg_au16Timeout[0]” is updating with 160.

..

During 50th time “Wdg_ChannelSetTriggerCondition” invoked, the variable “Wdg_au16Timeout[0]” is updating with 650.

So, the Gpt_Notification will occur at this time and it will invoke “Wdg_ChannelTrigger”. In the API “Wdg_ChannelTrigger”, there is a below condition

“if( Wdg_au16Timeout[Wdg_Instance] < Wdg_au16GptPeriod[Wdg_Instance])” if it becomes true, It will invoke “Gpt_StopTimer” and the Wdg will reset the ECU after sometime.

If the condition becomes false, it will call “Wdg_IPW_Trigger” and the Watchdog Counter will reload to zero and the Reset won’t occur.

Issue:

In the Present Condition, The Watchdog is not resetting for some time and communication is happening properly (like 3minutes, 5 minutes and 16 minutes.. time is not consistent, it varies for every time during execution). But after sometime, Communication has stopped and reset is occuring.

I have copied the “Wdg_au16Timeout[0]” in to 1 global variable in the API “Wdg_ChannelSetTriggerCondition”, and I have changed the condition like

“if( Global_Var < Wdg_au16GptPeriod[Wdg_Instance])” in the API “Wdg_ChannelTrigger”. But this time, I have observed reset is not happening and communication continues for a long time (checked more than 4 hours).

So, we are suspecting the variable “Wdg_au16Timeout[0]” is changing after sometime or may be it is getting corrupted.

Can you please help me regarding the current Issue?

Thanks and Regards,

Surya Phani Teja

0 项奖励
回复