Meaning
Functional failure where a peripheral device writes data to an incorrect memory location without the processor intervening. Direct memory access corruption occurs when the address registers in a dma controller are misconfigured or when a buffer overflow happens at the hardware level. This results in the overwriting of critical kernel data or application variables.
Memory Violation
Corruption often happens because a dma transfer is started with an incorrect length or destination pointer. Because the processor is bypassed, the standard memory protection checks might not catch the error in real time. The direct memory access corruption is usually only discovered when the system crashes or exhibits unstable behavior.
System Instability
Crashes caused by these events are difficult to debug because the source of the write is not an instruction. Tracing the event requires hardware logic analyzers to monitor the bus activity. A direct memory access corruption can lead to the permanent loss of data in flash memory if the controller writes to a storage buffer.
Protection Mechanism
Modern microcontrollers use specialized units to restrict where a peripheral can write. These units check every dma request against a set of allowed address ranges. If a violation is detected, the transfer is blocked and an interrupt is raised.