fs23 wdg questions

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

fs23 wdg questions

Jump to solution
5,301 Views
gumu
Contributor V

Hello,

we are currently debugging the FS23 and would like to ask a question about the watchdog: By default, can the watchdog be permanently disabled through software? Is it done by setting the window to infinite? If it can be disabled, but I saw in the chip manual that it states:

“At power-on reset, the first good watchdog refresh must be sent in less than 256 ms, which is the default watchdog period. If not, the watchdog error counter will be incremented (see section 20.2.2 Watchdog error counter). ”

This mentions that after POR, the watchdog must be refreshed correctly within 256 ms; if the watchdog is disabled, then this 256 ms timeout becomes meaningless, right?

Tags (1)
0 Kudos
Reply
1 Solution
5,222 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi,

If you change the watchdog window period from the default value of 256ms to 64ms ((WDW_PERIOD = 0b0011)) during the INIT phase, and the watchdog is not correctly refreshed during the 256ms INIT phase, then the watchdog window period remains 256ms.

Screenshot 2024-11-11 133131.pngScreenshot 2024-11-11 133131.png

BRs, Tomas

View solution in original post

0 Kudos
Reply
8 Replies
5,284 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi,

The watchdog disable (WDW_PERIOD = 0b0000) is effective only when the INIT phase is closed, so it requires at least one good watchdog refresh within the 256ms of the INIT timeout.

BRs, Tomas

0 Kudos
Reply
5,249 Views
gumu
Contributor V

Hi @TomasVaverka 

The manual describes: "At power-on reset, the first successful watchdog refresh must be sent within less than 256 ms, which is the default watchdog period. If not, the watchdog error counter will be incremented (see section 20.2.2 Watchdog error counter)." 

Based on this description, I conducted an experiment where after the system is powered on, I did not execute the wd refresh and observed how long it would take for the system to reset. My code was similar to this:

Std_ReturnType Sbc_fs23_WdRefresh(void) 
{ 
    Std_ReturnType eReturnValue = E_OK; 
    uint16 u16WdToken = 0U; 
    while(1); 
......
do not do any code
......
}

 Through monitoring the device reset, I found that it reset after approximately 850ms. Why is it not 256ms but 850ms?What FS23 factors are related to device reboot?

below is the waveform I measured, the green line is level of reset pin.

gumu_0-1731235658734.pnggumu_0-1731235658734.png

Thanks!

0 Kudos
Reply
5,236 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi,

Each time the watchdog is not properly refreshed, the watchdog error counter is incremented by 2. When is reaches its configurable limit (6 by default), the fault error counter is incremented by 1 and the RSTB is asserted (WD_RSTB_IMPACT = 1 by default). This corresponds to 3 * 256ms = 768ms.

1.png1.png

2.png2.png

3.png3.png

BRs, Tomas

 

0 Kudos
Reply
5,226 Views
gumu
Contributor V

Hi @TomasVaverka ,

Thank you for your support!

I would like to ask, in your explanation, 'This corresponds to 3 * 256ms = 768ms.' In the init state, the default timeout is 256ms, but the watchdog timeout period is 64ms. If the watchdog is not correctly refreshed during the init state, is 256ms considered the watchdog timeout period?

Tnanks!

0 Kudos
Reply
5,223 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi,

If you change the watchdog window period from the default value of 256ms to 64ms ((WDW_PERIOD = 0b0011)) during the INIT phase, and the watchdog is not correctly refreshed during the 256ms INIT phase, then the watchdog window period remains 256ms.

Screenshot 2024-11-11 133131.pngScreenshot 2024-11-11 133131.png

BRs, Tomas

0 Kudos
Reply
5,275 Views
gumu
Contributor V

Hi Tomas,

Thank you for your answer!

After the system powers on and enters the INIT state, if the watchdog is set to infinite during the INIT state and then a good watchdog refresh is performed to exit the INIT state, does that mean the watchdog is effectively disabled? If my understanding is correct, how does the FS23 exit the infinite mode? Is it through the Sbc_fs23_WdChangeWindowDuration() interface?

Thanks!

0 Kudos
Reply
5,295 Views
gumu
Contributor V

I’ve encountered a phenomenon where, after powering on the system, it does not restart even if the watchdog is not refreshed. Therefore, I think it may be due to the FS23 disabling the watchdog during initialization. However, I do not fully understand the details regarding how to disable the watchdog.

0 Kudos
Reply
5,282 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi,

I suppose that in this case the FS23 is in Debug mode (VDBG > VDBG_MODE (min: 3.5V; typ: 4.5V; max: 5.5V)) where no watchdog refresh is required as the watchdog is configured with infinite timeout and the watchdog window is fully opened. Also the RSTB eight-second timer is disabled and the Fail-safe mode entry is disabled via the fault error counter.

