{"record":{"id":"60050e38939b5078","repo":"embassy-rs/embassy","slug":"the-single-bank-feature-is-not-supported-on-this","errorCode":null,"errorMessage":"The 'single-bank' feature is not supported on this dual bank chip","messagePattern":"The 'single-bank' feature is not supported on this dual bank chip","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"embassy-stm32/build.rs","lineNumber":114,"sourceCode":"        let single_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        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    // ========","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/embassy-rs/embassy/blob/463a07b963419a1bfe61d5d597c44acb810afb8b/embassy-stm32/build.rs#L96-L132","documentation":"embassy-stm32's build script validates the flash bank configuration features against the selected chip's capabilities. When the 'single-bank' Cargo feature is enabled but the chip metadata only reports dual-bank flash memory, the build script panics with this message. It is a compile-time configuration check, not a runtime error.","triggerScenarios":"Building with `--features embassy-stm32/single-bank` (or enabling it via a feature chain) for a chip whose METADATA.memory has no single_bank_memory entry (a dual-bank-only chip such as STM32H7 dual-bank parts).","commonSituations":"Sharing a feature set across multiple targets in a workspace; copying Cargo.toml features from an H743 project to a dual-bank-only part; enabling single-bank to try to reduce flash layout complexity on the wrong chip family.","solutions":["Remove the 'single-bank' feature for this chip, or switch to the 'dual-bank' feature which the chip supports.","Verify the chip is dual-bank capable by checking embassy-stm32's metadata (stm32-metapac) for the target part.","Gate the bank feature per target in Cargo.toml using target-specific dependencies or a build matrix instead of a single shared feature list.","If you truly need single-bank operation, select a chip variant that supports single-bank flash."],"exampleFix":"# before\nembassy-stm32 = { features = [\"stm32h743zi\", \"single-bank\"] }\n\n# after\nembassy-stm32 = { features = [\"stm32h743zi\", \"dual-bank\"] }","handlingStrategy":"validation","validationCode":"# Check chip capability before choosing the feature:\n# cargo tree / embassy-stm32 docs; for dual-bank-only chips use:\n# embassy-stm32 = { features = [\"stm32h743zi\", \"dual-bank\"] }\n[features]\ndefault = []","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match bank features to the datasheet flash layout of each target chip.","Per-target feature configuration in CI builds for every chip in your matrix.","Avoid enabling bank features in shared workspace [features] sections."],"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"}