{"record":{"id":"0e8ff230ae3e7027","repo":"embassy-rs/embassy","slug":"dsi-requires-configured-hse","errorCode":null,"errorMessage":"DSI requires configured HSE","messagePattern":"DSI requires configured HSE","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"embassy-stm32/src/rcc/dsi.rs","lineNumber":116,"sourceCode":"        #[cfg(dsihost_v1)]\n        assert!(\n            ndiv >= 10 && ndiv <= 125,\n            \"DSI PLL loop divisor must be 10 <= ndiv <= 125\"\n        );\n\n        #[cfg(dsihost_u5)]\n        assert!(\n            ndiv >= 1 && ndiv <= 511,\n            \"DSI PLL loop divisor must be 1 <= ndiv <= 511\"\n        );\n\n        Self { ndiv, idf, odf }\n    }\n}\n\n/// Enable the DSIHOST PLL\npub fn configure_pll(hse: Option<Hertz>, config: DsiHostPllConfig) -> Hertz {\n    let pll_vco = hse.expect(\"DSI requires configured HSE\") * config.idf * config.ndiv * 2u32;\n\n    #[cfg(feature = \"defmt\")]\n    {\n        debug!(\"DSI PLL VCO: {} MHz\", pll_vco / Hertz::mhz(1));\n    }\n\n    assert!(\n        pll_vco >= Hertz::mhz(1000) && pll_vco <= Hertz::mhz(2000),\n        \"DSI PLL VCO must be >= 1GHz and <= 2GHz\"\n    );\n\n    #[cfg(dsihost_u5)]\n    {\n        assert!(config.idf <= 511, \"DSI PLL input division factor must be <= 511\");\n        assert!(config.odf <= 511, \"DSI PLL output division factor must be <= 511\");\n    }\n\n    let pll_freq = pll_vco / 2u32 * config.odf;","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/embassy-rs/embassy/blob/463a07b963419a1bfe61d5d597c44acb810afb8b/embassy-stm32/src/rcc/dsi.rs#L98-L134","documentation":"`configure_pll` in embassy-stm32's DSI host driver requires a hardware high-speed external oscillator (HSE) as the PLL input. The `hse` parameter is `Option<Hertz>`; when it is `None`, the code panics via `.expect(\"DSI requires configured HSE\")`. The library throws this because the DSIHOST PLL can only be derived from the HSE clock, so it cannot proceed without it.","triggerScenarios":"Calling `dsi::configure_pll(None, config)` — i.e. the RCC config did not enable or yield an HSE frequency — while initializing a DSI display panel.","commonSituations":"Board support or user RCC config lacks `hse: Some(frequency)`; running on a board that boots from HSI/MSI and never configures the external crystal; copying display init code between boards where one has no HSE crystal.","solutions":["Configure HSE in the RCC config before initializing DSI, e.g. `Config { hse: Some(Hertz(8_000_000)), .. }`","Verify the board actually has an HSE crystal and pass its exact frequency","Check board-support crate examples for the correct HSE value for your hardware"],"exampleFix":"// before\nlet config = rcc::Config { ..Default::default() };\n// after\nlet config = rcc::Config {\n    hse: Some(Hertz(25_000_000)),\n    ..Default::default()\n};","handlingStrategy":"validation","validationCode":"if rcc_config.hse.is_none() {\n    panic!(\"DSI display init requires HSE; set hse: Some(Hertz(crystal_hz)) in rcc::Config\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set hse in rcc::Config on boards with a DSI display","Copy HSE frequency from the board support crate, not from other boards","Enable DSI-related example configs as a starting point"],"tags":["embedded","rcc","clock-config","panic"],"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-16T04:17:20.429Z"}