BRs, Tomas

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1990161%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Efs23%20wdg%20questions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1990161%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3Ewe%20are%20currently%20debugging%20the%20FS23%20and%20would%20like%20to%20ask%20a%20question%20about%20the%20watchdog%3A%20By%20default%2C%20can%20the%20watchdog%20be%20permanently%20disabled%20through%20software%3F%20Is%20it%20done%20by%20setting%20the%20window%20to%20infinite%3F%20If%20it%20can%20be%20disabled%2C%20but%20I%20saw%20in%20the%20chip%20manual%20that%20it%20states%3A%3C%2FP%3E%3CP%3E%E2%80%9CAt%20power-on%20reset%2C%20the%20first%20good%20watchdog%20refresh%20must%20be%20sent%20in%20less%20than%20256%20ms%2C%20which%20is%20the%20default%20watchdog%20period.%20If%20not%2C%20the%20watchdog%20error%20counter%20will%20be%20incremented%20(see%20section%2020.2.2%20Watchdog%20error%20counter).%20%E2%80%9D%3C%2FP%3E%3CP%3EThis%20mentions%20that%20after%20POR%2C%20the%20watchdog%20must%20be%20refreshed%20correctly%20within%20256%20ms%3B%20if%20the%20watchdog%20is%20disabled%2C%20then%20this%20256%20ms%20timeout%20becomes%20meaningless%2C%20right%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1991969%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20fs23%20wdg%20questions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1991969%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EIf%20you%20change%20the%20watchdog%20window%20period%20from%20the%20default%20value%20of%20256ms%20to%2064ms%20((WDW_PERIOD%20%3D%200b0011))%20during%20the%20INIT%20phase%2C%20and%20the%20watchdog%20is%20not%20correctly%20refreshed%20during%20the%20256ms%20INIT%20phase%2C%20then%20the%20watchdog%20window%20period%20remains%20256ms.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202024-11-11%20133131.png%22%20style%3D%22width%3A%20657px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Screenshot%202024-11-11%20133131.png%22%20style%3D%22width%3A%20657px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F309768i29751CF88218E998%2Fimage-dimensions%2F657x395%3Fv%3Dv2%22%20width%3D%22657%22%20height%3D%22395%22%20role%3D%22button%22%20title%3D%22Screenshot%202024-11-11%20133131.png%22%20alt%3D%22Screenshot%202024-11-11%20133131.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EScreenshot%202024-11-11%20133131.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EBRs%2C%20Tomas%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1991956%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20fs23%20wdg%20questions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1991956%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F12216%22%20target%3D%22_blank%22%3E%40TomasVaverka%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20support!%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20would%20like%20to%20ask%2C%20in%20your%20explanation%2C%20'This%20corresponds%20to%203%20*%20256ms%20%3D%20768ms.'%20In%20the%20init%20state%2C%20the%20default%20timeout%20is%20256ms%2C%20but%20the%20watchdog%20timeout%20period%20is%2064ms.%20If%20the%20watchdog%20is%20not%20correctly%20refreshed%20during%20the%20init%20state%2C%20is%20256ms%20considered%20the%20watchdog%20timeout%20period%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3ETnanks!%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1991791%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20fs23%20wdg%20questions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1991791%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EEach%20time%20the%20watchdog%20is%20not%20properly%20refreshed%2C%20the%20watchdog%20error%20counter%20is%20incremented%20by%202.%20When%20is%20reaches%20its%20configurable%20limit%20(6%20by%20default)%2C%20the%20fault%20error%20counter%20is%20incremented%20by%201%20and%20the%20RSTB%20is%20asserted%20(WD_RSTB_IMPACT%20%3D%201%20by%20default).%20This%20corresponds%20to%203%20*%20256ms%20%3D%20768ms.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%221.png%22%20style%3D%22width%3A%20634px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%221.png%22%20style%3D%22width%3A%20634px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F309717iDF71198CB8910CCD%2Fimage-dimensions%2F634x283%3Fv%3Dv2%22%20width%3D%22634%22%20height%3D%22283%22%20role%3D%22button%22%20title%3D%221.png%22%20alt%3D%221.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3E1.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20639px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20639px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F309718i529F4B5A7F05E58F%2Fimage-dimensions%2F639x190%3Fv%3Dv2%22%20width%3D%22639%22%20height%3D%22190%22%20role%3D%22button%22%20title%3D%222.png%22%20alt%3D%222.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3E2.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%223.png%22%20style%3D%22width%3A%20643px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%223.png%22%20style%3D%22width%3A%20643px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F309719i7D2A0027EB2B9FDD%2Fimage-dimensions%2F643x615%3Fv%3Dv2%22%20width%3D%22643%22%20height%3D%22615%22%20role%3D%22button%22%20title%3D%223.png%22%20alt%3D%223.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3E3.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EBRs%2C%20Tomas%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1991355%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20fs23%20wdg%20questions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1991355%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F12216%22%20target%3D%22_blank%22%3E%40TomasVaverka%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EThe%20manual%20describes%3A%20%22At%20power-on%20reset%2C%20the%20first%20successful%20watchdog%20refresh%20must%20be%20sent%20within%20less%20than%20256%20ms%2C%20which%20is%20the%20default%20watchdog%20period.%20If%20not%2C%20the%20watchdog%20error%20counter%20will%20be%20incremented%20(see%20section%2020.2.2%20Watchdog%20error%20counter).%22%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EBased%20on%20this%20description%2C%20I%20conducted%20an%20experiment%20where%20after%20the%20system%20is%20powered%20on%2C%20I%20did%20not%20execute%20the%20wd%20refresh%20and%20observed%20how%20long%20it%20would%20take%20for%20the%20system%20to%20reset.%20My%20code%20was%20similar%20to%20this%3A%3C%2FSPAN%3E%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EStd_ReturnType%20Sbc_fs23_WdRefresh(void)%20%0A%7B%20%0A%20%20%20%20Std_ReturnType%20eReturnValue%20%3D%20E_OK%3B%20%0A%20%20%20%20uint16%20u16WdToken%20%3D%200U%3B%20%0A%20%20%20%20while(1)%3B%20%0A......%0Ado%20not%20do%20any%20code%0A......%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CSPAN%3E%26nbsp%3BThrough%20monitoring%20the%20device%20reset%2C%20I%20found%20that%20it%20reset%20after%20approximately%20850ms.%20Why%20is%20it%20not%20256ms%20but%20850ms%3FWhat%20FS23%20factors%20are%20related%20to%20device%20reboot%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Ebelow%20is%20the%20waveform%20I%20measured%2C%20the%20green%20line%20is%20level%20of%20reset%20pin.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22gumu_0-1731235658734.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22gumu_0-1731235658734.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F309516i97D315CBFFAE1419%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22gumu_0-1731235658734.png%22%20alt%3D%22gumu_0-1731235658734.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Egumu_0-1731235658734.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1990707%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20fs23%20wdg%20questions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1990707%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3EHi%20Tomas%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThank%20you%20for%20your%20answer!%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EAfter%20the%20system%20powers%20on%20and%20enters%20the%20INIT%20state%2C%20if%20the%20watchdog%20is%20set%20to%20infinite%20during%20the%20INIT%20state%20and%20then%20a%20good%20watchdog%20refresh%20is%20performed%20to%20exit%20the%20INIT%20state%2C%20does%20that%20mean%20the%20watchdog%20is%20effectively%20disabled%3F%20If%20my%20understanding%20is%20correct%2C%20how%20does%20the%20FS23%20exit%20the%20infinite%20mode%3F%20Is%20it%20through%20the%26nbsp%3BSbc_fs23_WdChangeWindowDuration()%26nbsp%3Binterface%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EThanks!%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1990393%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20fs23%20wdg%20questions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1990393%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EI%20suppose%20that%20in%20this%20case%20the%20FS23%20is%20in%20Debug%20mode%20(VDBG%20%26gt%3B%20VDBG_MODE%20(min%3A%203.5V%3B%20typ%3A%204.5V%3B%20max%3A%205.5V))%20where%26nbsp%3Bno%20watchdog%20refresh%20is%20required%20as%20the%20watchdog%20is%20configured%20with%20infinite%20timeout%20and%20the%20watchdog%20window%26nbsp%3Bis%20fully%20opened.%20Also%20the%26nbsp%3BRSTB%20eight-second%20timer%20is%20disabled%20and%20the%20Fail-safe%20mode%20entry%20is%20disabled%20via%20the%20fault%20error%20counter.%3C%2FP%3E%0A%3CP%3EBRs%2C%20Tomas%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1990388%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20fs23%20wdg%20questions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1990388%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20watchdog%20disable%20(WDW_PERIOD%20%3D%200b0000)%20is%20effective%20only%20when%20the%20INIT%20phase%20is%20closed%2C%20so%20it%20requires%20at%20least%20one%20good%20watchdog%20refresh%20within%20the%20256ms%20of%20the%20INIT%20timeout.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EBRs%2C%20Tomas%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1990174%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20fs23%20wdg%20questions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1990174%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3EI%E2%80%99ve%20encountered%20a%20phenomenon%20where%2C%20after%20powering%20on%20the%20system%2C%20it%20does%20not%20restart%20even%20if%20the%20watchdog%20is%20not%20refreshed.%20Therefore%2C%20I%20think%20it%20may%20be%20due%20to%20the%20FS23%20disabling%20the%20watchdog%20during%20initialization.%20However%2C%20I%20do%20not%20fully%20understand%20the%20details%20regarding%20how%20to%20disable%20the%20watchdog.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E