{"record":{"id":"cbe80fb396838eb1","repo":"embassy-rs/embassy","slug":"unrecognized-rx-error","errorCode":null,"errorMessage":"unrecognized rx error","messagePattern":"unrecognized rx error","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"embassy-nxp/src/usart/lpc55.rs","lineNumber":412,"sourceCode":"            }\n        };\n\n        // If we got no error, just return at this point\n        if !errors {\n            return Ok(());\n        }\n\n        // If we DID get an error, we need to figure out which one it was.\n        if self.info.usart_reg.intstat().read().framerrint() {\n            return Err(Error::Framing);\n        } else if self.info.usart_reg.intstat().read().parityerrint() {\n            return Err(Error::Parity);\n        } else if self.info.usart_reg.intstat().read().rxnoiseint() {\n            return Err(Error::Noise);\n        } else if self.info.usart_reg.fifointstat().read().rxerr() {\n            return Err(Error::Overrun);\n        }\n        unreachable!(\"unrecognized rx error\");\n    }\n}\n\nimpl<'d> Usart<'d, Blocking> {\n    pub fn new_blocking<T: Instance>(\n        usart: Peri<'d, T>,\n        tx: Peri<'d, impl TxPin<T>>,\n        rx: Peri<'d, impl RxPin<T>>,\n        config: Config,\n    ) -> Self {\n        let tx_func = tx.pin_func();\n        let rx_func = rx.pin_func();\n\n        Self::new_inner(usart, tx.into(), tx_func, rx.into(), rx_func, false, None, None, config)\n    }\n}\n\nimpl<'d> Usart<'d, Async> {","sourceCodeStart":394,"sourceCodeEnd":430,"githubUrl":"https://github.com/embassy-rs/embassy/blob/463a07b963419a1bfe61d5d597c44acb810afb8b/embassy-nxp/src/usart/lpc55.rs#L394-L430","documentation":"When an RX interrupt/status error fires on LPC55 USART, embassy-nxp maps each known status flag (parity, noise, overrun) to an Error variant. If none of the checked flags explains the interrupt, the driver has no mapping and hits `unreachable!`, meaning an unexpected/unhandled hardware error condition occurred.","triggerScenarios":"The USART error interrupt fires but `parityint` in INTSTAT and `rxerr` in FIFOINTSTAT are all clear, so the exhaustive if/else-if chain in `read()` falls through to `unreachable!`.","commonSituations":"Reading on a UART whose error interrupt was raised by a condition this driver version does not classify (e.g. a chip-variant-specific flag or spurious interrupt after FIFO reset); running on hardware/revision not covered by the driver's flag mapping.","solutions":["Update embassy-nxp to the latest version; the flag mapping may have been extended.","Check the periphq/fifointstat registers at the failure point and file an issue with the register values if no known flag is set.","Ensure error interrupts are enabled/expected only for the conditions the driver handles (parity, noise, overrun).","As a workaround, guard reads so the error path is only taken when a mapped flag is known to be set."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Panics are not catchable in embedded Rust; keep the read call isolated so a\n// panic cannot take down unrelated subsystems, and log before reading:\nmatch uart.read(&mut buf) {\n    Ok(n) => handle(n),\n    Err(e) => log::error!(\"usart rx error: {:?}\", e),\n}","preventionTips":["Enable only error interrupt sources the driver classifies (parity, noise, overrun)","Keep embassy-nxp updated for extended flag mappings","Avoid concurrent readers on the same USART instance","Capture INTSTAT/FIFOINTSTAT values when diagnosing before filing an issue"],"tags":["uart","embedded","panic","nxp","lpc55"],"backgroundTag":"internal-invariant-violation","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"}