{"record":{"id":"a61d45812d5071f9","repo":"embassy-rs/embassy","slug":"lpi2c-ultrafast-hs-mode-is-not-yet-supported","errorCode":null,"errorMessage":"LPI2C UltraFast (HS) mode is not yet supported","messagePattern":"LPI2C UltraFast \\(HS\\) mode is not yet supported","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"embassy-mcxa/src/i2c/controller.rs","lineNumber":415,"sourceCode":"        critical_section::with(|_| {\n            self.info.regs().mcr().modify(|w| w.set_rst(true));\n            // According to Reference Manual section 40.7.1.4, \"There\n            // is no minimum delay required before clearing the\n            // software reset\", therefore we clear it immediately.\n            self.info.regs().mcr().modify(|w| w.set_rst(false));\n\n            self.info.regs().mcr().modify(|w| {\n                w.set_dozen(Dozen::Enabled);\n                w.set_dbgen(false);\n            });\n        });\n\n        let target_hz: u32 = config.speed.into();\n        // UltraFast (HS) mode requires programming MCCR1 and special start\n        // commands beyond what this driver currently supports. Leave it\n        // explicitly unimplemented until the HS path is wired up end-to-end.\n        if config.speed == Speed::UltraFast {\n            todo!(\"LPI2C UltraFast (HS) mode is not yet supported\");\n        }\n        let (prescale, clklo, clkhi, sethold, datavd) = compute_baud_params(self.freq, target_hz);\n\n        critical_section::with(|_| {\n            self.info.regs().mcfgr1().modify(|w| w.set_prescale(prescale));\n            self.info.regs().mccr0().modify(|w| {\n                w.set_clklo(clklo);\n                w.set_clkhi(clkhi);\n                w.set_sethold(sethold);\n                w.set_datavd(datavd);\n            });\n\n            // Enable the controller.\n            self.info.regs().mcr().modify(|w| w.set_men(true));\n        });\n\n        // Clear all flags\n        self.info.regs().msr().write(|w| {","sourceCodeStart":397,"sourceCodeEnd":433,"githubUrl":"https://github.com/embassy-rs/embassy/blob/463a07b963419a1bfe61d5d597c44acb810afb8b/embassy-mcxa/src/i2c/controller.rs#L397-L433","documentation":"The embassy-mcxa LPI2C controller driver only supports standard/fast/fast-plus speeds; UltraFast (HS) mode requires programming MCCR1 and special start commands that the driver has not implemented. Selecting that speed in the config intentionally triggers `todo!`, i.e. a documented not-yet-implemented feature.","triggerScenarios":"Calling `set_configuration` (via `set_config`) with a `Config` whose `speed` is `Speed::UltraFast`.","commonSituations":"Copying a config from another MCU's I2C driver that supports HS mode; bumping the bus speed to 3.4 MHz for a high-speed peripheral without realizing the mcxa driver lacks HS support; a config builder defaulting or being edited to UltraFast.","solutions":["Use `Speed::Standard`, `Speed::Fast`, or `Speed::FastPlus` in the I2C config instead of `UltraFast`.","Verify the peripheral works at the chosen lower speed; HS-mode peripherals usually also support fast mode.","Track/patch embassy-mcxa if you truly need HS mode (implement the MCCR1 + special-start path).","Pin an embassy-mcxa version and re-check release notes for UltraFast support landing."],"exampleFix":"// before\nlet config = Config { speed: Speed::UltraFast, ..Default::default() };\ni2c.set_config(&config);\n// after\nlet config = Config { speed: Speed::FastPlus, ..Default::default() };\ni2c.set_config(&config);","handlingStrategy":"validation","validationCode":"fn assert_supported_speed(speed: Speed) {\n    assert!(matches!(speed, Speed::Standard | Speed::Fast | Speed::FastPlus),\n            \"LPI2C UltraFast (HS) mode is unsupported by embassy-mcxa\");\n}\nassert_supported_speed(config.speed);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never configure Speed::UltraFast with embassy-mcxa i2c","Restrict speed choices to Standard/Fast/FastPlus until HS support lands","Validate configs from shared codebases that may target other MCUs with HS support","Check the embassy-mcxa changelog before raising the bus speed"],"tags":["i2c","embedded","not-implemented","nxp","mcxa"],"backgroundTag":"unsupported-enum-value","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"}