{"record":{"id":"0db3713623c01a95","repo":"embassy-rs/embassy","slug":"dma-user-settings-error-on-dma-08x-channel","errorCode":null,"errorMessage":"DMA: user settings error on DMA@{:08x} channel {}","messagePattern":"DMA: user settings error on DMA@(.+?) channel (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"embassy-stm32/src/dma/gpdma/mod.rs","lineNumber":569,"sourceCode":"    {\n        use embassy_hal_internal::interrupt::InterruptExt as _;\n        info.irq.enable();\n    }\n\n    let state = &STATE[channel as usize];\n\n    let ch = info.dma.ch(info.num);\n    let sr = ch.sr().read();\n\n    if sr.dtef() {\n        panic!(\n            \"DMA: data transfer error on DMA@{:08x} channel {}\",\n            info.dma.cast().as_ptr() as u32,\n            info.num\n        );\n    }\n    if sr.usef() {\n        panic!(\n            \"DMA: user settings error on DMA@{:08x} channel {}\",\n            info.dma.cast().as_ptr() as u32,\n            info.num\n        );\n    }\n    if sr.ulef() {\n        panic!(\n            \"DMA: link transfer error on DMA@{:08x} channel {}\",\n            info.dma.cast().as_ptr() as u32,\n            info.num\n        );\n    }\n\n    if sr.htf() {\n        ch.fcr().write(|w| w.set_htf(true));\n    }\n\n    if sr.tcf() {","sourceCodeStart":551,"sourceCodeEnd":587,"githubUrl":"https://github.com/embassy-rs/embassy/blob/463a07b963419a1bfe61d5d597c44acb810afb8b/embassy-stm32/src/dma/gpdma/mod.rs#L551-L587","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Ensure the DMA channel's security/privilege attributes match the executing context","Initialize channels from the same security world that runs the transfer","Reset/claim the channel before configuring and check no prior settings linger","Consult the reference manual's GPDMA security/privilege chapter for your chip"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before starting transfers, ensure the channel is configured in the same security world:\n// read GPDMA SEC/PRIV channel attributes and compare with current execution mode (NS/CPUID checks).","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure and run DMA channels from the same TrustZone world that owns them","Avoid reusing channels left configured by the bootloader","Reset the channel before reconfiguring","Review the chip's GPDMA security/privilege documentation"],"tags":["dma","embedded","stm32","trustzone","panic"],"backgroundTag":"dma-bus-error","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"}