DMA & Bus Arbitration

# DMA Bandwidth & FIFO Overrun Calculator

Estimate DMA throughput, bus utilization percent, half-transfer interrupt deadlines and peripheral FIFO headroom before locking your memory map.

DMA / AHB bus clock (MHz)e.g. 72 MHz F1, 168 MHz F4, 216 MHz F7, 240 MHz H7 AXI

Beat width (bytes)8-bit (1 byte)16-bit (2 bytes)32-bit (4 bytes)

Burst size (beats)Single (1 beat)INCR4 (4 beats)INCR8 (8 beats)INCR16 (16 beats)

AHB cycles per beat (read + write)STM32 DMA typically spends 4-6 AHB cycles per P2M beat

Per-channel sample rate (kSPS)

Active channels / streams

Buffer depth (samples / channel)

Peripheral FIFO depth (bytes)STM32 DMA FIFO is 16 bytes (4 words); SPI DR is 2-4 bytes

Workload presets:

Healthy bus headroom: 8.80% DMA utilization with 22.7x FIFO service margin.

Sustained Throughput 3.81 MB/s Peak bus cap 43.4 MB/s

Bus Utilization 8.80% Excluding CPU instruction/data contention

Half / Full Buffer IRQ 2.05 ms 8.0 KB total; HT IRQ every 1024.0 us

FIFO Overrun Window 4.00 us Burst takes 176 ns (22.7x margin)

## Sizing DMA buffers and burst lengths

Large bursts lower bus arbitration overhead, yet they block lower-priority channels for longer windows. Keep burst sizes at `INCR4` when high-rate UART or SPI peripherals share the same AHB matrix as a display or camera stream.

| Metric          | Formula                                 | Target margin                                                   |
| --------------- | --------------------------------------- | --------------------------------------------------------------- |
| Sustained rate  | sample\_rate \* channels \* beat\_bytes | Keep under 35% of bus peak so CPU fetches stay unblocked.       |
| FIFO window     | fifo\_bytes / sustained\_rate           | Must exceed worst-case concurrent burst latency by at least 5x. |
| HT IRQ deadline | (buffer\_bytes / 2) / sustained\_rate   | Must exceed your worst-case DSP or ISR processing time.         |

## Frequently asked questions

| Question                                                                                   | Answer                                                                                                                                                                                                                                 |
| ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Why does a DMA stream trigger FIFO overrun even when average bus utilization is under 20%? | Overruns depend on peak bus latency rather than average bandwidth. If another high-priority DMA channel executes a 16-beat burst across a slow bus bridge, a 2-byte SPI or UART data register can overflow before arbitration returns. |
| How does double-buffered (ping-pong) DMA reduce missed interrupts?                         | Circular DMA fires a half-transfer interrupt when the first half fills and a transfer-complete interrupt at the end. Your CPU gets half the total buffer duration to process samples before DMA overwrites the same region.            |
| What extra step does Cortex-M7 require before reading DMA buffers?                         | Cortex-M7 cores with D-Cache enabled return stale SRAM data unless you place DMA buffers in a non-cacheable MPU region or call SCB\_InvalidateDCache\_by\_Addr() aligned to 32-byte cache lines.                                       |

[Board: NUCLEO-F103RB (DMA oracle)](https://circuittwin.ai/boards/nucleo-f103rb) [Board: NUCLEO-H743ZI2 (Cortex-M7)](https://circuittwin.ai/boards/nucleo-h743zi2) [Tool: SPI Clock Divider Calculator](https://circuittwin.ai/tools/spi-clock-divider-calculator) [Tool: STM32 PLL Clock Calculator](https://circuittwin.ai/tools/stm32-pll-clock-calculator)

> ## Catch DMA descriptor bugs and ISR races in headless CI
>
> Run your STM32 or nRF52 DMA firmware on deterministic board twins and inspect exact transfer completion traces without an oscilloscope.
>
> [Start now](https://app.circuittwin.ai/try) [Inspect NUCLEO-F103RB twin](https://circuittwin.ai/boards/nucleo-f103rb) [Connect a coding agent](https://circuittwin.ai/docs/agents)
