{"record":{"id":"3570b42adda72a2b","repo":"embassy-rs/embassy","slug":"watchdogchannels-channels-bitmask-is-not-supporte","errorCode":null,"errorMessage":"WatchdogChannels::Channels bitmask is not supported for AWD1; use Single or All","messagePattern":"WatchdogChannels::Channels bitmask is not supported for AWD1; use Single or All","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"embassy-stm32/src/adc/watchdog_adc4.rs","lineNumber":221,"sourceCode":"                        w.set_ht3(high_threshold);\n                    }\n                });\n\n                T::regs().cfgr1().modify(|w| {\n                    w.set_awd1en(true);\n                    #[cfg(stm32wba)]\n                    {\n                        use crate::pac::adc::vals::Awd1sgl;\n                        match channels {\n                            WatchdogChannels::Single(ch) => {\n                                w.set_awd1sgl(Awd1sgl::SingleChannel);\n                                w.set_awd1ch(ch);\n                            }\n                            WatchdogChannels::All => {\n                                w.set_awd1sgl(Awd1sgl::AllChannels);\n                            }\n                            WatchdogChannels::Channels(_) => {\n                                panic!(\n                                    \"WatchdogChannels::Channels bitmask is not supported for AWD1; use Single or All\"\n                                );\n                            }\n                        }\n                    }\n                    #[cfg(stm32u5)]\n                    {\n                        match channels {\n                            WatchdogChannels::Single(ch) => {\n                                w.set_awd1sgl(true);\n                                w.set_awd1ch(ch);\n                            }\n                            WatchdogChannels::All => {\n                                w.set_awd1sgl(false);\n                            }\n                            WatchdogChannels::Channels(_) => {\n                                panic!(\n                                    \"WatchdogChannels::Channels bitmask is not supported for AWD1; use Single or All\"","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/embassy-rs/embassy/blob/463a07b963419a1bfe61d5d597c44acb810afb8b/embassy-stm32/src/adc/watchdog_adc4.rs#L203-L239","documentation":"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.","triggerScenarios":"Calling `enable_watchdog`/watchdog configuration on ADC4 with `WatchdogChannels::Channels(bitmask)` selected for AWD1.","commonSituations":"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.","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"],"exampleFix":"// before\nlet cfg = WatchdogConfig::new(WatchdogChannels::Channels(bitmask));\n// after\nlet cfg = WatchdogConfig::new(WatchdogChannels::All); // or WatchdogChannels::Single(channel)","handlingStrategy":"validation","validationCode":"match channels {\n    WatchdogChannels::Channels(_) => panic!(\"AWD1 cannot use a channel bitmask; use Single or All\"),\n    _ => {}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["embedded","stm32","adc","watchdog","rust"],"backgroundTag":"unsupported-operation","analyzedSha":"463a07b963419a1bfe61d5d597c44acb810afb8b","analyzedAt":"2026-09-10T13:38:26.660Z","contentChangedAt":"2026-09-10T13:38:26.660Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}