{"record":{"id":"7ccc31f438b9b901","repo":"embassy-rs/embassy","slug":"no-mspm0xx-mspsxx-cargo-feature-enabled","errorCode":null,"errorMessage":"No mspm0xx/mspsxx Cargo feature enabled","messagePattern":"No mspm0xx/mspsxx Cargo feature enabled","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"embassy-mspm0/build.rs","lineNumber":42,"sourceCode":"    interrupt_group_linker_magic();\n}\n\nfn generate_code(cfgs: &mut CfgSet) {\n    #[cfg(any(feature = \"rt\"))]\n    println!(\n        \"cargo:rustc-link-search={}\",\n        PathBuf::from(env::var_os(\"OUT_DIR\").unwrap()).display(),\n    );\n\n    cfgs.declare_all(&[\"gpio_pb\", \"gpio_pc\", \"int_group1\", \"unicomm\"]);\n\n    let chip_name = match env::vars()\n        .map(|(a, _)| a)\n        .filter(|x| x.starts_with(\"CARGO_FEATURE_MSPM0\") || x.starts_with(\"CARGO_FEATURE_MSPS\"))\n        .get_one()\n    {\n        Ok(x) => x,\n        Err(GetOneError::None) => panic!(\"No mspm0xx/mspsxx Cargo feature enabled\"),\n        Err(GetOneError::Multiple) => panic!(\"Multiple mspm0xx/mspsxx Cargo features enabled\"),\n    }\n    .strip_prefix(\"CARGO_FEATURE_\")\n    .unwrap()\n    .to_ascii_lowercase()\n    .replace('_', \"-\");\n\n    eprintln!(\"chip: {chip_name}\");\n\n    cfgs.enable_all(&get_chip_cfgs(&chip_name));\n    for chip in ALL_CHIPS {\n        cfgs.declare_all(&get_chip_cfgs(&chip));\n    }\n\n    let mut singletons = get_singletons(cfgs);\n\n    time_driver(&mut singletons, cfgs);\n    pin_features(&mut singletons);","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/embassy-rs/embassy/blob/463a07b963419a1bfe61d5d597c44acb810afb8b/embassy-mspm0/build.rs#L24-L60","documentation":"embassy-mspm0's build script generates chip-specific register/peripheral code based on exactly one enabled chip Cargo feature (e.g. mspm0g350x). When the environment contains no variable starting with CARGO_FEATURE_MSPM0 or CARGO_FEATURE_MSPS, `get_one` returns `GetOneError::None` and the build script panics, failing the build with this message.","triggerScenarios":"Adding `embassy-mspm0` as a dependency with `default-features = false` and no chip feature like `mspm0g350x` enabled; building a workspace where the feature lives on another crate and isn't forwarded.","commonSituations":"Creating a new project from scratch without copying the chip feature line from an example; upgrading embassy and losing default features; trying to compile the crate standalone (`cargo build` inside the crate dir without features).","solutions":["Enable exactly one chip feature in Cargo.toml, e.g. `embassy-mspm0 = { version = \"...\", features = [\"mspm0g350x\"] }` matching your actual MCU.","If features are set on a sibling crate, re-export/forward them or enable them directly on embassy-mspm0.","Check `cargo build -v` / `cargo tree -f '{p} {f}'` that the feature is active in the unit being compiled."],"exampleFix":"// before (Cargo.toml)\nembassy-mspm0 = { version = \"0.1\", default-features = false }\n// after\nembassy-mspm0 = { version = \"0.1\", features = [\"mspm0g350x\"] }","handlingStrategy":"validation","validationCode":"// Cargo.toml — exactly one chip feature required:\n// [dependencies]\n// embassy-mspm0 = { version = \"0.1\", features = [\"mspm0g350x\"] }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy the dependency line (with chip feature) from the example matching your board.","Never set default-features = false without adding a chip feature.","Verify feature presence with `cargo tree -f '{p} {f}'` after edits."],"tags":["rust","build-script","cargo-features","embedded","compile-time"],"backgroundTag":"feature-not-enabled","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"}