machine/stm32: watchdog timeout above the max wraps instead of being clamped
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 86/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go
- 領域
- embedded-iot
調査の方向性
issue によると、移動された STM32 watchdog コードは現在 src/machine/watchdog/watchdog_stm32.go にあります。制限された timeout と、reload register の計算に使われる値を比較し、関連する watchdog テストを確認してください。WatchdogConfig のドキュメントに記載されているとおり、最大値を超える timeout が最大の reload value を生成すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
On STM32, the IWDG watchdog Configure clamps the timeout to WatchdogMaxTimeout but then uses the original config.TimeoutMillis to compute the reload value:
timeout := config.TimeoutMillis
if timeout > WatchdogMaxTimeout {
timeout = WatchdogMaxTimeout
}
// Set reload value based on /256 divider
stm32.IWDG.RLR.Set(((config.TimeoutMillis*32768 + (256 * 1024) - 1) / (256 * 1024)) - 1)
IWDG_RLR only has 12 bits (RM0090 section 21.4.3), so any timeout above the max gets truncated instead of rounded down to the max. That makes the watchdog fire much sooner than asked:
TimeoutMillis |
Reload value | Written to RL[11:0] | Actual timeout |
|---|---|---|---|
| 32768 | 0xfff | 0xfff | ~32 s |
| 40000 | 0x1387 | 0x387 | ~7.1 s |
| 60000 | 0x1d4b | 0xd4b | ~26.6 s |
| 140000 | overflows uint32 | 0x45b | ~8.7 s |
The WatchdogConfig docs say a timeout above the max is rounded down, so a long timeout should give the max.
The fix is probably to use timeout in the RLR.Set call. After #6710 this code is in src/machine/watchdog/watchdog_stm32.go.
I found this using automated analysis while moving the watchdog code in #6710.
- 主要言語
- Go
- スター
- 17.8k
- フォーク
- 1.1k
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 380
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tinygo-org/tinygo のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tinygo-org/tinygo#6727 ·
メンテナーはふだん 1 日以内に返信
-
Builds are not reproducible: cgo snippet paths in debug info対応中かも @tridev-tej が 1 日前に担当しました。 オープンenhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tinygo-org/tinygo#6619 ·
メンテナーはふだん 1 日以内に返信
-
Fix the targets that tinygo build -target rejects対応中かも @narguis が 2 日前に担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
tinygo-org/tinygo#6617 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
tinygo-org/tinygo#6312 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
tinygo-org/tinygo#6161 ·
メンテナーはふだん 1 日以内に返信
tinygo-org/tinygo の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
sresarehumantoo/cc-artex#456 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ollama/ollama#20021 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
factory:subtask
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
release
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
github/gh-aw-mcpg#17603 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
bboerst/stratum-work#351 ·
メンテナーはふだん 1 日以内に返信