I was working with an STM32WB55RG that had the IWDG_STOP bit
unset by a previous developer. It took me hours to figure
out why WDT_OPT_PAUSE_IN_SLEEP didn't do what it's supposed to.
I hope this note helps the next one coming around to this issue.
I also wrote an article about this:
https://chris-besch.com/articles/soc_option_bytes
Signed-off-by: Christopher Besch <mail@chris-besch.com>
Implement the M5PM1 watchdog as a Zephyr watchdog controller child
of the MFD device.
The driver supports a single reset-only timeout channel with one-second
granularity (1 to 255 s).
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-4.7
Update all drivers to use "flags" instead of "sense" when accessing
interrupt properties from device tree. This aligns with the updated
interrupt controller bindings that now consistently use "flags" as
the cell name for the IRQ type field.
Signed-off-by: Amneesh Singh <amneesh@ti.com>
Add sleep retention support for WDT driver. When peripheral
power down is enabled for light sleep, register data is lost,
so REGDMA backup is needed to mantein peripheral operational.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Nordic's nPM10 Series PMIC watchdog driver implementation and devicetree
bindings.
Signed-off-by: Sergei Ovchinnikov <sergei.ovchinnikov@nordicsemi.no>
atcwdt200 already supports the CONFIG_WDT_DISABLE_AT_BOOT feature.
However, HAS_WDT_DISABLE_AT_BOOT was not enabled in the driver config layer
at that time.
This PR fixes that issue.
Signed-off-by: Kevin Wang <kevinwang821020@google.com>
Use the Clock controller to get the frequency of the WDT clock instead
of hand roling with some defines owned/intendet for the clock
controller.
Signed-off-by: Fiona Behrens <me@kloenk.dev>
Add System Clock Controller for the M480 nuvoton MCU.
This only adds the base driver to setup HIRC, HXT, LIRC, LXT and
PLL. Configuring the PLL driver from a target frequency with
calculating values to best match this frequency.
Signed-off-by: Fiona Behrens <me@kloenk.dev>
TI MSPM0 has a WWDT module to initiate a reset when correct operation of
the device has failed due to an unexpected software or system delay.
Signed-off-by: Sanjay Vallimanalan <sanjay@linumiz.com>
Signed-off-by: Jackson Farley <j-farley@ti.com>
The EFM32HG (Series 0) WDOG has no IRQ support, no window mode
and no reset-disable bit.
Guard the logic with HAL feature macros and use `IF_ENABLED` with
`DT_INST_IRQ_HAS_IDX` for conditional IRQ setup.
Add the `wdog0` node to the EFM32HG device tree.
Signed-off-by: Patryk Koscik <pkoscik@antmicro.com>
- Initial implementation for the numaker watchdog timer peripheral.
- Add binding to the m48x series soc.
Signed-off-by: Scott Laboe <scottyl2.718@gmail.com>
If DT has IRQ defined, the board supports NMI mode, if reset-capable
property is set then the board can support reset as well. Based
on these DT properties and the flags passed by the application,
NMI mode or Reset mode can be set.
Signed-off-by: Sunil Hegde <s-hegde3@ti.com>
Allow WWDT callbacks without warning configuration when
WDT_FLAG_RESET_NONE is selected.
This restores callback-at-expiry behavior for reset-none
flows while keeping reset-enabled modes on the guarded
warning-interrupt path.
Signed-off-by: Holt Sun <holt.sun@nxp.com>
STM32WB0 watchdog does not support disable the Debug
module during STANDBY mode once the DBGMCU
clock is enabled.
Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
`tests/drivers/watchdog/wdt_error_cases` test was failing
on `it51xxx_evb/it51526aw` due to insufficient error
handling. This change fixes those issues, and the following
tests now pass.
- tests/drivers/watchdog/wdt_error_cases
- tests/drivers/watchdog/wdt_basic_api
- tests/drivers/watchdog/wdt_basic_reset_none
- tests/drivers/watchdog/wdt_variables
- samples/drivers/watchdog
Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/w1`
- `drivers/watchdog`
- `drivers/wifi`
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Update the MCUX WWDT driver to partially use the Zephyr clock control API
instead of direct HAL clock APIs for clock on and get rate.
Keep using HAL clock APIs for set clock divider because the set rate API
accepts clock frequency and it may cause two external calls to get WWDT
frequency.
Support multiple instances.
Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
Update the MCUX i.MX WDOG driver to support multiple device instances
instead of being hardcoded to instance 0.
Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
Update the MCUX WDOG32 driver to support multiple device instances
instead of being hardcoded to instance 0.
Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
Add WWDG support for STM32C5. Replace the IS_WWDG_COUNTER macro (that
doesn't exist in the STM32C5 LL) by the IN_RANGE macro.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Add the *_FreezePeriph function for STM32C5. While at it, fix the driver
for C0/F0/G0/L0 by calling the *_FreezePeriph function once the DBGMCU
clock is enabled (a #endif was missing). It is done the same
way for WWDG driver.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Some macros used in the IWDG driver are no longer present in HAL2. Replace
them by doing the same operation directly.
Also make some clean up/cosmetic changes.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
Following the convention of other driver libraries, allow the library
to be empty, so there is no build warning if CONFIG_WATCHDOG is
enabled, but no driver is selected.
<!-- ps-id: 2581e043-e366-4115-b6d2-73ca070add8b -->
Signed-off-by: James Walmsley <james@fullfat-fs.co.uk>
Add support for the CONFIG_WDT_DISABLE_AT_BOOT Kconfig option.
If the watchdog timer is enabled by default on the target board,
enabling this option will explicitly disable the watchdog during
the driver initialization phase.
Signed-off-by: Kevin Wang <kevinwang821020@google.com>
Fix broken FS26 watchdog field extraction and refresh checks.
Correct the device status macro, simple watchdog write error
handling, related register field helper macros, and use integer
duty-cycle values when selecting the watchdog window.
Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
Removed the options variable on wdt_cc13xx_cc26xx_init
which was only initialized to zero and not used.
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
Add software state check (!data->wdt_started) to wdt_feed() validation
to ensure feed operations are only allowed after wdt_setup() has been
called.
Signed-off-by: Harini T <harini.t@amd.com>
On CY_IP_S8SRSSLT devices (PSOC 4), the WDT match register is 16-bit.
When Cy_SysClk_IloCompensate returns a compensated count that exceeds
UINT16_MAX (e.g. for a ~2000ms timeout at ~32768 Hz), passing it to
Cy_WDT_SetMatch triggers a HAL assertion that causes a HardFault on
Cortex-M0+.
Clamp ilo_compensated_counts to UINT16_MAX in the setup path, matching
the existing clamp in the feed path (ifx_wdt_timeout_to_match).
Signed-off-by: Braeden Lane <Braeden.Lane@infineon.com>
Add a watchdog timer driver for all Bouffalo Lab SoC families.
Tested on Sipeed M0Sense (BL702) with tests/drivers/watchdog/wdt_basic_api.
Signed-off-by: William Markezana <william.markezana@gmail.com>
The WWDG timeout check used a signed comparison between the requested
and computed timeout, causing valid configurations to be rejected when
the computed timeout was slightly lower than the requested one.
Replace the comparison by an absolute‑difference check so that the
configured timeout is accepted as long as it stays within the allowed
error margin.
This fixes spurious -EINVAL returned by install_timeout() on STM32.
Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
If the clock device (i.e., RCC) failed to initialize, we have bigger
problems than trying to call clock_control_{off,on,configure} on it.
Don't bother checking to save some footprint.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
There are many drivers which control a disabled-by-default watchdog timer
but take the liberty of selecting HAS_WDT_DISABLE_AT_BOOT and interpreting
WDT_DISABLE_AT_BOOT=n as "enable the timer", which does not correspond to
the semantics of this option.
Update all such drivers to no longer select HAS_WDT_DISABLE_AT_BOOT and
ignore the WDT_DISABLE_AT_BOOT option.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
WDT_DISABLE_AT_BOOT should only be used to forcefully disable watchdog
timers that are enabled by default after system reset. Update the Kconfig
help text of WDT_DISABLE_AT_BOOT and its dependency HAS_WDT_DISABLE_AT_BOOT
to make this clear.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
1. enable watchdog support
2. verified tests/drivers/watchdog/wdt_basic_api
Signed-off-by: Peter Wang <chaoyi.wang@nxp.com>
Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
Add MAX42500 watchdog driver, including ability to configure voltage
monitors that can also generate reset conditions.
Signed-off-by: Pete Johanson <pete.johanson@analog.com>