{"record":{"id":"2aa282f9aba65f6d","repo":"embassy-rs/embassy","slug":"the-dual-bank-feature-is-not-supported-on-this-s","errorCode":null,"errorMessage":"The 'dual-bank' feature is not supported on this single bank chip","messagePattern":"The 'dual-bank' feature is not supported on this single bank chip","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"embassy-stm32/build.rs","lineNumber":117,"sourceCode":"        });\n\n        let dual_bank_memory = METADATA.memory.iter().find(|mem| {\n            mem.iter().any(|region| region.name.contains(\"BANK_1\"))\n                && mem.iter().any(|region| region.name.contains(\"BANK_2\"))\n        });\n\n        cfgs.set(\n            \"bank_setup_configurable\",\n            single_bank_memory.is_some() && dual_bank_memory.is_some(),\n        );\n\n        match (single_bank_selected, dual_bank_selected) {\n            (true, true) => panic!(\"Both 'single-bank' and 'dual-bank' features enabled\"),\n            (true, false) => {\n                single_bank_memory.expect(\"The 'single-bank' feature is not supported on this dual bank chip\")\n            }\n            (false, true) => {\n                dual_bank_memory.expect(\"The 'dual-bank' feature is not supported on this single bank chip\")\n            }\n            (false, false) => {\n                if METADATA.memory.len() != 1 {\n                    panic!(\n                        \"Chip supports single and dual bank configuration. No Cargo feature to select one is enabled. Use the 'single-bank' or 'dual-bank' feature to make your selection\"\n                    )\n                }\n                METADATA.memory[0]\n            }\n        }\n    };\n\n    let has_bkpsram = memory.iter().any(|m| m.name == \"BKPSRAM\");\n\n    // ========\n    // Generate singletons\n\n    let mut singletons: Vec<String> = Vec::new();","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/embassy-rs/embassy/blob/463a07b963419a1bfe61d5d597c44acb810afb8b/embassy-stm32/build.rs#L99-L135","documentation":"The mirror of error 351: the build script panics when the 'dual-bank' Cargo feature is enabled on a chip whose flash memory is single-bank only. The feature selection must match the chip's documented bank layout, so the build fails fast at compile time.","triggerScenarios":"Building with `--features embassy-stm32/dual-bank` for a single-bank-only chip (e.g. many STM32L4/G4 parts, or an H7 part variant with single-bank flash).","commonSituations":"Copy-pasting a Cargo.toml from a dual-bank project (H7) into a single-bank target; a workspace-wide feature unification pulling 'dual-bank' in for all members; renaming the chip in the features list but leaving the bank feature unchanged.","solutions":["Replace the 'dual-bank' feature with 'single-bank' (or remove both if the chip has exactly one memory config).","Check chip metadata: for single-memory parts the build script requires no bank feature or only 'single-bank'.","Avoid cross-target feature sharing; configure bank features per-target.","If using feature unification in a workspace, use resolve-friendly configuration (e.g. separate feature sets per binary)."],"exampleFix":"# before\nembassy-stm32 = { features = [\"stm32g474re\", \"dual-bank\"] }\n\n# after\nembassy-stm32 = { features = [\"stm32g474re\", \"single-bank\"] }","handlingStrategy":"validation","validationCode":"# For single-bank-only chips (e.g. stm32g474re):\n# embassy-stm32 = { features = [\"stm32g474re\", \"single-bank\"] }\n# or omit the bank feature when the chip has only one memory config.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check stm32-metapac/datasheet: single-memory chips must not enable dual-bank.","When porting a project to a new chip, revisit all chip-specific features.","Use cargo build for each target in CI to surface build-script panics early."],"tags":["build-script","cargo-features","stm32","flash-config"],"backgroundTag":"conflicting-config-options","analyzedSha":"463a07b963419a1bfe61d5d597c44acb810afb8b","analyzedAt":"2026-09-10T13:38:26.660Z","contentChangedAt":"2026-09-10T13:38:26.660Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}