{"record":{"id":"3b94e9585b1749a2","repo":"embassy-rs/embassy","slug":"dsi-lane-byte-clock","errorCode":null,"errorMessage":"DSI lane byte clock","messagePattern":"DSI lane byte clock","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"embassy-stm32/src/dsihost/mode.rs","lineNumber":299,"sourceCode":"\n    fn set_color<Panel: DsiPanel>(&mut self, color: DsiColor) {\n        T::regs().lcolcr().modify(|w| {\n            w.set_colc(color as u8);\n            w.set_lpe(match color {\n                DsiColor::Rgb666Config1 | DsiColor::Rgb666Config2 => Panel::LOOSELY_PACKED,\n                _ => false,\n            });\n        });\n\n        // Set color coding in DSI wrapper COLMUX\n        T::regs().wcfgr().modify(|w| {\n            w.set_colmux(color as u8);\n        });\n    }\n\n    /// Set video mode registers from a [`DsiVideoConfig`]\n    fn set_video_config<Panel: DsiPanel>(&mut self, config: &DsiVideoConfig) {\n        let lane_byte_clock = self.lane_byte_clock.to_hertz().expect(\"DSI lane byte clock\");\n        let tx_escape_clock = self.tx_escape_clock.to_hertz().expect(\"DSI TX escape clock\");\n        let ltdc_clock = LTDC::frequency();\n\n        T::regs().mcr().modify(|w| w.set_cmdm(false));\n        T::regs().wcfgr().modify(|w| w.set_dsim(false));\n\n        T::regs().vmcr().modify(|w| {\n            w.set_vmt(config.mode as u8);\n            w.set_lpvsae(config.lpvsa);\n            w.set_lpvbpe(config.lpvbp);\n            w.set_lpvfpe(config.lpvfp);\n            w.set_lpvae(config.lpva);\n            w.set_lphbpe(config.lphbp);\n            w.set_lphfpe(config.lphfp);\n            w.set_fbtaae(config.bta);\n            w.set_lpce(config.lpcmd);\n        });\n","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/embassy-rs/embassy/blob/463a07b963419a1bfe61d5d597c44acb810afb8b/embassy-stm32/src/dsihost/mode.rs#L281-L317","documentation":"set_video_config converts the configured DSI lane byte clock (a stored Hertz-option) to a concrete value with to_hertz().expect(...). The expect fires when lane_byte_clock is None, i.e. the DSIHOST clock was never configured/enabled in the RCC setup before entering video mode. The register math needs a real frequency value.","triggerScenarios":"Calling start_panel/set_video_config while the RCC config lacks a dsi_phy/pll-derived lane byte clock, so Frequencies.dsi_phy is None; enabling DSIHOST kernel clock from a PLL not programmed in the same config.","commonSituations":"Forgetting `dsi_phy: Some(...)` in the RCC config for the DSI-capable part (STM32F469/STM32H747/STM32U5); copying an LTDC-only clock config and adding DSI later; changing PLL settings so the DSI clock line was dropped.","solutions":["Set the dsi_phy clock in the RCC config (e.g. from PLLDSI) before creating the DsiHost and starting the panel.","Ensure the PLL feeding the DSI lane byte clock is enabled in the same rcc config.","Verify ordering: clocks configured -> DsiHost::new -> start_panel; not start_panel with default/None clocks.","Cross-check the clock setup against the embassy-stm32 DSI example for your chip family."],"exampleFix":"// before\nlet config = Config::default();\n\n// after\nlet mut config = Config::default();\nconfig.rcc.pll3 = Some(Pll {\n    source: PllSource::HSE, ...\n});\nconfig.rcc.dsi_phy = Some(PllSel::Pll3); // provides lane_byte_clock","handlingStrategy":"validation","validationCode":"// Before start_panel, verify clocks are configured in RCC config:\nlet cfg = Config::default();\nassert!(cfg.rcc.dsi_phy.is_some(), \"DSI lane byte clock must be set in RCC config\");","typeGuard":"fn dsi_clocks_ready(freqs: &Frequencies) -> bool {\n    freqs.dsi_phy.to_hertz().is_ok()\n}","tryCatchPattern":null,"preventionTips":["Always configure dsi_phy (PLLDSI) in the RCC config for DSI display projects.","Follow the chip-specific embassy-stm32 DSI example clock block verbatim.","Re-check RCC config after changing the target chip."],"tags":["embedded","stm32","dsi","display","clock-config"],"backgroundTag":"missing-required-config-field","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"}