CMSIS-DSP Integration
Overview
Use this skill to integrate CMSIS-DSP by matching the target core, FPU/DSP extensions, data type, scaling, and buffer alignment. DSP bugs often come from numeric format and build flags rather than function calls.
When To Use
Use this skill when:
- The user wants CMSIS-DSP or ARM math functions on Cortex-M or Cortex-A/R targets.
- The task involves FFT, FIR/IIR filters, matrix math, statistics, PID, Q15/Q31/f32, or optimized vector operations.
- Results are wrong, saturated, NaN, too slow, or differ from desktop reference output.
Do not use this skill for TinyML inference runtime integration. Use tinymaix-integration or ML-specific skills instead.
First Questions
Ask for:
- MCU/core, FPU/DSP extension, compiler, and build flags.
- CMSIS-DSP version and how it is included.
- Function family and data type: f32, f16, q7, q15, q31, or mixed.
- Input range, expected output, reference data, and buffer sizes.
- Whether performance, code size, or accuracy is the primary goal.
Integration Checklist
Match core flags.
Compiler options must match FPU, ABI, and DSP extensions.
Choose numeric format deliberately.
Fixed-point Q formats need scaling, saturation, and headroom analysis.
Validate buffers.
FFT/filter/state buffers must be sized and aligned as required.
Compare with golden vectors.
Use known input/output before live sensor data.
Measure performance on target.
Desktop estimates do not prove MCU timing.
Common Failures
- FPU ABI mismatch between objects.
- Q15/Q31 overflow from missing scaling.
- FFT length or bit-reversal config wrong.
- Filter state buffer too small.
- Cache/DMA buffer incoherency around ADC/audio data.
- Reference output uses different normalization.
Verification
Before claiming CMSIS-DSP works:
- State core, build flags, data type, function, and buffer sizes.
- Confirm golden-vector output within tolerance.
- Confirm no saturation/NaN unless expected.
- Report runtime cycles/time if performance is in scope.
Example
User:
CMSIS-DSP 做 FFT 结果不对。
Agent:
- Asks for core flags, FFT length, data type, input scaling, and reference output.
- Checks buffer sizes and normalization.
- Verifies with a single-tone golden vector before live ADC data.
1---2name: cmsis-dsp-integration3description: Use when integrating, configuring, or debugging CMSIS-DSP, ARM math functions, FFT, filters, fixed-point DSP, vector math, or Cortex-M signal processing4---56# CMSIS-DSP Integration78## Overview910Use this skill to integrate CMSIS-DSP by matching the target core, FPU/DSP extensions, data type, scaling, and buffer alignment. DSP bugs often come from numeric format and build flags rather than function calls.1112## When To Use1314Use this skill when:1516- The user wants CMSIS-DSP or ARM math functions on Cortex-M or Cortex-A/R targets.17- The task involves FFT, FIR/IIR filters, matrix math, statistics, PID, Q15/Q31/f32, or optimized vector operations.18- Results are wrong, saturated, NaN, too slow, or differ from desktop reference output.1920Do not use this skill for TinyML inference runtime integration. Use `tinymaix-integration` or ML-specific skills instead.2122## First Questions2324Ask for:2526- MCU/core, FPU/DSP extension, compiler, and build flags.27- CMSIS-DSP version and how it is included.28- Function family and data type: f32, f16, q7, q15, q31, or mixed.29- Input range, expected output, reference data, and buffer sizes.30- Whether performance, code size, or accuracy is the primary goal.3132## Integration Checklist33341. Match core flags.35 Compiler options must match FPU, ABI, and DSP extensions.36371. Choose numeric format deliberately.38 Fixed-point Q formats need scaling, saturation, and headroom analysis.39401. Validate buffers.41 FFT/filter/state buffers must be sized and aligned as required.42431. Compare with golden vectors.44 Use known input/output before live sensor data.45461. Measure performance on target.47 Desktop estimates do not prove MCU timing.4849## Common Failures5051- FPU ABI mismatch between objects.52- Q15/Q31 overflow from missing scaling.53- FFT length or bit-reversal config wrong.54- Filter state buffer too small.55- Cache/DMA buffer incoherency around ADC/audio data.56- Reference output uses different normalization.5758## Verification5960Before claiming CMSIS-DSP works:6162- State core, build flags, data type, function, and buffer sizes.63- Confirm golden-vector output within tolerance.64- Confirm no saturation/NaN unless expected.65- Report runtime cycles/time if performance is in scope.6667## Example6869User:7071```text72CMSIS-DSP 做 FFT 结果不对。73```7475Agent:76771. Asks for core flags, FFT length, data type, input scaling, and reference output.781. Checks buffer sizes and normalization.791. Verifies with a single-tone golden vector before live ADC data.