{"record":{"id":"518635c9316bf174","repo":"embassy-rs/embassy","slug":"flexable-pixels-are-not-yet-implemented","errorCode":null,"errorMessage":"Flexable pixels are not yet implemented","messagePattern":"Flexable pixels are not yet implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"embassy-stm32/src/ltdc.rs","lineNumber":244,"sourceCode":"    FLEXIBLE = Pf::Flexible as u8,\n}\n\nimpl PixelFormat {\n    /// Number of bytes per pixel\n    pub fn bytes_per_pixel(&self) -> usize {\n        #[cfg(not(ltdc_v1_3))]\n        match self {\n            PixelFormat::Argb8888 => 4,\n            PixelFormat::Rgb888 => 3,\n            PixelFormat::Rgb565 | PixelFormat::Argb4444 | PixelFormat::Argb1555 | PixelFormat::Al88 => 2,\n            PixelFormat::Al44 | PixelFormat::L8 => 1,\n        }\n        #[cfg(ltdc_v1_3)]\n        match self {\n            PixelFormat::ARGB8888 | PixelFormat::ABGR8888 | PixelFormat::RGBA8888 | PixelFormat::BGRA8888 => 4,\n            PixelFormat::RGB888 => 3,\n            PixelFormat::RGB565 | PixelFormat::BGR565 => 2,\n            PixelFormat::FLEXIBLE => todo!(\"Flexable pixels are not yet implemented\"),\n        }\n    }\n}\n\n/// Ltdc Blending Layer\n#[repr(usize)]\n#[derive(Debug, PartialEq, Eq, Clone, Copy)]\n#[cfg_attr(feature = \"defmt\", derive(defmt::Format))]\npub enum LtdcLayer {\n    /// Bottom layer\n    Layer1 = 0,\n    /// Top layer\n    Layer2 = 1,\n}\n\nimpl<T: Instance> interrupt::typelevel::Handler<T::Interrupt> for InterruptHandler<T> {\n    unsafe fn on_interrupt() {\n        cortex_m::asm::dsb();","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/embassy-rs/embassy/blob/463a07b963419a1bfe61d5d597c44acb810afb8b/embassy-stm32/src/ltdc.rs#L226-L262","documentation":"bytes_per_pixel for PixelFormat hits the FLEXIBLE variant, which has no defined byte width in the LTDC driver yet, so it panics via todo!. FLEXIBLE is a placeholder pixel format for variable-depth formats that embassy-stm32 has not implemented for the LTDC display controller.","triggerScenarios":"Calling LTDC layer/framebuffer configuration code (e.g. configuring a layer with frame_buffer or layer setup) while a PixelFormat::FLEXIBLE format is selected for a layer on an ltdc_v1_3 part.","commonSituations":"Copying example layer configs that use PixelFormat::FLEXIBLE, or choosing FLEXIBLE assuming it adapts to a custom framebuffer layout.","solutions":["Use a concrete pixel format such as PixelFormat::RGB565, ARGB8888, RGB888, etc. instead of FLEXIBLE","Size the framebuffer for the chosen format (bytes_per_pixel * width * height)","If FLEXIBLE is truly needed, implement the byte-width calculation in ltdc.rs and remove the todo!","Check the LTDC version cfg (ltdc_v1_3) branch is the one compiled for your chip"],"exampleFix":"// before\nlet layer_settings = LayerSettings::new(PixelFormat::FLEXIBLE, buffer);\n// after\nlet layer_settings = LayerSettings::new(PixelFormat::RGB565, buffer);","handlingStrategy":"validation","validationCode":"fn assert_supported(fmt: PixelFormat) { assert!(matches!(fmt, PixelFormat::ARGB8888 | PixelFormat::ABGR8888 | PixelFormat::RGBA8888 | PixelFormat::BGRA8888 | PixelFormat::RGB888 | PixelFormat::RGB565 | PixelFormat::BGR565), \"FLEXIBLE pixels unsupported\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never select PixelFormat::FLEXIBLE in LTDC layer configs","Check embassy-stm32 release notes for FLEXIBLE support before upgrading expectations"],"tags":["rust","embedded","graphics","unimplemented"],"backgroundTag":"unsupported-operation","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"}