embassy-rs/embassy · error

Floating point function requires V2 bootrom

Error message

Floating point function requires V2 bootrom (found: V{})

What it means

This macro-generated wrapper for single-precision ("SF") bootrom float functions panics when `rom_version_number()` is less than 2, because the extended float function table only exists in the V2 bootrom. Calling the guarded function on a V1 bootrom would resolve to invalid ROM addresses, so the library fails fast with this message.

Solutions

  1. Verify hardware with `rom_data::rom_version_number()` before calling float ROM functions and gate them behind a version >= 2 check
  2. Use hardware manufactured after the V2 bootrom rollout (almost all current RP2040 boards)
  3. Fall back to plain Rust f32 arithmetic, which the FPU/soft-float handles without the ROM table
  4. For mixed fleets, wrap ROM float calls in a helper that dispatches to ROM or software based on the version

Example fix

// before
let q = embassy_rp::rom_data::float_funcs::f32_div(a, b); // panics on V1 bootrom
// after
let q = if embassy_rp::rom_data::rom_version_number() >= 2 {
    embassy_rp::rom_data::float_funcs::f32_div(a, b)
} else {
    a / b // compiler-generated soft/hard float
};
Defensive patterns

Strategy: validation

Validate before calling

fn rom_supports_float() -> bool {
    embassy_rp::rom_data::rom_version_number() >= 2
}

Try / catch

// panic in no_std: guard before calling ROM float functions
let result = if rom_supports_float() { rom_f32_div(a, b) } else { a / b };

Prevention

When it happens

Trigger: Calling any `declare_rom_function!`-generated float helper (e.g. rom_data::float_funcs::f32_add) on an RP2040 whose bootrom reports version 1; also happens via code paths that use soft_float_table-derived functions early at boot.

Common situations: Early-revision RP2040 hardware with the original V1 bootrom; boards flashed/OTP-configured before the bootrom update; reusing float ROM code on chips that predate the V2 table.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


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

Appendix: source

Thrown at embassy-rp/src/rom_data/rp2040.rs:531

        /// Calculates the natural logarithm of `v`. If `v <= 0` return -Infinity
        0x50 fln(v: f32) -> f32;
    }

    macro_rules! make_functions_v2 {
        (
            $(
                $(#[$outer:meta])*
                $offset:literal $name:ident (
                    $( $aname:ident : $aty:ty ),*
                ) -> $ret:ty;
            )*
        ) => {
            $(
                declare_rom_function! {
                    $(#[$outer])*
                    fn $name( $( $aname : $aty ),* ) -> $ret {
                        if $crate::rom_data::rom_version_number() < 2 {
                            panic!(
                                "Floating point function requires V2 bootrom (found: V{})",
                                $crate::rom_data::rom_version_number()
                            );
                        }
                        let table: *const usize = $crate::rom_data::soft_float_table();
                        unsafe {
                            // This is the entry in the table. Our offset is given as a
                            // byte offset, but we want the table index (each pointer in
                            // the table is 4 bytes long)
                            let entry: *const usize = table.offset($offset / 4);
                            // Read the pointer from the table
                            core::ptr::read(entry) as *const u32
                        }
                    }
                }
            )*
        }
    }

View on GitHub (pinned to 463a07b963)