embassy-rs/embassy · error
failed to find dma interrupt for channel
Error message
failed to find dma interrupt for channel {} What it means
While generating DMA channel traits, build.rs maps each DMA channel to its interrupt (IRQ) name via a `dma_ch_to_irq` lookup built from chip metadata. If a DMA channel has no associated interrupt entry, the script panics naming the channel. It indicates a gap in the chip's interrupt/DMA metadata, so the channel can't be wired to an interrupt handler.
Solutions
- Check embassy-stm32's per-chip metadata and add the missing DMA-channel-to-interrupt mapping.
- Verify you're on the latest embassy-stm32 — the chip's metadata may have been fixed upstream.
- As a workaround, use a different DMA channel whose interrupt mapping exists.
Example fix
// metadata: ch "GPDMA1_CHANNEL7" has no IRQ entry
// before (chip data): { name: "GPDMA1_CHANNEL7", ... } // no irq
// after: add "GPDMA1_CHANNEL7" => ["GPDMA1_CHANNEL7"] to the dma irq mapping Defensive patterns
Strategy: validation
Validate before calling
// check the chip's DMA channel -> IRQ mapping exists before using that channel // in embassy-stm32 data: dma_ch_to_irq must contain ch.name
Prevention
- Use DMA channels known to be wired to interrupts on your chip.
- Update embassy-stm32 when adding support for a new MCU to pick up metadata fixes.
- Validate per-chip metadata (channel/interrupt tables) when onboarding a new STM32 part.
When it happens
Trigger: Building with DMA for a chip whose metadata lists a DMA/GPDMA/LPDMA channel without any matching interrupt in the interrupt table, so `.get(ch.name).and_then(|v| v.first())` is None.
Common situations: Newly added STM32 parts with incomplete DMA-to-IRQ metadata; channels shared across cores (dual-core parts) where the mapping wasn't populated.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- bad dma channel kind
- DMA data error
- Pin has no IOMUXC definitions
- DMA: error on DMA_0 channel
- DMA: error on DMA_0 channel
AI-assisted analysis of embassy-rs/embassy@463a07b963 (2026-09-10).
Data as JSON: /api/errors/55eec77c9886e8bc.
Report an issue: GitHub.
Appendix: source
Thrown at embassy-stm32/build.rs:2684
let stop_mode = dma_peri
.rcc
.as_ref()
.map(|rcc| rcc.stop_mode.clone())
.unwrap_or_default();
let stop_mode = match stop_mode {
StopMode::Standby => quote! { Standby },
StopMode::Stop2 => quote! { Stop2 },
StopMode::Stop1 => quote! { Stop1 },
};
let name = format_ident!("{}", ch.name);
// Get the interrupt type for this DMA channel
let irq_name = dma_ch_to_irq
.get(ch.name)
.and_then(|v| v.first())
.unwrap_or_else(|| panic!("failed to find dma interrupt for channel {}", ch.name));
let irq_ident = format_ident!("{}", irq_name);
let irq_type = quote!(crate::interrupt::typelevel::#irq_ident);
#[cfg(feature = "_dual-core")]
let irq_pac = quote!(crate::pac::Interrupt::#irq_ident);
g.extend(quote!(dma_channel_impl!(#name, #irq_type);));
if ch.supports_2d.unwrap_or(false) {
g.extend(quote!(dma_channel_2d_impl!(#name);));
}
let dma = format_ident!("{}", ch.dma);
let ch_num = ch.channel as usize;
let bi = dma_peri.registers.as_ref().unwrap();
if ch.supports_2d.unwrap_or(false) && bi.kind == "gpdma" {
has_gpdma_2d = true;View on GitHub (pinned to 463a07b963)