| name | mspm0g3507-dev |
| description | Install the Windows command-line development environment, then develop, build, flash, debug, profile, calibrate, and validate TI MSPM0G3507 firmware using the MSPM0 SDK, SysConfig, DriverLib, GNU Arm toolchain, CMake, Ninja, CCS-compatible project artifacts, and J-Link. Use for new or existing MSPM0G3507/LP-MSPM0G3507/Tianmengxing projects; fresh-machine toolchain setup; AD9910 DDS wiring, power sequencing, single-tone/Profile/DRG/RAM control; `.syscfg` and `ti_msp_dl_config` work; clock/GPIO/timer/event/ADC12/DMA/OPA/UART/SPI/I2C configuration; Makefile and linker/startup problems; ELF/HEX/MAP generation; SWD flashing; No AHB-AP connection failures; live-memory and real-time diagnostics; Cortex-M0+ optimization; host waveform tests; calibration; and coherent result publication. |
MSPM0G3507 Development
Use a measurement-first, evidence-driven workflow from confirmed hardware routing through a reproducible build and target verification. Keep SysConfig, generated configuration, application logic, host tests, and debug artifacts separate.
First action
- Read project instructions and the current handoff/status document.
- Identify the current working firmware, build command,
*.syscfg, generated config, ELF/HEX/MAP, and confirmed hardware routing.
- On Windows, when the command-line environment is missing, preview the pinned installer before requesting explicit license acceptance:
python ~/.claude/skills/mspm0g3507-dev/scripts/install_environment.py plan --json
- Run environment discovery when tool paths or versions are not already verified:
python ~/.claude/skills/mspm0g3507-dev/scripts/inspect_environment.py \
--project <project-root> --json
- Find the closest installed SDK example before inventing peripheral setup from scratch:
python ~/.claude/skills/mspm0g3507-dev/scripts/find_examples.py \
adc dma timer event --sdk-root <sdk-root> --json
- Preserve confirmed pins, external feedback, clock sources, power order, and safety constraints. Do not silently redesign hardware.
- For AD9910 work on the Tianmengxing board, read ad9910-tianmengxing.md before assigning pins or diagnosing no output.
- For frequency, THD, harmonic, phase, or narrow-band measurement work, read spectral-measurement.md before changing the estimator.
- Classify the request as environment installation, configuration, implementation, build, flash, debug, calibration, performance, or acceptance work; execute only the minimum required path.
Non-negotiable rules
- Treat
MSPM0G3507, startup source, linker script, device define, and DriverLib family as one matched set.
- Keep the active SDK/tool versions fixed unless migration is explicitly requested. Online
latest may be newer than the installed project SDK and is not an automatic upgrade instruction.
- Never start environment installation implicitly. Run
plan first; install requires an explicit Windows request and --accept-licenses for the TI, Arm, Kitware/CMake, Ninja, and SEGGER terms. Only that install path may submit SEGGER's official license-acceptance form.
- Download only the pinned, component-specific official sources in
assets/windows-toolchain-manifest.json, including the approved TexasInstruments/mspm0-sdk fixed commit. Verify SHA-256 before extraction or execution, reject unsafe ZIP entries, and stop on the first failed component.
- Default to
%LOCALAPPDATA%/Programs/MSPM0G3507Dev. Never delete an existing tool directory automatically; --force permits only a vendor installer's documented in-place repair path. J-Link's all-users install and USB driver may require elevation.
- Edit
*.syscfg; do not make durable business-logic changes inside generated ti_msp_dl_config.c/.h.
- Verify actual timer/ADC/DMA behavior on hardware. A successful SysConfig generation or compile is not timing evidence.
- In repeat-disabled timer-event ADC mode, verify whether each result consumes conversion enable; explicitly re-arm after
MEM0_RESULT_LOADED when required, and never enable repeat mode without checking for free-run/IRQ storms.
- For finite FIFO-DMA capture, first freeze ADC DMA requests/channel state, then read the remaining count once; treat a stable count of 0 as the completed-buffer terminal state even if a trailing ADC overflow arrived.
- When switching one ADC between IRQ/event and FIFO-DMA modes, teardown and rebuild the complete timer/conversion/FIFO/DMA/interrupt state.
- Keep DMA/ADC ISR work bounded: acknowledge, sequence, pair/copy, enqueue, wake.
- Test hardware-independent algorithms on the host before target tuning. Promote real target failures into golden-vector regressions.
- Judge target performance with queue, sequence, DMA, and deadline counters-not host speed or code size alone.
- Enforce Flash/SRAM limits and a minimum SRAM headroom for stack/runtime state; link success alone is not memory acceptance.
- Calibrate from the signal measured at the MCU pin, not only a generator panel value or schematic ratio.
- Resolve live-debug addresses from the current MAP/ELF after every layout-affecting change.
Core workflow
0. Install the Windows command-line environment
The bundled installer provisions the pinned MSPM0 SDK, SysConfig, Arm GNU Toolchain, CMake, Ninja, and SEGGER J-Link stack without requiring CCS. It does not run during ordinary firmware work.
Preview paths, versions, licenses, download URLs, hashes, probes, and commands without network access:
python ~/.claude/skills/mspm0g3507-dev/scripts/install_environment.py plan --json
After the user has reviewed the plan and explicitly accepted all listed vendor licenses, install the complete stack:
python ~/.claude/skills/mspm0g3507-dev/scripts/install_environment.py install \
--accept-licenses --report <report.json> --json
Activate the installed environment in the current shell:
call "%LOCALAPPDATA%\Programs\MSPM0G3507Dev\activate.cmd"
# PowerShell alternative:
. "$env:LOCALAPPDATA\Programs\MSPM0G3507Dev\activate.ps1"
Verify an existing or newly installed stack without downloading or executing installers:
python ~/.claude/skills/mspm0g3507-dev/scripts/install_environment.py verify --json
The installer is Windows x64 only. It is fail-closed, version-pinned, SHA-256 verified, idempotent, and uses argument arrays without a shell. After all selected components verify, it writes activate.cmd, activate.ps1, and environment.json; it never changes persistent user or machine environment variables. Activate the desired shell explicitly. A failed or partial install is not usable until verify reports all six components.
1. Inventory and baseline
Locate:
Makefile, CMakeLists.txt, build.ninja, or IDE project
*.syscfg
syscfg/ti_msp_dl_config.c
syscfg/ti_msp_dl_config.h
src/
tests/
current ELF/HEX/MAP
flash/debug scripts
Build the existing baseline before editing when practical. Preserve a known-good HEX and use a new build directory for experiments.
Read workflow.md for the full bring-up, build, flash, debug, calibration, and archive procedure.
2. Configure peripherals
Use SysConfig for pinmux, clocks, event routing, ADC12, DMA, timers, OPA, GPIO, UART, SPI, and I2C. Review generated code after regeneration.
For ADC/DMA/event/OPA or real-time work, read peripherals-and-realtime.md before editing.
For a new peripheral implementation, start from the bundled peripheral templates. The template set covers UART IRQ/DMA, SPI controller polling/DMA, I2C controller IRQ/repeated START, ADC12 single/timer/FIFO-DMA/dual-event-DMA, standalone DMA, and OPA buffer/PGA/ADC13/runtime reconfiguration. Copy only the required family, resolve every TODO, regenerate with the matching SDK product, and validate on target. Treat the dual-ADC event/DMA composition as exploration-only until its documented SysConfig warnings are resolved against the TRM and hardware.
Validate in layers:
clock -> timer/event -> one ADC -> one DMA -> paired ADC/DMA
-> queue -> algorithm -> deferred work -> published result
3. Build reproducibly
Prefer a command-line build that emits all of:
app.elf
app.hex
app.map
arm-none-eabi-size output
Use Makefile.gcc.template when a GCC Makefile is missing. Override SDK/GCC/SysConfig roots instead of rewriting the template for every machine.
After building, check warnings, text/data/bss, artifact timestamps, and linker-map symbols.
For a fail-closed one-command path, copy and customize project-config.example.json, then preview before executing:
python ~/.claude/skills/mspm0g3507-dev/scripts/mspm0_workflow.py plan \
--project <project-root> --config <project-config.json> --json
Build without hardware access:
python ~/.claude/skills/mspm0g3507-dev/scripts/mspm0_workflow.py build \
--project <project-root> --config <project-config.json> \
--report <project-root>/build/workflow-report.json --json
Build, flash, verify, reset, and run only when the user has explicitly authorized the target operation:
python ~/.claude/skills/mspm0g3507-dev/scripts/mspm0_workflow.py all \
--project <project-root> --config <project-config.json> \
--probe-serial <serial> --report <project-root>/build/workflow-report.json --json
The workflow uses command arrays without a shell, validates the exact configured ELF/HEX/MAP set, records SHA-256 hashes, enforces configured Flash/SRAM/headroom limits, rechecks files immediately before flashing, stages Unicode-path firmware through a hash-verified ASCII path when needed, rejects destructive J-Link commands, and requires connect/program/verify/reset/run evidence. Any failed prerequisite prevents flashing.
4. Run host tests
For signal processing, control math, filters, protocols, or result state machines:
- compile portable modules on the host;
- generate deterministic synthetic inputs;
- preserve field-failure ADC dumps as versioned golden vectors;
- compare the same vector through a high-precision reference, production host C, and target output;
- test nominal, boundary, invalid, clipping, offset, frequency, phase, delay, and publication cases;
- encode physical invariants such as
|P| <= S and sequence consistency;
- rerun after every optimization.
If Windows has no gcc, use MSVC through vcvars64.bat rather than skipping tests.
5. Resolve symbols from the current build
Use:
python ~/.claude/skills/mspm0g3507-dev/scripts/map_symbols.py \
build/app.map \
gResult:24:32 gDiagnostics:8:32 gDMABuffer:256:16 \
--json
Add --jlink-output build/read-live.jlink to generate memory reads. Never reuse hardcoded SRAM addresses after BSS or global-layout changes.
6. Flash and debug
Use the jlink skill for normal probe discovery, flash, reset, memory, register, RTT, and GDB operations when available.
If direct MSPM0 connection reports No AHB-AP, generate the proven generic-core-first fallback:
python ~/.claude/skills/mspm0g3507-dev/scripts/generate_jlink.py \
flash --file build/app.hex \
--output C:/Temp/mspm0-jlink/flash.jlink \
--ascii-staging-dir C:/Temp/mspm0-jlink --json
When the firmware path contains non-ASCII characters, pass generate_jlink.py --ascii-staging-dir <absolute-ASCII-path> or configure jlink.ascii_staging_dir in the workflow JSON. Prefer an absolute path because a relative path under a Unicode project root is still non-ASCII. The helper/workflow records source and staged hashes; never flash a manually copied file without confirming they match.
The generated connection sequence is:
device Cortex-M0+
si SWD
speed 1000
connect
device MSPM0G3507
connect
Do not escalate to mass erase automatically.
7. Validate the target
Inspect the data path from source to result:
physical pin -> ADC raw sample -> DMA buffer -> completion sequence
-> channel pairing -> queue -> processing window -> calculation
-> deferred calculation -> complete published snapshot
Require counters for DMA errors, completion discontinuity, synchronization, queue overflow, dropped blocks, sequence gaps, discarded windows, deferred deadlines, and publication count.
For measurement anomalies, capture raw channels and compare predicted output with firmware output before changing calibration or algorithms.
8. Report evidence
Report exactly:
- files changed;
- build/test commands and outputs;
- text/data/bss;
- ELF/HEX/MAP paths;
- flash and verify outcome;
- measured target values or peripheral evidence;
- diagnostic counters;
- intrusive debug actions;
- skipped checks and remaining limitations.
9. Validate the skill installation
Run the permanent offline acceptance suite after changing this skill:
python ~/.claude/skills/mspm0g3507-dev/scripts/run_acceptance.py --json
It performs no network, installer, registry, or hardware access. It checks required resources, Python syntax, every helper's --help path, frontmatter, JSON assets, the exact six-component Windows toolchain manifest, local Markdown links, J-Link safety, the complete 38-file peripheral template set, and all unit/integration tests. A real environment installation, target build, or flash remains a separate explicitly authorized action.
Task-specific guidance
New project
- Start from an SDK example closest to the required peripheral set.
- Copy owned source into a clean project; keep SDK files external.
- Create
*.syscfg, generated output directory, Makefile, and a known-good LED/timer baseline.
- Add one peripheral layer at a time.
Build or link failure
- Verify tool roots first.
- Match
__MSPM0G3507__, MSPM0G350x startup, MSPM0G3507 linker script, and mspm0g1x0x_g3x0x DriverLib.
- Check generated config presence and include paths.
- Read the MAP before assuming SRAM/Flash overflow.
ADC/DMA synchronization failure
- Compare per-channel DMA sequence and half identity.
- Check event publisher/subscriber routing and actual conversion cadence.
- Reduce ISR work and observe queue peak/overflow.
- Treat long debugger halts as intrusive.
Real-time deadline failure
- Profile progress and counters on target.
- Reduce passes over buffers and expensive float/64-bit/trigonometric work.
- Prefer lookup tables, phase accumulators, fixed-point hot paths, and incremental deferred processing.
- Re-run host numerical tests and target diagnostics after optimization.
Calibration or wrong measurement
- For THD/frequency/harmonic work, apply spectral-measurement.md: estimate the actual fundamental, disambiguate strong harmonics, and use a short-window estimator when fewer than three cycles are present.
- Distinguish timer-derived sample cadence from calibrated free-running ADC throughput.
- Measure frequency, min/max, DC center, RMS, clipping, and phase at the MCU pins.
- Separate fixed board compensation from temporary source settings.
- Trace backward from final result to raw DMA data before changing scales.
Inconsistent displayed data
- Keep base values pending until deferred values with the same sequence complete.
- Publish once through a versioned snapshot or double buffer.
- Make display/UART readers use the snapshot API, not independent volatile fields.
Bundled resources
- workflow.md: complete development and verification process.
- peripherals-and-realtime.md: ADC12, DMA, event, OPA, ISR, queue, performance, and publication rules.
- spectral-measurement.md: effective sample-rate calibration, fundamental tracking, harmonic-lock disambiguation, short-window estimation, and golden-vector regression.
- troubleshooting.md: symptom-to-cause-to-action matrix.
- ad9910-tianmengxing.md: verified Tianmengxing Axx/Bxx wiring, AD9910 power/reset order, SPI configuration, clock constants, formulas, and bring-up diagnostics.
- Tianmengxing pinout image: physical connector and alternate-function reference supplied with the board.
- official-resources.md: official TI/SEGGER documentation and version-sensitive references.
- AD9910 driver bundle: reusable Profile/DRG/RAM driver, math helpers, SysConfig routing, 10 MHz example, and host reference test.
- Makefile.gcc.template: reproducible GNU Arm build template with SysConfig regeneration dependency.
- project-config.example.json: exact artifact, build, J-Link, and verification workflow configuration.
- windows-toolchain-manifest.json: pinned Windows x64 package sources, hashes, licenses, install layout, probes, and environment entries.
- Peripheral templates: SysConfig-first UART, SPI, I2C, ADC12, DMA, and OPA starting points.
scripts/install_environment.py: explicit plan/install/verify workflow for the complete Windows command-line environment.
scripts/inspect_environment.py: toolchain and project discovery, including CMake and Ninja.
scripts/find_examples.py: rank installed LP-MSPM0G3507 SDK examples by peripheral keywords.
scripts/map_symbols.py: current-MAP symbol resolution and J-Link read generation.
scripts/generate_jlink.py: conservative MSPM0 connection, flash, reset, and memory-read script generation.
scripts/mspm0_workflow.py: fail-closed plan/build/flash-verify/all workflow with atomic JSON evidence.
scripts/run_acceptance.py: offline skill structure, safety, template, CLI, and unit/integration acceptance.
When a symptom is already represented in troubleshooting.md, apply that diagnostic path before trying unrelated configuration changes.