Loading...
Loading...
Keil MDK project build tool, used to scan .uvprojx/.uvmpw projects, enumerate Targets, execute build/rebuild/clean and parse build logs, return artifact paths that can be reused by jlink/openocd. The flash subcommand is only retained as a compatibility entry. It is automatically triggered when users mention Keil, MDK, uVision, UV4, Target enumeration, compilation, rebuild, clean, flash, firmware download, or flash. It also supports explicit invocation via /keil. Even if users only say "compile" or "flash to the board", this skill should be triggered as long as the context involves embedded Keil projects.
npx skill4agent add zhinkgit/embeddedskills keiljlink/openocdflashconfig.jsonuv4_exe{
"uv4_exe": "C:\\Keil_v5\\UV4\\UV4.exe",
"operation_mode": 1
}uv4_exeoperation_mode123.embeddedskills/config.json{
"keil": {
"project": "",
"target": "",
"log_dir": ".embeddedskills/build"
}
}projecttargetlog_dir.embeddedskills/build.embeddedskills/state.json| Subcommand | Purpose | Risk |
|---|---|---|
| Search for .uvprojx/.uvmpw projects in the current directory | Low |
| Enumerate Targets in the project | Low |
| Incremental compilation | Medium |
| Full rebuild | Medium |
| Clean the project | High |
| Flash firmware via Keil (compatibility entry, priority recommendation to use jlink/openocd) | High |
config.jsonuv4_exescanscanbuild/rebuild/cleanoperation_modebuild/rebuildflash_filedebug_fileflash# Scan projects
python <skill-dir>/scripts/keil_project.py scan --root <search directory> --json
# Enumerate Targets
python <skill-dir>/scripts/keil_project.py targets --project <project path> --jsonpython <skill-dir>/scripts/keil_build.py <build|rebuild|clean|flash> \
--uv4 <UV4 path> \
--project <project path> \
--target <TargetName> \
--log-dir <log directory> \
--jsonrebuild--clean-first-cr-rstatusactionsummarydetailscontextartifactsmetricsstatenext_actionstiming{
"status": "ok",
"action": "build",
"summary": "build succeeded, errors=0 warnings=2",
"details": {
"project": "project.uvprojx",
"target": "Debug",
"log_file": ".build/project-Debug-build.log",
"flash_file": "Objects/project.hex",
"debug_file": "Objects/project.axf"
},
"metrics": { "errors": 0, "warnings": 2, "flash_bytes": 32768, "ram_bytes": 8192 }
}{
"status": "error",
"action": "flash",
"error": { "code": "build_not_clean", "message": "The last build had errors, flashing is prohibited" }
}flash_filedebug_filejlink/openocdflashcleanreferences/compiler-notes.md