embassy-rs/embassy · error

The 'single-bank' feature is not supported on this dual…

Error message

The 'single-bank' feature is not supported on this dual bank chip

What it means

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.

Solutions

  1. Remove the 'single-bank' feature for this chip, or switch to the 'dual-bank' feature which the chip supports.
  2. Verify the chip is dual-bank capable by checking embassy-stm32's metadata (stm32-metapac) for the target part.
  3. Gate the bank feature per target in Cargo.toml using target-specific dependencies or a build matrix instead of a single shared feature list.
  4. If you truly need single-bank operation, select a chip variant that supports single-bank flash.

Example fix

# before
embassy-stm32 = { features = ["stm32h743zi", "single-bank"] }

# after
embassy-stm32 = { features = ["stm32h743zi", "dual-bank"] }
Defensive patterns

Strategy: validation

Validate before calling

# Check chip capability before choosing the feature:
# cargo tree / embassy-stm32 docs; for dual-bank-only chips use:
# embassy-stm32 = { features = ["stm32h743zi", "dual-bank"] }
[features]
default = []

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


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

Appendix: source

Thrown at embassy-stm32/build.rs:114

        let single_bank_memory = METADATA.memory.iter().find(|mem| {
            mem.iter().any(|region| region.name.contains("BANK_1"))
                && !mem.iter().any(|region| region.name.contains("BANK_2"))
        });

        let dual_bank_memory = METADATA.memory.iter().find(|mem| {
            mem.iter().any(|region| region.name.contains("BANK_1"))
                && mem.iter().any(|region| region.name.contains("BANK_2"))
        });

        cfgs.set(
            "bank_setup_configurable",
            single_bank_memory.is_some() && dual_bank_memory.is_some(),
        );

        match (single_bank_selected, dual_bank_selected) {
            (true, true) => panic!("Both 'single-bank' and 'dual-bank' features enabled"),
            (true, false) => {
                single_bank_memory.expect("The 'single-bank' feature is not supported on this dual bank chip")
            }
            (false, true) => {
                dual_bank_memory.expect("The 'dual-bank' feature is not supported on this single bank chip")
            }
            (false, false) => {
                if METADATA.memory.len() != 1 {
                    panic!(
                        "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"
                    )
                }
                METADATA.memory[0]
            }
        }
    };

    let has_bkpsram = memory.iter().any(|m| m.name == "BKPSRAM");

    // ========

View on GitHub (pinned to 463a07b963)