embassy-rs/embassy · error

no SYSCTL peripheral

Error message

no SYSCTL peripheral

What it means

In pin_features, the build script looks up the SYSCTL peripheral in the chip metadata and panics if it is absent. embassy-mspm0 requires a SYSCTL entry to implement NRST pin sharing logic (the nrst-pin-as-gpio feature), so a package without SYSCTL in its metadata cannot generate the pin feature code.

Solutions

  1. Ensure the chip metadata (peripherals list) includes a peripheral named "SYSCTL" and rebuild.
  2. Regenerate the metadata for your chip from the vendor SVD/datasheet so SYSCTL is captured.
  3. If the chip truly lacks SYSCTL, guard the pin_features logic in build.rs with a check instead of expect and file an upstream issue.

Example fix

// before
.find(|p| p.name == "SYSCTL")
.expect("no SYSCTL peripheral");
// after
.find(|p| p.name == "SYSCTL");
let Some(sysctl) = sysctl else { return; };
Defensive patterns

Strategy: validation

Validate before calling

// before building, check metadata contains SYSCTL
assert!(metadata.peripherals.iter().any(|p| p.name == "SYSCTL"), "chip metadata missing SYSCTL");

Prevention

When it happens

Trigger: Building embassy-mspm0 for a chip package whose peripheral list (from the generated/metadata data) does not contain a peripheral named exactly "SYSCTL", causing METADATA.peripherals.iter().find(...).expect("no SYSCTL peripheral") to panic during generate_code -> pin_features.

Common situations: A newly added or unusual MSPM0 package missing the SYSCTL peripheral in its metadata; a metadata generation pipeline that dropped or renamed SYSCTL; editing the chip YAML and accidentally removing SYSCTL.

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


AI-assisted analysis of embassy-rs/embassy@463a07b963 (2026-09-10). Data as JSON: /api/errors/63922fd5b1649b1a. Report an issue: GitHub.

Appendix: source

Thrown at embassy-mspm0/build.rs:512

            };

            let feature = format!("time-driver-{}", name.to_lowercase());

            if singleton.name.contains(selected_timer) {
                singleton.cfg = Some(quote! { #[cfg(not(all(feature = "time-driver-any", feature = #feature)))] });
            } else {
                singleton.cfg = Some(quote! { #[cfg(not(feature = #feature))] });
            }
        }
    }
}

fn pin_features(singletons: &mut Vec<Singleton>) {
    let sysctl = METADATA
        .peripherals
        .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() {

View on GitHub (pinned to 463a07b963)