/dma-baremetal
Bare-metal DMA skill for memory-peripheral transfers. Use when configuring DMA channels, circular mode, double buffering, or DMA IRQ completion. Activates on queries about DMA bare-metal, circular buffer, memory-to-peripheral, or DMA stream configuration.
$ npx -y skills add mohitmishra786/low-level-dev-skills --skill dma-baremetal --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/dma-baremetal
Context preview
The summary Claude sees to decide when to auto-load this skill.
Bare-metal DMA skill for memory-peripheral transfers. Use when configuring DMA channels, circular mode, double buffering, or DMA IRQ completion. Activates on queries about DMA bare-metal, circular buffer, memory-to-peripheral, or DMA stream configuration.
SKILL.md
dma-baremetal.SKILL.mdname: dma-baremetal
description: Bare-metal DMA skill for memory-peripheral transfers. Use when configuring DMA channels, circular mode, double buffering, or DMA IRQ completion. Activates on queries about DMA bare-metal, circular buffer, memory-to-peripheral, or DMA stream configuration.
DMA (Bare-Metal)
Purpose
Configure DMA controllers for memory-to-peripheral and peripheral-to-memory transfers: channel/stream setup, burst sizes, circular mode, half-transfer interrupts, and cache coherency on Cortex-M7.
When to Use
- Offloading UART/SPI/ADC bulk transfers from CPU
- Audio/streaming double buffers
- Debugging DMA not triggering or corrupt data
Workflow
1. STM32 DMA2 stream (periph→mem)
/* UART2 RX DMA — Stream5, Channel 4 (verify RM matrix) */
RCC->AHB1ENR |= RCC_AHB1ENR_DMA1EN;
DMA1_Stream5->PAR = (uint32_t)&USART2->DR;
DMA1_Stream5->M0AR = (uint32_t)rx_buf;
DMA1_Stream5->NDTR = sizeof(rx_buf);
DMA1_Stream5->CR = DMA_SxCR_MINC /* mem increment */
| DMA_SxCR_TCIE /* transfer complete IRQ */
| DMA_SxCR_CHSEL_2 /* channel 4 */
| DMA_SxCR_EN;
USART2->CR3 |= USART_CR3_DMAR;2. Circular / double buffer
DMA1_Stream5->CR |= DMA_SxCR_CIRC; /* auto-reload NDTR */
/* HTIF = first half, TCIF = second half — process in IRQ */
3. Cortex-M7 cache (H7)
DMA buffer in non-cacheable region or clean/invalidate D-Cache:
SCB_CleanDCache_by_Addr((void*)tx_buf, len);
/* after DMA TX */
SCB_InvalidateDCache_by_Addr((void*)rx_buf, len);
4. Agent usage
/dma-baremetal Configure UART RX DMA circular buffer on STM32F4
Common Problems
| Symptom | Cause | Fix | |---------|-------|-----| | DMA no start | Stream/channel mismatch | RM DMA request mapping table | | Corrupt RX | Cache coherency (M7) | Invalidate after RX complete | | NDTR stuck | Peripheral DMA enable missing | USART_CR3 DMAR/DMAT | | IRQ flood | Clear flags in ISR | `DMA_LISR`/`HIFCR` |
Related Skills
- `skills/baremetal/uart-serial-baremetal` — USART DMA enable
- `skills/baremetal/adc-dac-baremetal` — ADC DMA mode
- `skills/low-level-programming/cpu-cache-opt` — cache line concepts
Read more
name: dma-baremetal description: Bare-metal DMA skill for memory-peripheral transfers. Use when configuring DMA channels, circular mode, double buffering, or DMA IRQ completion. Activates on queries about DMA bare-metal, circular buffer, memory-to-peripheral, or DMA stream configuration.
DMA (Bare-Metal)
Purpose
Configure DMA controllers for memory-to-peripheral and peripheral-to-memory transfers: channel/stream setup, burst sizes, circular mode, half-transfer interrupts, and cache coherency on Cortex-M7.
When to Use
- Offloading UART/SPI/ADC bulk transfers from CPU
- Audio/streaming double buffers
- Debugging DMA not triggering or corrupt data
Workflow
1. STM32 DMA2 stream (periph→mem)
/* UART2 RX DMA — Stream5, Channel 4 (verify RM matrix) */
RCC->AHB1ENR |= RCC_AHB1ENR_DMA1EN;
DMA1_Stream5->PAR = (uint32_t)&USART2->DR;
DMA1_Stream5->M0AR = (uint32_t)rx_buf;
DMA1_Stream5->NDTR = sizeof(rx_buf);
DMA1_Stream5->CR = DMA_SxCR_MINC /* mem increment */
| DMA_SxCR_TCIE /* transfer complete IRQ */
| DMA_SxCR_CHSEL_2 /* channel 4 */
| DMA_SxCR_EN;
USART2->CR3 |= USART_CR3_DMAR;2. Circular / double buffer
DMA1_Stream5->CR |= DMA_SxCR_CIRC; /* auto-reload NDTR */ /* HTIF = first half, TCIF = second half — process in IRQ */
3. Cortex-M7 cache (H7)
DMA buffer in non-cacheable region or clean/invalidate D-Cache:
SCB_CleanDCache_by_Addr((void*)tx_buf, len); /* after DMA TX */ SCB_InvalidateDCache_by_Addr((void*)rx_buf, len);
4. Agent usage
/dma-baremetal Configure UART RX DMA circular buffer on STM32F4
Common Problems
| Symptom | Cause | Fix | |---------|-------|-----| | DMA no start | Stream/channel mismatch | RM DMA request mapping table | | Corrupt RX | Cache coherency (M7) | Invalidate after RX complete | | NDTR stuck | Peripheral DMA enable missing | USART_CR3 DMAR/DMAT | | IRQ flood | Clear flags in ISR | `DMA_LISR`/`HIFCR` |
Related Skills
- `skills/baremetal/uart-serial-baremetal` — USART DMA enable
- `skills/baremetal/adc-dac-baremetal` — ADC DMA mode
- `skills/low-level-programming/cpu-cache-opt` — cache line concepts
A curated suite of AI agent skills for systems and low-level programming — C/C++, Rust, Zig, GPU, bare-metal firmware, Linux kernel/driver development, computer architecture, compiler internals, HPC, and more.
Repo: mohitmishra786/low-level-dev-skills
Other skills on low-level-dev-skills.
- /custom-allocators
Custom allocator skill for memory allocation strategies. Use when implementing pool/slab/arena allocators, tuning jemalloc/mimalloc, writing Rust GlobalAlloc, or benchmarking allocator performance. Activates on queries about jemalloc, mimalloc, tcmalloc, arena allocator,
Open skill - /numa-programming
NUMA programming skill for multi-socket memory locality. Use when detecting NUMA topology, binding processes with numactl, using libnuma API, building NUMA-aware data structures, or measuring remote access penalties. Activates on queries about numactl, libnuma, NUMA topology,
Open skill - /af-xdp
AF_XDP skill for high-performance XDP sockets. Use when creating AF_XDP sockets, configuring UMEM and XSK rings, XDP_REDIRECT programs, copy vs zero-copy mode, or comparing with DPDK. Activates on queries about AF_XDP, xsk_umem, XDP_REDIRECT, libbpf xsk, or zero-copy XDP.
Open skill - /dpdk
DPDK skill for userspace packet I/O. Use when initializing EAL, configuring PMD drivers, using mbuf pools and rte_ring, setting up huge pages, RSS, or testpmd validation. Activates on queries about DPDK, EAL, rte_eth_rx_burst, hugepages, PMD, or testpmd.
Open skill - /io-uring
io_uring skill for Linux async I/O. Use when building high-performance servers with liburing, multi-shot operations, provided buffers, fixed files, zero-copy send, or tokio-uring. Activates on queries about io_uring, SQE/CQE, liburing, IORING_OP_PROVIDE_BUFFERS, or io_uring vs
Open skill - /adc-dac-baremetal
Bare-metal ADC and DAC skill. Use when configuring analog sampling, DMA-driven ADC, calibration, or DAC output on MCUs. Activates on queries about ADC bare-metal, sampling time, DMA ADC, or DAC channel setup.
Open skill

