watchdog: Add runner#833
Conversation
2b9bbef to
d267a3a
Compare
Size Report
|
4e9c11f to
ed6bfc1
Compare
|
It seems that there're some issues/warning reported, so the CI fails. Could you fix it? |
f549694 to
a006dde
Compare
|
@HaoboGu Fixed now, and enhanced the CI so it didn't hide the error. |
|
Can you make watchdog optional? |
Add a chip-agnostic WatchdogFeed trait and WatchdogRunner that implements Runnable, so it can be passed directly to run_all!. Because all runnables are joined cooperatively, a tight-loop stall in any sibling task blocks the runner too, letting the hardware watchdog fire a reset. The macro codegen (use_config) is wired up to emit watchdog_runner initialization and add it to the joined task set for unibody, split central, and split peripheral boards. No chip implementations yet -- each is added separately. All of this sits behind a new `watchdog` feature, on by default. Turning it off (default-features = false) drops the rmk::watchdog module and makes the codegen a no-op, so the runner costs nothing on builds that do not want it.
Rp2040Watchdog wraps embassy-rp Watchdog behind the rp2040 feature flag with pause_on_debug(true). The use_rust/rp2040 and use_rust/rp2040_split examples and use_config macro codegen are updated to enable it with an 8s timeout (hardware max is ~8.3s due to RP2040-E1 errata), fed every 4s. Adds a default_runner for RP2040 and Pi Pico W support
Nrf52Watchdog wraps a single embassy-nrf WatchdogHandle behind the _nrf_ble feature flag. A default_runner() helper encapsulates the standard WDT config (10s timeout at 32768 Hz, PAUSE on debug halt, fed every 5s) so callers need only one line. The macro codegen and all use_rust nRF examples (nrf52832_ble, nrf52840_ble, nrf52840_ble_split, nrf52840_ble_split_dongle) now use this helper.
|
Should be all good now. |
Set RUSTFLAGS=-D warnings in the example Build step so a stray lint (e.g. an unused import) fails CI directly. Without it, an undenied warning is replayed onto stdout by "cargo size" during the bloat step and corrupts the size parser, surfacing as an opaque shell error far from the real cause. HEAD keeps -D warnings in the bloat size step too so RUSTFLAGS matches the Build step and cargo reuses the binary; the BASE build keeps the default lint level so a pre-existing warning on main can't fail an unrelated PR.
|
Nice work, thanks a lot! |
Adds a watchdog runner to the supported chipsets. This enables the hardware watchdog to reset the board automatically if Embassy on the device locks up.
I do not have hardware to test these other chipsets, but I used this as the basis for the watchdog on my ZSA Voyager.
Timeout it set to
8son RP2040 as that's a hardware limitation, the others run this at10s.