Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
%DASHBOARD{ section="banner" | ||||||||
Line: 23 to 23 | ||||||||
watchdog ( -- ) Activate watchdog watchdog? ( -- flag ) Has the WATCHDOG bitten? watchdog# ( -- u ) How many times has the watchdog bitten since cold startup? | ||||||||
Changed: | ||||||||
< < | watchdog@ ( -- addr ) Address where the atchdog bit | |||||||
> > | watchdog@ ( -- addr ) Address where the watchdog bit | |||||||
If a thread takes longer than about 500 ms the watchdog will bite and a reset occurs. As long the thread waits for an event e.g. file operation, keyboard (the thread is blocked), nothing happens. |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
%DASHBOARD{ section="banner" | ||||||||
Line: 16 to 16 | ||||||||
Contents
| ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
How to usewatchdog ( -- ) Activate watchdog watchdog? ( -- flag ) Has the WATCHDOG bitten? watchdog# ( -- u ) How many times has the watchdog bitten since cold startup? | ||||||||
Added: | ||||||||
> > | watchdog@ ( -- addr ) Address where the atchdog bit | |||||||
Changed: | ||||||||
< < | If thread takes longer than about 500 ms the watchdog will bite and a reset occurs. As long the thread waits for an event e.g. file operation, keyboard (the thread is blocked), nothing happens. | |||||||
> > | If a thread takes longer than about 500 ms the watchdog will bite and a reset occurs. As long the thread waits for an event e.g. file operation, keyboard (the thread is blocked), nothing happens. | |||||||
: forever begin again ; [RET] ok. watchdog? .[RET] 0 ok. | ||||||||
Line: 47 to 48 | ||||||||
Do not activate the watchdog in debugging mode. | ||||||||
Changed: | ||||||||
< < | watchdog? [IF] .( Watchdog has bitten, # bites: ) watchdog# . cr [THEN] | |||||||
> > | watchdog? [IF] .( Watchdog has bitten at ) watchdog@ hex. .( , # bites: ) watchdog# . cr [THEN] | |||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
Implementation | ||||||||
Changed: | ||||||||
< < | For STM32WB55: | |||||||
> > | For STM32WB55: | |||||||
WWDG clock (Hz) = PCLK1 / (4096 * Prescaler) |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
%DASHBOARD{ section="banner" | ||||||||
Line: 19 to 19 | ||||||||
Added: | ||||||||
> > | watchdog ( -- ) Activate watchdog watchdog? ( -- flag ) Has the WATCHDOG bitten? watchdog# ( -- u ) How many times has the watchdog bitten since cold startup?If thread takes longer than about 500 ms the watchdog will bite and a reset occurs. As long the thread waits for an event e.g. file operation, keyboard (the thread is blocked), nothing happens. : forever begin again ; [RET] ok. watchdog? .[RET] 0 ok. watchdog[RET] ok. forever[RET] BOOM Mecrisp-Stellaris RA 2.5.4 by Matthias Koch. Mecrisp-Cube 1.4.4 for STM32WB55, 63/128 KiB RAM/FLASH dictionary (C) 2021 peter@spyr.ch * Firmware Package STM32Cube FW_WB V1.11.0, USB-CDC, BLE Stack 5.0 (C) 2021 STMicroelectronics * CMSIS-RTOS V2 FreeRTOS wrapper, FreeRTOS Kernel V10.3.1 (C) 2020 Amazon.com * FatFs for internal flash and microSD - Generic FAT fs module R0.12c (C) 2017 ChaN * tiny vi - part of BusyBox (C) 2000, 2001 Sterling Huxley watchdog? .[RET] -1 ok. watchdog# .[RET] 1 ok.Do not activate the watchdog in debugging mode. watchdog? [IF] .( Watchdog has bitten, # bites: ) watchdog# . cr [THEN] | |||||||
| ||||||||
Changed: | ||||||||
< < | How to Create a Thread | |||||||
> > | ImplementationFor STM32WB55:WWDG clock (Hz) = PCLK1 / (4096 * Prescaler) PCLK1 is 32 MHz, Prescaler is 64, clock = 32 MHz / (4096 * 64) = 122 Hz WWDG timeout (mS) = 1000 * (T[5;0] + 1) / WWDG clock (Hz) timeout = 1000 * 64 / 122 = 524 ms window = 1000 * 48 / 122 = 393 msI choose 450 ms period to feed the watchdog. | |||||||
Added: | ||||||||
> > | RTC registers are used for accounting the watchdog bites. Those registers are not affected by the reset. | |||||||
Added: | ||||||||
> > | For implementation details see: | |||||||
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
%DASHBOARD{ section="banner" | ||||||||
Line: 6 to 6 | ||||||||
title="Watchdog" titlestyle="color:#F00000;" }% | ||||||||
Changed: | ||||||||
< < | Intro
| |||||||
> > | Intro
| |||||||
For serious real time systems you need a watchdog![]() | ||||||||
Changed: | ||||||||
< < | I create a thread only to kicking (regularly feed) the watchdog. This thread has the second lowest priority (just higher than the idle thread), if any task does not want to give up control, the watchdog thread does not get any more CPU time and cannot feed the watchdog and the watchdog bites. | |||||||
> > | There is a thread only for kicking (regularly feed) the watchdog. This thread has the second lowest priority (just higher than the idle thread), if any task does not want to give up control, the watchdog thread does not get any more CPU time and cannot feed the watchdog and the watchdog will bite after the timeout. | |||||||
Changed: | ||||||||
< < | Contents
| |||||||
> > | Contents
| |||||||
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > |
Watchdog
Intro
For serious real time systems you need a watchdog
![]() Contents
![]() ![]() This work by Peter Schmid is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. |