{"record":{"id":"7a4fe7cc8e374214","repo":"embassy-rs/embassy","slug":"unknown-usb-core-id-x","errorCode":null,"errorMessage":"Unknown USB core id {:X}","messagePattern":"Unknown USB core id (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"embassy-stm32/src/usb/otg.rs","lineNumber":405,"sourceCode":"            });\n        }\n\n        let r = T::regs();\n        let core_id = r.cid().read().0;\n        trace!(\"Core id {:08x}\", core_id);\n\n        // Wait for AHB ready.\n        while !r.grstctl().read().ahbidl() {}\n\n        // Configure as device.\n        self.inner.configure_as_device();\n\n        // Configuring Vbus sense and SOF output\n        match core_id {\n            0x0000_1200 | 0x0000_1100 | 0x0000_1000 => self.inner.config_v1(),\n            0x0000_2000 | 0x0000_2100 | 0x0000_2300 | 0x0000_3000 | 0x0000_3100 => self.inner.config_v2v3(),\n            0x0000_5000 | 0x0000_6100 => self.inner.config_v5(),\n            _ => unimplemented!(\"Unknown USB core id {:X}\", core_id),\n        }\n    }\n\n    fn disable(&mut self) {\n        if !self.inited {\n            return;\n        }\n\n        T::Interrupt::disable();\n\n        #[cfg(all(stm32wba, peri_usb_otg_hs))]\n        {\n            debug!(\"disabling OTG clocks\");\n            crate::pac::SYSCFG.otghsphycr().modify(|w| w.set_en(false));\n            critical_section::with(|_| {\n                crate::pac::RCC.ahb2enr().modify(|w| w.set_usb_otg_hs_phyen(false));\n                crate::pac::PWR.vosr().modify(|w| {\n                    w.set_usbboosten(false);","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/embassy-rs/embassy/blob/463a07b963419a1bfe61d5d597c44acb810afb8b/embassy-stm32/src/usb/otg.rs#L387-L423","documentation":"embassy-stm32's OTG USB driver reads the core ID register during init and dispatches configuration by known Synopsys OTG core versions (v1.x, v2/v3, v5). If the hardware reports a core ID outside the known set, it panics with \"Unknown USB core id\". This means the chip's USB peripheral is not one of the OTG cores the driver recognizes.","triggerScenarios":"Booting a USB application (Device or Host) on an STM32 whose OTG peripheral reports an unrecognized GSNPSID core-id value, causing the _ arm of the match in otg.rs init to panic.","commonSituations":"Running embassy on a new/rare STM32 variant (or a clone/simulated chip) whose OTG core revision isn't in the driver's known list; enabling the usb feature for a chip family not yet validated by embassy-stm32.","solutions":["Print/inspect the core_id value and compare against the known list (0x1000-0x1200, 0x2000-0x3100, 0x5000/0x6100)","Update embassy-stm32 to the latest version; new core IDs are added as chips are validated","Verify you are targeting the correct USB peripheral instance for your chip (OTG_HS vs OTG_FS vs USB) in your board support code","File an upstream issue with your chip model and reported core id so the variant can be added"],"exampleFix":"// before: unknown core id panics in init\n// after: assert the peripheral you bind is the right one\nlet usb = embassy_stm32::usb::UsbDevice::new(\n    p.USB_OTG_FS, // correct instance for your chip\n    vbus_detect, ep_out_buffer, config,\n);","handlingStrategy":"validation","validationCode":"// Verify your chip's OTG core id is in the supported set before enabling the usb driver\nconst KNOWN_CORE_IDS: [u32; 9] = [0x1200, 0x1100, 0x1000, 0x2000, 0x2100, 0x2300, 0x3000, 0x3100, 0x5000, 0x6100 - 1]; // see driver list\n// On target, before driver init:\n// let core_id = otg_global.gsnpsid().read().0;\n// assert!(matches!(core_id, 0x0000_1000..=0x0000_1200 | 0x0000_2000..=0x0000_3100 | 0x0000_5000 | 0x0000_6100));","typeGuard":null,"tryCatchPattern":"// Read GSNPSID early and panic with a diagnostic instead of the raw driver panic\nlet core_id = unsafe { pac::OTG_HS_GLOBAL.gsnpsid().read().0 };\nassert!(core_id == 0x0000_5000 || core_id == 0x0000_6100, \"unsupported OTG core id {:X}\", core_id);","preventionTips":["Use embassy-stm32's usb driver only on chips listed as supported in its docs/CIs","Bind the correct USB peripheral instance for your exact chip model","Test USB bring-up on real hardware immediately after enabling the feature","Report unknown core ids upstream with the chip's full part number"],"tags":["embedded","stm32","usb","otg","panic"],"backgroundTag":"unsupported-platform","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"}