atmel-samd: turn off timer clocks after both timers sharing a GCLK channel are free
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 56/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- c
- Bereich
- embedded-iot
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- C
- Sterne
- 4.6k
- Forks
- 1.4k
- Ø Merge
- 1 T. 3 Std.
- Gemergte PRs (30 T.)
- 186
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus adafruit/circuitpython
-
documentation rp2
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 67/100
adafruit/circuitpython#11779 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
adafruit/circuitpython#11689 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug espressif
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
adafruit/circuitpython#11763 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Feather RP2350: MAX3421E instead of PIO USB host, or a second build?Evtl. vergeben @mikeysklar hat das vor 8 Tagen übernommen. Offenrp2 usb
adafruit/circuitpython#11697 · 5 Kommentare · 2 zugewiesene Personen ·
Maintainer antworten meist innerhalb von 1 Tag
-
rp2040 zephyr
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
adafruit/circuitpython#11690 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in adafruit/circuitpython
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 80/100
ly05010419/MacNativeGames#1897 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: metrics area: tracing contribfest enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
open-telemetry/opentelemetry-ebpf-instrumentation#4188 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
FujiNetWIFI/fujinet-firmware#2328 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
ycrash/yc-360-script#44 ·