{"record":{"id":"72943d4da859a6af","repo":"embassy-rs/embassy","slug":"not-implemented-72943d","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"embassy-stm32/src/dma/dma_bdma.rs","lineNumber":273,"sourceCode":"        }\n    }\n}\n\n#[cfg(dma)]\npub use dma_only::*;\n#[cfg(dma)]\nmod dma_only {\n    use pac::dma::vals;\n\n    use super::*;\n\n    impl From<WordSize> for vals::Size {\n        fn from(raw: WordSize) -> Self {\n            match raw {\n                WordSize::OneByte => Self::Bits8,\n                WordSize::TwoBytes => Self::Bits16,\n                WordSize::FourBytes => Self::Bits32,\n                WordSize::EightBytes => unimplemented!(),\n            }\n        }\n    }\n\n    impl From<Dir> for vals::Dir {\n        fn from(raw: Dir) -> Self {\n            match raw {\n                Dir::MemoryToPeripheral => Self::MemoryToPeripheral,\n                Dir::PeripheralToMemory => Self::PeripheralToMemory,\n                Dir::MemoryToMemory => Self::MemoryToMemory,\n            }\n        }\n    }\n\n    /// DMA transfer burst setting.\n    #[derive(Debug, Copy, Clone, PartialEq, Eq)]\n    #[cfg_attr(feature = \"defmt\", derive(defmt::Format))]\n    pub enum Burst {","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/embassy-rs/embassy/blob/463a07b963419a1bfe61d5d597c44acb810afb8b/embassy-stm32/src/dma/dma_bdma.rs#L255-L291","documentation":"From<WordSize> for vals::Size maps byte widths to DMA transfer sizes, supporting 1, 2, and 4 bytes; EightBytes falls through to unimplemented! because DMA1/DMA2 (dma_bdma) hardware only supports 8/16/32-bit transfers. Passing WordSize::EightBytes to a DMA transfer on these controllers panics.","triggerScenarios":"Constructing a DMA transfer (e.g. Transfer::new with a Word-size generic or buffer of u64) whose WordSize is EightBytes on a DMA/BDMA channel.","commonSituations":"Using u64-typed buffers with DMA on STM32 DMA1/DMA2 or B DMA channels, where the hardware simply lacks a 64-bit transfer size option.","solutions":["Use buffers of u8/u16/u32 instead of u64 for DMA transfers on dma_bdma channels","Switch to a DMA peripheral that supports 64-bit transfers if 8-byte words are required (e.g. MDMA on H7)","Change WordSize::EightBytes handling to return a Result/panic with a clear message","Split 64-bit data into two 32-bit transfers"],"exampleFix":"// before\nlet transfer = Transfer::new(dma.ch1, request, buf_u64, p.clock); // WordSize::EightBytes\n// after\nlet buf: &mut [u32] = /* retype buffer */;\nlet transfer = Transfer::new(dma.ch1, request, buf, p.clock); // 32-bit words","handlingStrategy":"validation","validationCode":"fn dma_word_ok<T>() -> bool { matches!(core::mem::size_of::<T>(), 1 | 2 | 4) }","typeGuard":"const fn supports_word_size(bytes: usize) -> bool { matches!(bytes, 1 | 2 | 4) }","tryCatchPattern":null,"preventionTips":["Use u8/u16/u32 DMA buffers on dma_bdma channels; never u64","Check which DMA controller (DMA/BDMA vs MDMA) supports 8-byte words on your part"],"tags":["rust","embedded","stm32","dma","word-size"],"backgroundTag":"unsupported-dtype","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"}