$npx -y skills add easyzoom/aix-skills --skill cmsis-dsp-integrationUse when integrating, configuring, or debugging CMSIS-DSP, ARM math functions, FFT, filters, fixed-point DSP, vector math, or Cortex-M signal processing
| 1 | # CMSIS-DSP Integration |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | 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. |
| 6 | |
| 7 | ## When To Use |
| 8 | |
| 9 | Use this skill when: |
| 10 | |
| 11 | - The user wants CMSIS-DSP or ARM math functions on Cortex-M or Cortex-A/R targets. |
| 12 | - The task involves FFT, FIR/IIR filters, matrix math, statistics, PID, Q15/Q31/f32, or optimized vector operations. |
| 13 | - Results are wrong, saturated, NaN, too slow, or differ from desktop reference output. |
| 14 | |
| 15 | Do not use this skill for TinyML inference runtime integration. Use `tinymaix-integration` or ML-specific skills instead. |
| 16 | |
| 17 | ## First Questions |
| 18 | |
| 19 | Ask for: |
| 20 | |
| 21 | - MCU/core, FPU/DSP extension, compiler, and build flags. |
| 22 | - CMSIS-DSP version and how it is included. |
| 23 | - Function family and data type: f32, f16, q7, q15, q31, or mixed. |
| 24 | - Input range, expected output, reference data, and buffer sizes. |
| 25 | - Whether performance, code size, or accuracy is the primary goal. |
| 26 | |
| 27 | ## Integration Checklist |
| 28 | |
| 29 | 1. Match core flags. |
| 30 | Compiler options must match FPU, ABI, and DSP extensions. |
| 31 | |
| 32 | 1. Choose numeric format deliberately. |
| 33 | Fixed-point Q formats need scaling, saturation, and headroom analysis. |
| 34 | |
| 35 | 1. Validate buffers. |
| 36 | FFT/filter/state buffers must be sized and aligned as required. |
| 37 | |
| 38 | 1. Compare with golden vectors. |
| 39 | Use known input/output before live sensor data. |
| 40 | |
| 41 | 1. Measure performance on target. |
| 42 | Desktop estimates do not prove MCU timing. |
| 43 | |
| 44 | ## Common Failures |
| 45 | |
| 46 | - FPU ABI mismatch between objects. |
| 47 | - Q15/Q31 overflow from missing scaling. |
| 48 | - FFT length or bit-reversal config wrong. |
| 49 | - Filter state buffer too small. |
| 50 | - Cache/DMA buffer incoherency around ADC/audio data. |
| 51 | - Reference output uses different normalization. |
| 52 | |
| 53 | ## Verification |
| 54 | |
| 55 | Before claiming CMSIS-DSP works: |
| 56 | |
| 57 | - State core, build flags, data type, function, and buffer sizes. |
| 58 | - Confirm golden-vector output within tolerance. |
| 59 | - Confirm no saturation/NaN unless expected. |
| 60 | - Report runtime cycles/time if performance is in scope. |
| 61 | |
| 62 | ## Example |
| 63 | |
| 64 | User: |
| 65 | |
| 66 | ```text |
| 67 | CMSIS-DSP 做 FFT 结果不对。 |
| 68 | ``` |
| 69 | |
| 70 | Agent: |
| 71 | |
| 72 | 1. Asks for core flags, FFT length, data type, input scaling, and reference output. |
| 73 | 1. Checks buffer sizes and normalization. |
| 74 | 1. Verifies with a single-tone golden vector before live ADC data. |