mspm0-ccs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMSPM0 Agent Skill
MSPM0 Agent技能
Use this skill for TI MSPM0 firmware projects that use SysConfig and DriverLib through CCS / CCS Theia, Keil/uVision, or CMake + Arm GNU Toolchain + OpenOCD workflows. It is intended for Claude Code, OpenCode, OpenClaw, Continue, Cursor, Codex, and similar CLI/editor agents.
当您的TI MSPM0固件项目通过CCS / CCS Theia、Keil/uVision或CMake + Arm GNU Toolchain + OpenOCD工作流使用SysConfig和DriverLib时,可使用本技能。本技能适用于Claude Code、OpenCode、OpenClaw、Continue、Cursor、Codex及类似的CLI/编辑器Agent。
Default Workflow
默认工作流
- Locate the project or
.syscfg, editable source files, generatedsystem.syscfg, and the active project entrypoint:ti_msp_dl_config.hfor CCS,targetConfigs/*.ccxmlplus scatter file for Keil/uVision, or*.uvprojxplus OpenOCDCMakeLists.txtfiles for CMake/GCC/OpenOCD..cfg - Run when this skill is available.
python scripts/check_syscfg.py <project-dir> - Read metadata: device, package, SDK product, SysConfig version, modules, instances, pins, clocks, and interrupts.
.syscfg - Inspect generated for macro names, IRQ names, instance names, and the exact SysConfig init function spelling.
ti_msp_dl_config.h - Before adding unfamiliar SysConfig fields, inspect the user's existing ,
.syscfg, TI SDK examples, orexamples/*/manifest.json.source/ti/driverlib/.meta/*.syscfg.js - Modify the smallest relevant and application-code surface.
.syscfg - By default, make the smallest evidence-based edit and run
.syscfgbefore rebuilding. Use CCS SysConfig MCP only when the user explicitly requests it or the current session already exposes a confirmed SysConfig MCP tool.python scripts/run_sysconfig.py <project-dir> - If flashing or debugging, run or
python scripts/detect_probe.pybefore selecting a backend. Confirm the configured probe matches the connected hardware and prefer a System Reset after programming.python scripts/check_syscfg.py <project-dir> --probe
- 定位项目的或
.syscfg、可编辑源文件、生成的system.syscfg,以及活跃项目入口点:CCS对应ti_msp_dl_config.h,Keil/uVision对应targetConfigs/*.ccxml加分散加载文件,CMake/GCC/OpenOCD对应*.uvprojx加OpenOCDCMakeLists.txt文件。.cfg - 当本技能可用时,运行。
python scripts/check_syscfg.py <project-dir> - 读取元数据:器件、封装、SDK产品、SysConfig版本、模块、实例、引脚、时钟和中断。
.syscfg - 检查生成的,获取宏名称、IRQ名称、实例名称以及SysConfig初始化函数的准确拼写。
ti_msp_dl_config.h - 在添加不熟悉的SysConfig字段前,检查用户现有、
.syscfg、TI SDK示例或examples/*/manifest.json。source/ti/driverlib/.meta/*.syscfg.js - 修改最小范围的相关和应用代码。
.syscfg - 默认情况下,先进行最小化的基于证据的编辑,再运行
.syscfg,之后再重新构建。仅当用户明确要求,或当前会话已确认暴露SysConfig MCP工具时,才使用CCS SysConfig MCP。python scripts/run_sysconfig.py <project-dir> - 如果需要烧录或调试,在选择后端前运行或
python scripts/detect_probe.py。确认配置的调试器与连接的硬件匹配,并且编程后优先选择系统复位。python scripts/check_syscfg.py <project-dir> --probe
Core Rules
核心规则
- Treat as the source of truth for pinmux, peripheral setup, clocks, interrupts, DMA ownership, and generated initialization.
.syscfg - Prefer SysConfig + DriverLib for GPIO, UART, PWM, Timer, ADC, I2C, SPI, DMA, and clock setup.
- Do not hand-edit generated outputs such as ,
Debug/ti_msp_dl_config.c, the project-rootDebug/ti_msp_dl_config.h/ti_msp_dl_config.cpair in Keil layouts,ti_msp_dl_config.h,device_linker.cmd,Objects/, object files, maps, orListings/files..out - Preserve metadata such as
.syscfg,@cliArgs,@v2CliArgs,@versions,--device, and--package.--product - Do not guess generated names. Read and use the local macros and the local init function spelling, such as
ti_msp_dl_config.h.SYSCFG_DL_init() - Do not invent SysConfig fields, enum values, device metadata, board names, package names, or tool versions. Validate against local examples, SDK metadata, or SysConfig CLI.
- New SysConfig releases may explicitly recommend the CCS SysConfig MCP. This skill does not probe for or require that unverified backend by default: use it only when the user asks for MCP or the current session already exposes a confirmed SysConfig MCP tool. Otherwise use a minimal manual edit followed immediately by standalone CLI validation, and state that this does not provide the MCP's interactive mutation feedback.
- Preserve unrelated user code, comments, copyright headers, project layout, and existing settings. If a requested feature requires a larger rewrite, explain why before making it when possible.
.syscfg - Do not change device, package, SDK, compiler, CCS version, board, or debug probe without user confirmation.
- If the user asks only to "flash" or "debug", do not silently assume J-Link, XDS110, CMSIS-DAP/DAPLink, or ST-Link. Detect the connected probe first. If detection is unknown, multiple probes are connected, or the project configuration conflicts with the physical probe, stop and ask the user which backend to use.
- Treat an empty probe-detector result as inconclusive, not proof that no probe is connected. Some DAPLink/CMSIS-DAP and XDS110 devices appear only as Windows ,
USBDevice, orHIDClasschildren. Inspect OS USB/PnP devices and serial ports (Portson Windows), then try the intended backend's read-only probe/list command or ask the user before concluding the probe is absent.python scripts/serial_console.py --list - If SysConfig emits warnings, report them separately from build/flash success. Do not call a warning-producing generation "clean".
- If hardware behavior is not verified on a connected board, say that validation stopped at source, SysConfig, or build level.
- 将视为引脚复用、外设配置、时钟、中断、DMA所有权及生成初始化代码的唯一可信源。
.syscfg - 优先使用SysConfig + DriverLib进行GPIO、UART、PWM、定时器、ADC、I2C、SPI、DMA和时钟配置。
- 请勿手动编辑生成的输出文件,例如、
Debug/ti_msp_dl_config.c、Keil布局中项目根目录的Debug/ti_msp_dl_config.h/ti_msp_dl_config.c文件对、ti_msp_dl_config.h、device_linker.cmd、Objects/、目标文件、映射文件或Listings/文件。.out - 保留的元数据,例如
.syscfg、@cliArgs、@v2CliArgs、@versions、--device和--package。--product - 请勿猜测生成的名称。读取并使用本地宏和本地初始化函数的拼写,例如
ti_msp_dl_config.h。SYSCFG_DL_init() - 请勿自创SysConfig字段、枚举值、器件元数据、开发板名称、封装名称或工具版本。需根据本地示例、SDK元数据或SysConfig CLI进行验证。
- 新版SysConfig可能明确推荐使用CCS SysConfig MCP。本技能默认不会探测或要求使用该未经验证的后端:仅当用户要求使用MCP,或当前会话已确认暴露SysConfig MCP工具时才使用。否则,先进行最小化手动编辑,随后立即进行独立CLI验证,并说明此操作无法提供MCP的交互式变更反馈。
- 保留用户无关的代码、注释、版权头、项目布局及现有设置。如果请求的功能需要较大规模的重写,尽可能先解释原因再进行操作。
.syscfg - 未经用户确认,请勿更改器件、封装、SDK、编译器、CCS版本、开发板或调试器。
- 如果用户仅要求“烧录”或“调试”,请勿默认使用J-Link、XDS110、CMSIS-DAP/DAPLink或ST-Link。先探测连接的调试器。如果探测结果未知、连接了多个调试器,或项目配置与物理调试器冲突,请停止操作并询问用户使用哪个后端。
- 将调试器探测结果为空视为不确定,而非无调试器连接的证明。部分DAPLink/CMSIS-DAP和XDS110设备仅显示为Windows的、
USBDevice或HIDClass子设备。检查操作系统的USB/PnP设备和串口(Windows上运行Ports),然后尝试目标后端的只读探测/列表命令,或在得出无调试器连接的结论前询问用户。python scripts/serial_console.py --list - 如果SysConfig发出警告,请将其与构建/烧录成功信息分开报告。请勿将产生警告的生成过程称为“干净”。
- 如果未在连接的开发板上验证硬件行为,请说明验证仅停留在源码、SysConfig或构建阶段。
Board-Specific Pin Caution
开发板特定引脚注意事项
When the user explicitly says the board is LCKFB Tianmengxing MSPM0G3507:
- Avoid choosing A21/PA21, A23/PA23, A02/PA02, and A18/PA18 for ordinary user-requested pin assignments unless the user asks for those pins or the local project already deliberately uses them.
- PA10 and PA11 are also marked as special, but Tianmengxing routes them as the default UART pins. When choosing pins for a UART, consider PA10 TX and PA11 RX first if they are free and match the requested UART instance. For GPIO, PWM, SPI, I2C, timer, or other non-UART uses, continue to treat PA10/PA11 as special pins and prefer other available pins.
- If the user asks to drive or reuse one of these special pins for a non-default purpose, remind them of the Tianmengxing board note. In particular, explain that repurposing PA10/PA11 can conflict with or remove the board's default UART connection.
- Do not silently move an existing project away from these pins. Explain the board caveat first, then ask or proceed according to the user's intent.
当用户明确说明开发板为LCKFB Tianmengxing MSPM0G3507时:
- 除非用户要求使用这些引脚,或本地项目已特意使用,否则避免将A21/PA21、A23/PA23、A02/PA02和A18/PA18分配给普通用户请求的引脚功能。
- PA10和PA11也被标记为特殊引脚,但Tianmengxing开发板将其作为默认UART引脚。当为UART选择引脚时,如果PA10(TX)和PA11(RX)空闲且匹配请求的UART实例,优先考虑使用它们。对于GPIO、PWM、SPI、I2C、定时器或其他非UART用途,仍需将PA10/PA11视为特殊引脚,优先选择其他可用引脚。
- 如果用户要求将这些特殊引脚之一用于非默认用途,请提醒他们Tianmengxing开发板的注意事项。特别要说明,重新配置PA10/PA11可能会与开发板的默认UART连接冲突,甚至导致该连接失效。
- 请勿擅自将现有项目的引脚从这些特殊引脚移开。先说明开发板的注意事项,再根据用户的意图询问或继续操作。
Project Shape Checks
项目结构检查
- Simple projects usually keep most logic in ,
main.c, or a small number of files. It is acceptable to make narrowly scoped edits there.empty.c - Framework projects often have multiple source directories such as ,
app/,bsp/,components/,core/,drivers/,hal/, ormiddleware/. First identify ownership boundaries before adding peripherals or changing control logic.tasks/ - Do not assume every MSPM0 project is CCS-like or single-file. A framework project can still use CCS, Keil, or CMake/GCC/OpenOCD.
- For control code, confirm whether timing comes from a timer ISR, RTOS task delay, hardware PWM/ADC trigger chain, or a main-loop poll before changing periods or priorities.
- 简单项目通常将大部分逻辑放在、
main.c或少量文件中。在此类文件中进行范围明确的编辑是可接受的。empty.c - 框架项目通常有多个源目录,例如、
app/、bsp/、components/、core/、drivers/、hal/或middleware/。在添加外设或更改控制逻辑前,先确定所有权边界。tasks/ - 请勿假设所有MSPM0项目都类似CCS项目或单文件结构。框架项目仍可使用CCS、Keil或CMake/GCC/OpenOCD。
- 对于控制代码,在更改周期或优先级前,确认计时来源是定时器ISR、RTOS任务延迟、硬件PWM/ADC触发链还是主循环轮询。
Keil Project Checks
Keil项目检查
- Treat and
system.syscfg/ti_msp_dl_config.cas the configuration source surface for Keil-based MSPM0 projects that keep SysConfig outputs at the project root.ti_msp_dl_config.h - Treat a Keil as the project entrypoint, the scatter file as the linker source of truth, and
.uvprojx,Objects/,Listings/, build logs, and generated outputs as inspection-only unless a request explicitly targets them.*.uvoptx - For a project's application code, follow its own source layout rather than assuming CCS defaults.
- 对于将SysConfig输出保存在项目根目录的Keil-based MSPM0项目,将和
system.syscfg/ti_msp_dl_config.c视为配置源。ti_msp_dl_config.h - 将Keil 视为项目入口点,分散加载文件视为链接器的可信源,
.uvprojx、Objects/、Listings/、构建日志和生成的输出文件仅用于检查,除非请求明确针对这些文件。*.uvoptx - 对于项目的应用代码,遵循其自身的源布局,而非假设CCS的默认布局。
CMake / GCC / OpenOCD Checks
CMake / GCC / OpenOCD检查
- Treat , toolchain files, and OpenOCD
CMakeLists.txtfiles as the project entrypoints for CMake/GCC/OpenOCD projects..cfg - Build through the existing CMake build directory when present, for example .
cmake --build cmake-build-debug --target <target> - MSPM0 OpenOCD flashing usually requires a TI MSPM0-capable OpenOCD build or TI extension branch. If OpenOCD reports , report that as probe discovery failure rather than firmware failure.
unable to find a matching CMSIS-DAP device - Do not require CCS when the active project uses OpenOCD instead of DSLite.
targetConfigs/*.ccxml
- 将、工具链文件和OpenOCD
CMakeLists.txt文件视为CMake/GCC/OpenOCD项目的入口点。.cfg - 如果存在现有CMake构建目录,通过该目录进行构建,例如。
cmake --build cmake-build-debug --target <target> - MSPM0的OpenOCD烧录通常需要支持TI MSPM0的OpenOCD构建版本或TI扩展分支。如果OpenOCD报告,请将其报告为调试器探测失败,而非固件失败。
unable to find a matching CMSIS-DAP device - 当活跃项目使用OpenOCD而非DSLite时,无需依赖CCS 。
targetConfigs/*.ccxml
FreeRTOS Checks
FreeRTOS检查
- If ,
FreeRTOSConfig.h,FreeRTOS.h,task.h, orxTaskCreateare present, treat the project as RTOS-aware.vTaskStartScheduler - Keep RTOS handling lightweight: respect existing task, queue, ISR, and blocking-call boundaries; do not impose a specific framework architecture unless the user asks.
- 如果项目中存在、
FreeRTOSConfig.h、FreeRTOS.h、task.h或xTaskCreate,则将该项目视为支持RTOS。vTaskStartScheduler - 保持RTOS处理轻量化:尊重现有的任务、队列、ISR和阻塞调用边界;除非用户要求,否则不要强加特定的框架架构。
Ambiguous Requests
模糊请求处理
If the user omits important hardware parameters, do not silently choose risky values.
- For low-risk defaults, use this skill's or local TI SDK examples, then tell the user which defaults were applied.
examples/ - For important parameters, ask before editing and offer a concrete recommendation.
- Important missing parameters include pin, peripheral instance, UART baud/data/parity/stop bits, Timer period, PWM frequency/duty/polarity, ADC channel/reference/sample time, DMA direction/source/destination, interrupt priority, and external-module power/logic levels.
Example: if the user asks "add a timer interrupt", ask which timer and period they want, and recommend a starter such as TIMG at 1 ms or 10 ms if they are unsure.
如果用户遗漏了重要的硬件参数,请勿擅自选择有风险的值。
- 对于低风险默认值,使用本技能的或本地TI SDK示例,然后告知用户使用了哪些默认值。
examples/ - 对于重要参数,在编辑前询问用户,并提供具体建议。
- 重要的缺失参数包括引脚、外设实例、UART波特率/数据位/奇偶校验/停止位、定时器周期、PWM频率/占空比/极性、ADC通道/参考电压/采样时间、DMA方向/源/目标、中断优先级以及外部模块电源/逻辑电平。
示例:如果用户请求“添加定时器中断”,询问他们想要使用哪个定时器和周期,如果不确定,推荐使用TIMG,周期设为1 ms或10 ms。
External Modules And Hardware Debugging
外部模块与硬件调试
When asked to drive an external module, sensor, motor driver, servo, display, radio, or custom board:
- Ask for the module datasheet, schematic, pin map, supply voltage, logic level, communication protocol, and key parameters when they are not available.
- Verify wiring assumptions before blaming code: power, ground, pull-ups, level shifting, reset/enable pins, boot pins, chip select, UART TX/RX crossover, I2C address, SPI mode, PWM polarity, and shared pins.
- If repeated attempts fail and SysConfig, build, flash, and code logic look correct, explicitly raise the possibility of wiring, power, module mode, datasheet mismatch, damaged hardware, or wrong test procedure.
- Separate "firmware looks correct" from "hardware proved correct".
当被要求驱动外部模块、传感器、电机驱动器、舵机、显示屏、无线电或自定义开发板时:
- 如果缺少相关信息,询问用户模块的数据手册、原理图、引脚图、供电电压、逻辑电平、通信协议和关键参数。
- 在归咎于代码前,验证接线假设:电源、接地、上拉电阻、电平转换、复位/使能引脚、引导引脚、片选、UART TX/RX交叉、I2C地址、SPI模式、PWM极性和共享引脚。
- 如果多次尝试失败,但SysConfig、构建、烧录和代码逻辑看起来都正确,请明确提出可能是接线、电源、模块模式、数据手册不匹配、硬件损坏或测试流程错误的原因。
- 将“固件看起来正确”与“硬件已验证正确”区分开。
Reference Selection
参考资料选择
Read references only when needed:
- :
references/project_workflows.mdediting, CCS / Keil / CMake project layout, SDK schema lookup, SysConfig CLI, builds, DSLite/J-Link, and OpenOCD..syscfg - : DriverLib usage, interrupts, clock tree, delays, and common runtime mistakes.
references/driverlib_runtime_rules.md - : verified Tianmengxing MSPM0G3507 lessons, HFXT warnings, flash/reset behavior, and real-board caveats.
references/hardware_validation_notes.md - : CCS-DSS and OpenOCD/GDB probe, flash, breakpoint, retry, and manual-unlock workflows.
references/debug_backends.md
Use as one source for reusable tested patterns. Prefer to inspect available examples before opening individual example files, but do not assume packaged examples outrank the user's existing project structure or official TI SDK examples.
examples/scripts/list_examples.py仅在需要时读取参考资料:
- :.syscfg编辑、CCS / Keil / CMake项目布局、SDK模式查找、SysConfig CLI、构建、DSLite/J-Link和OpenOCD。
references/project_workflows.md - :DriverLib使用、中断、时钟树、延迟和常见运行时错误。
references/driverlib_runtime_rules.md - :已验证的Tianmengxing MSPM0G3507经验、HFXT警告、烧录/复位行为和实际开发板注意事项。
references/hardware_validation_notes.md - :CCS-DSS和OpenOCD/GDB调试器、烧录、断点、重试和手动解锁工作流。
references/debug_backends.md
将作为可复用测试模式的来源之一。在打开单个示例文件前,优先使用检查可用示例,但请勿假设打包示例的优先级高于用户现有项目结构或官方TI SDK示例。
examples/scripts/list_examples.pyExamples
示例规范
Each reusable example should contain:
text
examples/<name>/
├─ example.syscfg
├─ README.md
├─ manifest.json
└─ src/
└─ source files copied from the minimal relevant project surfaceDo not require users to drop full CCS projects into . Use to extract a compact example package from a real project.
examples/scripts/capture_example.pyWhen applying an example to a user project:
- Treat skill examples as proven references, not mandatory project templates.
- Copy only the needed fields, generated-name expectations, code pattern, or debugging lesson.
.syscfg - Preserve the user's existing file layout and naming. If an example uses , do not create
BSP/in the user project unless the user asked for that structure or the project already follows it.BSP/ - Prefer the user's local style when it conflicts with an example's directory names, wrapper names, or layering.
- Consider official TI SDK examples and local SDK metadata at the same or higher priority when they better match the user's board, SDK version, peripheral, or toolchain.
- For DMA UART examples, keep TX buffers per UART instance, avoid shared static printf buffers, and choose RX handling per port: ISR callback for the one port that needs immediate line parsing, for extra receive ports, or TX-only init for ports that do not receive.
UART_poll() - For periodic timer interrupts, configure the TIMER instance and interrupt in , confirm the generated load value against the generated CPU clock, enable the generated IRQ in application code, and keep the ISR short.
.syscfg
每个可复用示例应包含以下结构:
text
examples/<name>/
├─ example.syscfg
├─ README.md
├─ manifest.json
└─ src/
└─ source files copied from the minimal relevant project surface不要求用户将完整CCS项目放入。使用从真实项目中提取紧凑的示例包。
examples/scripts/capture_example.py将示例应用到用户项目时:
- 将技能示例视为经过验证的参考,而非强制的项目模板。
- 仅复制所需的字段、生成名称预期、代码模式或调试经验。
.syscfg - 保留用户现有的文件布局和命名。如果示例使用,除非用户要求该结构,或项目已遵循该结构,否则不要在用户项目中创建
BSP/。BSP/ - 当用户本地风格与示例的目录名称、包装器名称或分层结构冲突时,优先使用用户的本地风格。
- 当官方TI SDK示例和本地SDK元数据更匹配用户的开发板、SDK版本、外设或工具链时,将其视为同等或更高优先级。
- 对于DMA UART示例,为每个UART实例保留独立的TX缓冲区,避免使用共享的静态printf缓冲区,并为每个端口选择合适的RX处理方式:对需要立即行解析的端口使用ISR回调,对额外接收端口使用,对不接收数据的端口仅初始化TX功能。
UART_poll() - 对于周期性定时器中断,在中配置TIMER实例和中断,确认生成的加载值与生成的CPU时钟匹配,在应用代码中启用生成的IRQ,并保持ISR代码简短。
.syscfg
Tools
工具说明
Run bundled scripts with Python 3.10 or newer. additionally requires ; if import fails, tell the user to run . TI SDK, SysConfig, CCS/UniFlash, OpenOCD, and GDB remain external workflow dependencies and are not installed by this skill.
serial_console.pypyserialpython -m pip install pyserial- : static project check for
python scripts/check_syscfg.py <project-dir>, generated files, pins, init spelling, project shape, CCS/Keil/CMake/OpenOCD clues, build output, target config, and validation hints..syscfg - : discover the project-declared SysConfig and MSPM0 SDK versions, then validate the selected
python scripts/run_sysconfig.py <project-dir>into an isolated temporary directory without overwriting project outputs. Use.syscfgor--toolonly for an intentional explicit override.--product - : read-only connected-probe detection for common CMSIS-DAP/DAPLink, J-Link, XDS110, and ST-Link hardware; an empty result is explicitly inconclusive and requires OS/backend fallback checks.
python scripts/detect_probe.py - : run the static check, detect connected probes, compare them with project hints, and suppress unsafe flash suggestions when a CCS
python scripts/check_syscfg.py <project-dir> --probeconflicts with the physical probe..ccxml - : list packaged examples from
python scripts/list_examples.py.examples/*/manifest.json - : package selected source files and
python scripts/capture_example.py <project-dir> --name <example-name> --include <glob>from a user project into.syscfg.examples/<example-name>/ - : search local TI SDK examples and module metadata.
python scripts/index_syscfg_examples.py <mspm0-sdk-root> --board LP_MSPM0G3507 --module UART - : list serial ports.
python scripts/serial_console.py --list - : connect through CCS Debug Server Scripting, read reset/register state, verify the configured
python scripts/ccs_dss_debug.py <project-dir> probe --leave-runningdebug path, and continue the target before disconnecting..ccxml - : load debug symbols from
python scripts/ccs_dss_debug.py <project-dir> load-symbols --symbol mainwithout programming flash..out - : connect through OpenOCD, halt briefly, report target state, and resume.
python scripts/openocd_debug.py <project-dir> probe - : flash, verify, and reset-run an auto-detected
python scripts/openocd_debug.py <project-dir> flash,.out,.elf, or.axfoutput through OpenOCD..hex - : use OpenOCD +
python scripts/openocd_debug.py <project-dir> run-to-symbol --symbol mainto reset and run to a symbol breakpoint.arm-none-eabi-gdb
For the verified CH340 setup, use after closing other serial tools such as VOFA+.
For line-based MCU parsers, send one test frame and wait for the echo with . Use when testing binary payloads.
python scripts/serial_console.py -p COM6 -b 115200 --timestamp --duration 10python scripts/serial_console.py -p COM6 -b 115200 --send "ping" --send-line --timestamp --duration 3--send-hex "00 00 80 3F"使用Python 3.10或更高版本运行捆绑脚本。还需要;如果导入失败,请告知用户运行。TI SDK、SysConfig、CCS/UniFlash、OpenOCD和GDB仍是外部工作流依赖项,本技能不会安装它们。
serial_console.pypyserialpython -m pip install pyserial- :对.syscfg、生成文件、引脚、初始化函数拼写、项目结构、CCS/Keil/CMake/OpenOCD线索、构建输出、目标配置和验证提示进行静态项目检查。
python scripts/check_syscfg.py <project-dir> - :发现项目声明的SysConfig和MSPM0 SDK版本,然后将选定的.syscfg验证到独立的临时目录中,不会覆盖项目输出。仅在有意显式覆盖时使用
python scripts/run_sysconfig.py <project-dir>或--tool参数。--product - :对常见的CMSIS-DAP/DAPLink、J-Link、XDS110和ST-Link硬件进行只读连接探测;结果为空明确表示不确定,需要进行操作系统/后端回退检查。
python scripts/detect_probe.py - :运行静态检查、探测连接的调试器、将其与项目提示进行比较,并在CCS
python scripts/check_syscfg.py <project-dir> --probe与物理调试器冲突时抑制不安全的烧录建议。.ccxml - :从
python scripts/list_examples.py中列出打包的示例。examples/*/manifest.json - :将用户项目中选定的源文件和.syscfg打包到
python scripts/capture_example.py <project-dir> --name <example-name> --include <glob>中。examples/<example-name>/ - :搜索本地TI SDK示例和模块元数据。
python scripts/index_syscfg_examples.py <mspm0-sdk-root> --board LP_MSPM0G3507 --module UART - :列出串口。
python scripts/serial_console.py --list - :通过CCS Debug Server Scripting连接,读取复位/寄存器状态,验证配置的.ccxml调试路径,并在断开连接前继续运行目标设备。
python scripts/ccs_dss_debug.py <project-dir> probe --leave-running - :从.out文件加载调试符号,无需编程烧录闪存。
python scripts/ccs_dss_debug.py <project-dir> load-symbols --symbol main - :通过OpenOCD连接,短暂暂停,报告目标状态,然后恢复运行。
python scripts/openocd_debug.py <project-dir> probe - :通过OpenOCD烧录、验证并复位运行自动检测到的.out、.elf、.axf或.hex输出文件。
python scripts/openocd_debug.py <project-dir> flash - :使用OpenOCD +
python scripts/openocd_debug.py <project-dir> run-to-symbol --symbol main复位并运行到符号断点。arm-none-eabi-gdb
对于已验证的CH340设置,关闭其他串口工具(如VOFA+)后,运行。
对于基于行的MCU解析器,发送一个测试帧并等待回显,运行。测试二进制负载时使用。
python scripts/serial_console.py -p COM6 -b 115200 --timestamp --duration 10python scripts/serial_console.py -p COM6 -b 115200 --send "ping" --send-line --timestamp --duration 3--send-hex "00 00 80 3F"Flash Backends
烧录后端选择
Before selecting a flash backend for a vague request such as "flash this project", run:
text
python scripts/detect_probe.py
python scripts/check_syscfg.py <project-dir> --probeProbe detection is read-only. Do not flash when multiple probes are connected, detection is unknown, or the physical probe conflicts with the project configuration until the user confirms the intended backend. On Windows, if no probe is identified, inspect and ; a debug probe may expose a CMSIS-DAP/XDS interface or virtual COM port outside the generic USB device class.
Get-PnpDevice -PresentOnlypython scripts/serial_console.py --listThe verified CCS flash path is DSLite / UniFlash with J-Link. For automated flashing after clock-tree changes, prefer DSLite System Reset:
text
dslite -c <target.ccxml> -e -r 2 -u <project.out>For CMake/GCC/OpenOCD projects, use the project's existing flash target or explicit OpenOCD config. The packaged helper can also flash an existing compatible output. Keep the backend explicit and report probe-discovery errors separately from build success.
openocd_debug.py对于诸如“烧录此项目”之类的模糊请求,选择烧录后端前先运行:
text
python scripts/detect_probe.py
python scripts/check_syscfg.py <project-dir> --probe调试器探测是只读操作。当连接多个调试器、探测结果未知或物理调试器与项目配置冲突时,请勿进行烧录,直到用户确认目标后端。在Windows上,如果未识别到调试器,检查和;调试器可能在通用USB设备类之外暴露CMSIS-DAP/XDS接口或虚拟串口。
Get-PnpDevice -PresentOnlypython scripts/serial_console.py --list已验证的CCS烧录路径是使用J-Link的DSLite / UniFlash。对于时钟树更改后的自动化烧录,优先使用DSLite系统复位:
text
dslite -c <target.ccxml> -e -r 2 -u <project.out>对于CMake/GCC/OpenOCD项目,使用项目现有的烧录目标或明确的OpenOCD配置。打包的助手也可以烧录现有的兼容输出文件。保持后端明确,并将调试器探测错误与构建成功信息分开报告。
openocd_debug.pyDebug Backends
调试后端选择
Keep CCS-DSS and OpenOCD/GDB as separate backends. Read before debugging or diagnosing repeated probe failures.
references/debug_backends.mdFor CCS / CCS Theia / UniFlash-style projects with a matching :
targetConfigs/*.ccxmltext
python scripts/ccs_dss_debug.py <project-dir> probe --leave-runningFor OpenOCD-capable MSPM0 projects:
text
python scripts/openocd_debug.py <project-dir> probeThe CCS-DSS physical probe is selected by ; it is not inherently J-Link-only. Use symbol-only loading when firmware is already flashed and rewriting flash is unnecessary. For OpenOCD, do not run concurrent operations against one probe. Neither backend should silently issue destructive recovery. If the target appears locked or protected, stop and ask the user to perform their manual unlock procedure. Debug actions can halt the CPU, so report that risk before using breakpoints or register inspection on real-time control hardware.
.ccxml将CCS-DSS和OpenOCD/GDB视为独立后端。进行调试或诊断重复调试器失败前,请先阅读。
references/debug_backends.md对于具有匹配的CCS / CCS Theia / UniFlash风格项目:
targetConfigs/*.ccxmltext
python scripts/ccs_dss_debug.py <project-dir> probe --leave-running对于支持OpenOCD的MSPM0项目:
text
python scripts/openocd_debug.py <project-dir> probeCCS-DSS物理调试器由选择;它并非仅支持J-Link。当固件已烧录且无需重写闪存时,使用仅加载符号的方式。对于OpenOCD,请勿对同一个调试器运行并发操作。两个后端都不应静默执行破坏性恢复操作。如果目标设备显示锁定或受保护,请停止操作并要求用户执行手动解锁流程。调试操作可能会暂停CPU,因此在对实时控制硬件使用断点或寄存器检查前,请告知用户此风险。",
.ccxml