How to use Window WDG of SWT?

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

How to use Window WDG of SWT?

200 Views
Janeting123
Contributor I

I call Swt_Ip_Service in 100msTask, which is OK in timeout mode. In order to use windows wdg mode, I modify the swt configuration as follows:Snipaste_2024-06-05_19-59-37.png

The software did not work as I expected and the watchdog was reset.

Is there a problem with the configuration? How can I modify it?

I tried to debug, but I found that the CO register is always 0 in Windows WDG mode.

Is there a better way to know how long the time is from the current time point to the timeout?

 

0 Kudos
5 Replies

171 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Janeting123

If window mode enabled then service SWT should in [Timeout period - window period, Timeout period]

For example:

Your have set Timeout period to 150ms and set window period to 75ms

Then you have to service SWT in "0.15-0.075" ~ "0.15" S, which is range of  75 to 150 ms.

0 Kudos

166 Views
Janeting123
Contributor I

As described in my first sentence, the function is called in 100msTask.

This configuration is specially prepared for this 100ms cycle.

So, I don't know what the problem is.

What confuses me even more is that the chip doesn't seem to have a register that can indicate the watchdog count.

0 Kudos

161 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Janeting123

You need to check whether your 100ms task time is completely accurate or whether it may be occupied by interrupts.

For CO register, you have to disable SW first then you can see the value,

"When SWT is disabled (CR[WEN] is 0), CNT shows the value of the internal timer. When SWT is enabled (CR[WEN] is 1), it writes 0 to CNT. Values in this field can lag behind the internal timer value up to six system clock cycles plus eight counter clock cycles. Therefore, the CNT value that is read immediately after disabling SWT may be higher than the actual value of the internal timer."

 

 

0 Kudos

137 Views
Janeting123
Contributor I

The accuracy of 100msTask has been verified in normal dog mode. If there is a special situation in a certain cycle, it needs to be debugged.
Only when CR[WEN]=1, SWT is in window dog mode. At this time, the CO register is always 0. I can't find a suitable debugging method.

0 Kudos

133 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Janeting123

If you don't turn off SWT, there is no other way to see the CO register vaule

Senlent_0-1717666639226.png

 

0 Kudos