atmel-samd: turn off timer clocks after both timers sharing a GCLK channel are free
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 56/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- c
- 領域
- embedded-iot
調査の方向性
Start with timer_handler.c and inspect tc_gclk_ids[], tcc_gclk_ids[], and the timer allocation and release paths. Read the linked issue #11776 for why disabling a shared GCLK channel caused hangs. Track whether each timer pair is in use, then test the leak and partner-timer scenarios described here; done means reload no longer hangs and a partner PWMOut keeps running.
索引モデルが issue の本文から書いたものです。
説明
Drafted by Claude, reviewed by @dhalbert.
Background
@tannewt's atmel-samd finalizer-cleanup commit added turn_off_clocks() in timer_handler.c. PWMOut, PulseIn, PulseOut, AudioOut, RGBMatrix and PewPew called it when they released a timer. It disabled the timer's GCLK peripheral channel and its APB clock.
However, #11776 removes it, because timers share GCLK peripheral channels in pairs, and it caused a hang. Releasing one timer stopped its partner's clock:
- A
PWMOuton the partner timer stopped running. - Deinitializing the partner then waited forever for its software reset to sync. Boards hung at the end of the VM, with USB gone.
| Timers sharing a channel | |
|---|---|
| SAMD21 | TCC0/TCC1, TCC2/TC3, TC4/TC5, TC6/TC7 |
| SAMD51 | TC0/TC1, TCC0/TCC1, TC2/TC3, TCC2/TCC3, TC4/TC5, TC6/TC7 (TCC4 has its own) |
Proposal
Bring back turn_off_clocks(), but disable a shared GCLK peripheral channel only when neither timer in its pair is in use. The APB clock is per timer, so it can still be turned off on its own.
This needs a record of which timers are in use, for example a bitmask set when a timer is allocated and cleared in turn_off_clocks(). Each timer's peripheral channel ID from tc_gclk_ids[] and tcc_gclk_ids[] finds its partner.
How to test
- Leak one of each pin-owning object, including
PWMOutandPulseOuton both timers of a pair, then reload. The board shouldn't hang. - A
PWMOutkeeps running after an object on its partner timer is deinited.
- 主要言語
- C
- スター
- 4.6k
- フォーク
- 1.4k
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 186
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
adafruit/circuitpython のほかの issue
-
documentation rp2
難易度 1/5 1〜3時間 初心者へのやさしさ 67/100
adafruit/circuitpython#11779 ·
メンテナーはふだん 1 日以内に返信
-
documentation enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
adafruit/circuitpython#11689 ·
メンテナーはふだん 1 日以内に返信
-
bug espressif
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
adafruit/circuitpython#11763 ·
メンテナーはふだん 1 日以内に返信
-
Feather RP2350: MAX3421E instead of PIO USB host, or a second build?対応中かも @mikeysklar が 8 日前に担当しました。 オープンrp2 usb
adafruit/circuitpython#11697 · コメント 5 件 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
-
rp2040 zephyr
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
adafruit/circuitpython#11690 ·
メンテナーはふだん 1 日以内に返信
adafruit/circuitpython の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
ly05010419/MacNativeGames#1897 ·
メンテナーはふだん 1 日以内に返信
-
area: metrics area: tracing contribfest enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
open-telemetry/opentelemetry-ebpf-instrumentation#4188 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
FujiNetWIFI/fujinet-firmware#2328 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
ycrash/yc-360-script#44 ·