Skip to content

drivers: watchdog: stm32: add IWDG standby mode configuration#4

Open
ringlej wants to merge 1 commit intogridpoint-4.3.0from
feature/iwdg-standby-option-byte
Open

drivers: watchdog: stm32: add IWDG standby mode configuration#4
ringlej wants to merge 1 commit intogridpoint-4.3.0from
feature/iwdg-standby-option-byte

Conversation

@ringlej
Copy link
Copy Markdown
Collaborator

@ringlej ringlej commented May 7, 2026

Summary

  • Add tri-state Kconfig choice (IWDG_STM32_STANDBY) to control the IWDG_STDBY option byte
  • Uses the public flash_ex_op API (FLASH_STM32_EX_OP_OPTB_READ/WRITE) to manage option bytes
  • Runs at SYS_INIT(APPLICATION, 0) to avoid flash semaphore ordering issues at POST_KERNEL
  • Only writes (and triggers OBL_LAUNCH reset) when the option byte differs from desired value
  • No code pulled in when "No change" (default) is selected

@ringlej ringlej self-assigned this May 7, 2026
@ringlej ringlej requested a review from abelino May 7, 2026 00:27
Add Kconfig choice to control the IWDG_STDBY option byte, allowing
users to configure whether the independent watchdog runs or is frozen
during standby mode. Uses the public flash_ex_op API to read/write
option bytes at APPLICATION init level (flash device must be ready).

Three options:
- No change (default): leave option byte as-is, no extra code
- Freeze: clear IWDG_STDBY so IWDG is frozen in standby
- Active: set IWDG_STDBY so IWDG continues running in standby

The write triggers OBL_LAUNCH (system reset) only when the option byte
differs from the desired value. On subsequent boots, no write occurs.

Signed-off-by: Jon Ringle <jringle@gridpoint.com>
@ringlej ringlej force-pushed the feature/iwdg-standby-option-byte branch from 0f0ca2d to 6df4340 Compare May 7, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant