arch/risc-v/espressif: pick oneshot TIMG from SoC instance count - #20189
Merged
xiaoxiang781216 merged 1 commit intoSep 19, 2026
Merged
Conversation
wmrsouza
requested review from
eren-terzioglu,
fdcavalcanti,
jerpelea and
tmedicci
as code owners
September 18, 2026 18:48
Some SoCs have a single timer group, so a hardcoded GROUP_ID of 1 overflowed soc_timg_gptimer_signals and crashed in periph_rcc_acquire_enter. Guard gptimer group 1 behind TIMG_LL_GET(INST_NUM) as well. Assisted-by: Claude:claude-opus-5 Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
wmrsouza
force-pushed
the
feature/oneshot-from-last-timg
branch
from
September 18, 2026 19:00
c40bc55 to
05253ad
Compare
xiaoxiang781216
approved these changes
Sep 19, 2026
simbit18
approved these changes
Sep 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Some RISC-V ESP32 SoCs have only a single timer group. The oneshot driver previously hardcoded GROUP_ID to 1 (Timer 0 of Timer Group 1), which overflows
soc_timg_gptimer_signalsand crashes inperiph_rcc_acquire_enteron chips such as ESP32-C2.This change binds oneshot to the last timer group with
TIMG_LL_GET(INST_NUM) - 1, and compiles the GPTIMER group 1 lower-half only whenTIMG_LL_GET(INST_NUM) > 1.Impact
Impact on user: No.
Impact on build: No.
Impact on hardware: No.
Impact on documentation: No.
Impact on security: No.
Impact on compatibility: No.
Testing
Building
Running
Results