SuperAPI AI Directory

eide

Coding & development

View repository

Updated 10-15 23:56

About this skill

EIDE embedded project build

This skill provides discovery of EIDE (Embedded IDE) projects, build configuration enumeration, incremental compilation, full rebuild, clean, and ELF size analysis capabilities, and returns firmware artifact paths that can be used by jlink/openocd for continued use.

EIDE is an embedded development extension under VS Code, using the ARM CC (AC5/AC6) or GCC toolchain, driven through the unify_builder unified build backend.

Configuration

Environment-level configuration (skill/config.json)

The config.json in the skill directory contains environment-level configuration; before first use, confirm that the builder_dir path is correct:

{
  "builder_dir": "C:\\Users\\<user>\\.vscode\\extensions\\cl.eide-<version>\\res\\tools\\win32\\unify_builder",
  "builder_exe": "unify_builder.exe",
  "code_exe": "code",
  "toolchain_prefix": "arm-none-eabi-",
  "operation_mode": 1
}
  • builder_dir: the directory where EIDE unify_builder is located (required, located under the VS Code extension directory)
  • builder_exe: builder executable filename, default on Windows unify_builder.exe
  • code_exe: VS Code CLI path, by default looked up from PATH code
  • toolchain_prefix: toolchain prefix used for size analysis, default arm-none-eabi-
  • operation_mode:1 executes directly / 2 outputs a risk summary but does not block / 3 confirm before execution

Project-level configuration (workspace/.embeddedskills/config.json)

Project-level shared configuration is uniformly stored in the workspace .embeddedskills/config.json in:

{
  "eide": {
    "project": "",
    "config": "",
    "log_dir": ".embeddedskills/build"
  }
}
  • project: default EIDE project root directory (containing .eide/eide.yml directory), automatically updated after a successful build
  • config: default build configuration name (corresponding to the ConfigName in eide.yml), automatically updated after a successful build
  • log_dir: build log output directory, default .embeddedskills/build

Parameter parsing priority

Parameter parsing order (from high to low):

  1. Explicit CLI parameters
  2. Environment-level configuration (skill/config.json)
  3. Project-level configuration (.embeddedskills/config.json)
  4. .embeddedskills/state.json(last build record)
  5. Search/Ask

Subcommand

Subcommand Purpose Risk
scan Search for EIDE projects in the current directory (directories containing .eide/eide.yml ) Low
configs Enumerate build configurations in the project Low
build Incremental compilation Medium
rebuild Full rebuild Medium
clean Clean build artifacts High
size Analyze ELF file size (text/data/bss and memory usage) Low

Execution flow

  1. Read config.json, confirm that the builder_dir path is valid
  2. When no subcommand is specified, execute by default scan
  3. When no project path is provided, first execute scan to search for projects
  4. When multiple projects or multiple configurations are discovered at the same time, list the options for the user to choose, never guess automatically
  5. build/rebuild/clean based on operation_mode determine whether confirmation is needed
  6. build/rebuild After success, parse from the build directory elf_file / hex_file and other artifact paths
  7. All build commands are based on builder.params invoking unify_builder, output to a log file and then parse
  8. size By default, analyze the .elf file of the most recent build artifact

Script invocation

There are Python scripts in the skill directory, implemented using the standard library + PyYAML.

eide_project.py — Project scan and configuration enumeration

# 扫描工程
python <skill-dir>/scripts/eide_project.py scan --root <搜索目录> --json

# 枚举构建配置
python <skill-dir>/scripts/eide_project.py configs --project <工程目录> --json

eide_build.py — Build / Rebuild / Clean

python <skill-dir>/scripts/eide_build.py <build|rebuild|clean> \
  --builder-dir <unify_builder目录> \
  --project <工程根目录> \
  --config <配置名称> \
  --log-dir <日志目录> \
  --json

rebuild Additional support for --clean-first Clean first, then rebuild.

eide_size.py — ELF size analysis

# 基本分析
python <skill-dir>/scripts/eide_size.py analyze \
  --elf <elf文件路径> \
  --toolchain-prefix arm-none-eabi- \
  --json

# 对比分析
python <skill-dir>/scripts/eide_size.py compare \
  --elf <elf文件1> \
  --compare <elf文件2> \
  --toolchain-prefix arm-none-eabi- \
  --json

Output format

All scripts return results in JSON format, with the base field being status(ok/error)、action、summary、details, and may also include context、artifacts、metrics、state、next_actions、timing。

Success example:

{
  "status": "ok",
  "action": "build",
  "summary": "build 成功,errors=0 warnings=2",
  "details": {
    "project": "Vendor/EIDE",
    "config": "W20_Mainboard",
    "build_dir": "build/W20_Mainboard",
    "elf_file": "build/W20_Mainboard/MDK-ARM_F403A.elf",
    "hex_file": "build/W20_Mainboard/MDK-ARM_F403A.hex",
    "log_file": ".embeddedskills/build/MDK-ARM_F403A-W20_Mainboard-build.log"
  },
  "artifacts": {
    "elf_file": "build/W20_Mainboard/MDK-ARM_F403A.elf",
    "hex_file": "build/W20_Mainboard/MDK-ARM_F403A.hex",
    "flash_file": "build/W20_Mainboard/MDK-ARM_F403A.hex",
    "debug_file": "build/W20_Mainboard/MDK-ARM_F403A.elf"
  },
  "metrics": { "errors": 0, "warnings": 2, "flash_bytes": 32768, "ram_bytes": 8192 }
}

Error example:

{
  "status": "error",
  "action": "build",
  "error": { "code": "builder_not_found", "message": "unify_builder.exe 不存在,请确认 EIDE 扩展已安装" }
}

Core rules

  • Do not modify .eide/eide.yml or any EIDE project configuration file
  • Do not automatically guess the project path or build configuration; when there is ambiguity, you must ask the user
  • For parameter parsing priority, see the "Parameter parsing priority" section above
  • After a successful build, preferentially use the returned flash_file / debug_file and jlink/openocd concatenated
  • clean is not implicitly executed in the automated workflow
  • When a build fails, preferentially display the first error and the log file path
  • In the result echo, always include the project name, configuration name, and build directory path; when the build succeeds, preferentially echo the artifact path
  • An EIDE project has as its root directory the directory containing .eide/eide.yml 's directory is the root directory

Relationship with Keil projects

The EIDE project in this project shares the same source code and ARM CC toolchain with the Keil MDK project (D:\Keil_V543\ARM\ARMCLANG). The EIDE project describes the project structure through eide.yml , andbuilder.params is automatically generated by EIDE and used by unify_builder . The build artifacts of both (.axf/.hex/.elf) are format-compatible and interchangeable.

References

  • EIDE extension: search in VS Code for cl.eide to install
  • eide.yml Format: see the EIDE extension documentation
  • builder.params: automatically generated by EIDE, located in build/<ConfigName>/builder.params