embassy-rs/embassy · critical

DMA: user settings error on DMA@

Error message

DMA: user settings error on DMA@{:08x} channel {}

What it means

The GPDMA channel IRQ handler found the user settings error flag (USEF) set: the channel's programmed user settings (e.g. secure/privileged attribute or other policy bits) conflict with the actual access performed. The driver panics because the configured settings are invalid for the transaction.

Solutions

  1. Ensure the DMA channel's security/privilege attributes match the executing context
  2. Initialize channels from the same security world that runs the transfer
  3. Reset/claim the channel before configuring and check no prior settings linger
  4. Consult the reference manual's GPDMA security/privilege chapter for your chip
Defensive patterns

Strategy: validation

Validate before calling

// Before starting transfers, ensure the channel is configured in the same security world:
// read GPDMA SEC/PRIV channel attributes and compare with current execution mode (NS/CPUID checks).

Prevention

When it happens

Trigger: Transfer configured with settings not permitted in the current security/privilege context (e.g. secure channel access from non-secure code, or TrustZone policy mismatch); channel settings registers modified inconsistently.

Common situations: Mixed secure/non-secure (TrustZone) STM32 configurations where the DMA channel is owned by the other world; enabling GPDMA channels with security attributes set by bootloader code.

Related errors


AI-assisted analysis of embassy-rs/embassy@463a07b963 (2026-09-10). Data as JSON: /api/errors/0db3713623c01a95. Report an issue: GitHub.

Appendix: source

Thrown at embassy-stm32/src/dma/gpdma/mod.rs:569

    {
        use embassy_hal_internal::interrupt::InterruptExt as _;
        info.irq.enable();
    }

    let state = &STATE[channel as usize];

    let ch = info.dma.ch(info.num);
    let sr = ch.sr().read();

    if sr.dtef() {
        panic!(
            "DMA: data transfer error on DMA@{:08x} channel {}",
            info.dma.cast().as_ptr() as u32,
            info.num
        );
    }
    if sr.usef() {
        panic!(
            "DMA: user settings error on DMA@{:08x} channel {}",
            info.dma.cast().as_ptr() as u32,
            info.num
        );
    }
    if sr.ulef() {
        panic!(
            "DMA: link transfer error on DMA@{:08x} channel {}",
            info.dma.cast().as_ptr() as u32,
            info.num
        );
    }

    if sr.htf() {
        ch.fcr().write(|w| w.set_htf(true));
    }

    if sr.tcf() {

View on GitHub (pinned to 463a07b963)