embassy-rs/embassy · error
WatchdogChannels::All is not supported for AWD3; use…
Error message
WatchdogChannels::All is not supported for AWD3; use Channels(0x3FFF) to monitor all 14 channels
What it means
The AWD3 analog watchdog on non-U5 ADC4-family STM32 parts cannot represent 'monitor all channels' in its 14-bit channel mask register, so embassy-stm32 panics on WatchdogChannels::All during setup_awd. An explicit Channels bitmask (0x3FFF for all 14 channels) must be given instead.
Solutions
- Replace WatchdogChannels::All with WatchdogChannels::Channels(0x3FFF) to monitor all 14 channels
- Pass an explicit narrower mask for only the channels being watched
- Restructure shared configuration code so only AWD1 receives WatchdogChannels::All
Example fix
// before
let cfg = WatchdogConfig { awd: Awd::Awd3, channels: WatchdogChannels::All, .. };
// after
let cfg = WatchdogConfig { awd: Awd::Awd3, channels: WatchdogChannels::Channels(0x3FFF), .. }; Defensive patterns
Strategy: validation
Validate before calling
// Allow All only for AWD1: if awd != Awd::Awd1 { channels = WatchdogChannels::Channels(0x3FFF); } Prevention
- Restrict WatchdogChannels::All to AWD1 in shared config helpers
- Prefer explicit channel masks for AWD2/AWD3
- Add unit tests covering each watchdog instance's configuration
When it happens
Trigger: Setting up the third analog watchdog (AWD3) on an ADC4-family non-U5 chip with WatchdogChannels::All in the watchdog configuration.
Common situations: Configuring multiple watchdogs (AWD1/AWD2/AWD3) from shared code that uses All everywhere; assuming AWD3 behaves like AWD1 with respect to channel selection.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- WatchdogChannels::All is not supported for AWD2; use…
- WatchdogChannels::All is not supported for AWD2; use…
- WatchdogChannels::All is not supported for AWD3; use…
- WatchdogChannels::Channels bitmask is not supported for…
- Boot prepare error
AI-assisted analysis of embassy-rs/embassy@463a07b963 (2026-09-10).
Data as JSON: /api/errors/3682d2a3fc92782f.
Report an issue: GitHub.
Appendix: source
Thrown at embassy-stm32/src/adc/watchdog_adc4.rs:334
});
T::regs().awd3cr().modify(|w| {
#[cfg(stm32wba)]
{
for n in 0..14usize {
w.set_awd3ch(n, false);
}
match channels {
WatchdogChannels::Single(ch) => w.set_awd3ch(ch as usize, true),
WatchdogChannels::Channels(mask) => {
for n in 0..14usize {
if mask & (1 << n) != 0 {
w.set_awd3ch(n, true);
}
}
}
WatchdogChannels::All => {
panic!("WatchdogChannels::All is not supported for AWD3; use Channels(0x3FFF) to monitor all 14 channels");
}
}
}
#[cfg(stm32u5)]
{
for n in 0..24usize {
w.set_awdch(n, false);
}
match channels {
WatchdogChannels::Single(ch) => w.set_awdch(ch as usize, true),
WatchdogChannels::Channels(mask) => {
for n in 0..24usize {
if mask & (1 << n) != 0 {
w.set_awdch(n, true);
}
}
}
WatchdogChannels::All => {View on GitHub (pinned to 463a07b963)