embassy-rs/embassy · error
Could not find DEBUGSS peripheral
Error message
Could not find DEBUGSS peripheral
What it means
pin_features then looks up the DEBUGSS peripheral in the chip metadata to gate SWD pins behind the swd-pins-as-gpio feature, and panics when DEBUGSS is missing. Every supported MSPM0 package is expected to expose a DEBUGSS entry describing the SWD/swap pins.
Solutions
- Add the DEBUGSS peripheral (with its SWCLK/SWDIO pin signals) to the chip metadata and rebuild.
- Regenerate the chip metadata so the debug subsystem is included.
- If upstream metadata is at fault, report it so the generator emits DEBUGSS for this package.
Example fix
// before: peripherals list without DEBUGSS
// after (metadata YAML)
- name: DEBUGSS
pins:
- { signal: SWCLK, pin: PA20 }
- { signal: SWDIO, pin: PA19 } Defensive patterns
Strategy: validation
Validate before calling
assert!(metadata.peripherals.iter().any(|p| p.name == "DEBUGSS"), "chip metadata missing DEBUGSS");
Prevention
- Always include the debug subsystem (DEBUGSS) when generating chip metadata.
- Run a metadata completeness check listing required peripherals per family.
- Re-generate metadata rather than hand-editing peripheral lists.
When it happens
Trigger: Building embassy-mspm0 for a package whose metadata peripheral list lacks an entry named "DEBUGSS", so METADATA.peripherals.iter().find(|p| p.name == "DEBUGSS").expect(...) panics in generate_code -> pin_features.
Common situations: Metadata for a new MSPM0 variant that omits the DEBUGSS peripheral; a metadata regeneration tool that skips debug subsystem entries; hand-trimming the peripheral list and removing DEBUGSS.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Could not find any timer
- no SYSCTL peripheral
- Could not find NRST pin to cfg gate
- Could not find SWD pin to cfg gate
- Timer does not exist
AI-assisted analysis of embassy-rs/embassy@463a07b963 (2026-09-10).
Data as JSON: /api/errors/14e6a3a3909fcdf4.
Report an issue: GitHub.
Appendix: source
Thrown at embassy-mspm0/build.rs:528
.iter()
.find(|p| p.name == "SYSCTL")
.expect("no SYSCTL peripheral");
// Some packages make NRST share a physical pin with a GPIO.
if let Some(pin) = sysctl.pins.iter().find(|p| p.signal == "NRST" && p.pin != "NRST") {
let pin = singletons
.iter_mut()
.find(|s| s.name == pin.pin)
.expect("Could not find NRST pin to cfg gate");
pin.cfg = Some(quote! { #[cfg(feature = "nrst-pin-as-gpio")] });
}
let debugss = METADATA
.peripherals
.iter()
.find(|p| p.name == "DEBUGSS")
.expect("Could not find DEBUGSS peripheral");
for pin in debugss.pins.iter() {
let pin = singletons
.iter_mut()
.find(|s| s.name == pin.pin)
.expect("Could not find SWD pin to cfg gate");
pin.cfg = Some(quote! { #[cfg(feature = "swd-pins-as-gpio")] });
}
}
fn generate_singletons(singletons: &[Singleton]) -> TokenStream {
let singletons_peripherals_struct = singletons
.iter()
.map(|s| {
let cfg = s.cfg.clone().unwrap_or_default();
let ident = format_ident!("{}", s.name);View on GitHub (pinned to 463a07b963)