Skip to content

Conversation

@SebKuzminsky
Copy link

This PR depends on meshtastic/Adafruit_nRF52_Arduino#2 but does not update the firmware dependency on that package since that PR isn't merged yet.

This is a draft/RFC PR. There are some parts of this PR i'm uncertain about and would especially like feedback/guidance on:

  • I don't love the #include <nrfx_wdt.c> in main-nrf52.c. Is there a better way to optionally compile/link C code from packages pulled in as dependencies, as framework-arduinoadafruitnrf52 is?
  • It feels like the NRFX_* architecture configs should go somewhere else, not at the top of main-nrf52.c. src/platform/nrf52/architecture.h maybe?
  • The slightly convoluted split initialization of the wdt (init in Setup, enable in Loop) is awkward, but i have a reason for it. The nrfx wdt API has a notion of channels, whereby different threads or execution contexts can use the wdt hardware independently of each other, by allocating their own channels and then petting that channel. These allocations have to happen after nrfx_wdt_init() and before nrfx_wdt_enable(). I'd like some day to have an architecture-agnostic way to let each thread have its own watchdog channel, which (on nrf52 at least) would require delaying enabling the wdt until all the thread setup is done. The split-setup convolution is in preparation for that future.

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)

Main thread only for now.
@thebentern thebentern requested a review from caveman99 October 29, 2025 18:38
@thebentern thebentern added the enhancement New feature or request label Oct 30, 2025
@thebentern
Copy link
Contributor

@SebKuzminsky the WDT support in the Adafruit_nRF52_Arduino fork has been merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants