embassy-rs/embassy · error
WatchdogChannels::Channels bitmask is not supported for…
Error message
WatchdogChannels::Channels bitmask is not supported for AWD1; use Single or All
What it means
For ADC4's analog watchdog 1 on this family, the hardware can only watch either one specific channel (AWD1SGL with AWD1CH) or all channels. The embassy API's WatchdogChannels::Channels(bitmask) variant cannot be expressed in AWD1 registers, so setup_awd panics and directs the user to Single or All instead.
Solutions
- Use WatchdogChannels::Single(channel) to monitor one specific channel with AWD1
- Use WatchdogChannels::All to monitor all enabled channels
- Switch the watchdog to AWD2 or AWD3 if your target supports channel-bitmask selection there
Example fix
// before let cfg = WatchdogConfig::new(WatchdogChannels::Channels(bitmask)); // after let cfg = WatchdogConfig::new(WatchdogChannels::All); // or WatchdogChannels::Single(channel)
Defensive patterns
Strategy: validation
Validate before calling
match channels {
WatchdogChannels::Channels(_) => panic!("AWD1 cannot use a channel bitmask; use Single or All"),
_ => {}
} Prevention
- Remember AWD1 supports only Single or All; reserve bitmask configs for AWD2/AWD3
- Read the ADC4 watchdog section of the reference manual before configuring
- Centralize watchdog channel config in one helper to keep constraints visible
- Check cfg(stm32u5) code paths when porting between families
When it happens
Trigger: Calling `enable_watchdog`/watchdog configuration on ADC4 with `WatchdogChannels::Channels(bitmask)` selected for AWD1.
Common situations: Copying watchdog config that used the bitmask variant from AWD2/AWD3 code (which do support channel groups); assuming AWD1 supports multiple arbitrary channels; upgrading embassy-stm32 where AWD1 gained stricter validation.
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
- Maximal allowed frequency for ADC4 is
- Maximal allowed frequency for the ADC is
- Maximal allowed frequency for the ADC is
- Invalid channel to sample
- Selected PCLK2 frequency is too high for ADC with largest…
AI-assisted analysis of embassy-rs/embassy@463a07b963 (2026-09-10).
Data as JSON: /api/errors/3570b42adda72a2b.
Report an issue: GitHub.
Appendix: source
Thrown at embassy-stm32/src/adc/watchdog_adc4.rs:221
w.set_ht3(high_threshold);
}
});
T::regs().cfgr1().modify(|w| {
w.set_awd1en(true);
#[cfg(stm32wba)]
{
use crate::pac::adc::vals::Awd1sgl;
match channels {
WatchdogChannels::Single(ch) => {
w.set_awd1sgl(Awd1sgl::SingleChannel);
w.set_awd1ch(ch);
}
WatchdogChannels::All => {
w.set_awd1sgl(Awd1sgl::AllChannels);
}
WatchdogChannels::Channels(_) => {
panic!(
"WatchdogChannels::Channels bitmask is not supported for AWD1; use Single or All"
);
}
}
}
#[cfg(stm32u5)]
{
match channels {
WatchdogChannels::Single(ch) => {
w.set_awd1sgl(true);
w.set_awd1ch(ch);
}
WatchdogChannels::All => {
w.set_awd1sgl(false);
}
WatchdogChannels::Channels(_) => {
panic!(
"WatchdogChannels::Channels bitmask is not supported for AWD1; use Single or All"View on GitHub (pinned to 463a07b963)