Logo Convert Keil To Cmake

Convert Keil To Cmake

Cộng đồng
sunzhen222
convert-keil-to-cmake

Convert Keil MDK/uVision embedded projects into reproducible CMake builds, normally using Ninja and an Arm GNU toolchain, with concise bilingual build documentation. Use for `.uvprojx` or `.uvoptx` migration, Keil-to-GCC flag and linker-script translation, source/include/define extraction, startup and RTOS port selection, firmware artifact generation, prerequisite checking, generation-only delivery, user build guidance, or parity checks between an existing Keil target and a new CMake target.

Tổng quan

Nhà phát hànhsunzhen222
Kho mãconvert-keil-to-cmake
Tên kỹ năngconvert-keil-to-cmake
Sao
34
Bản fork
6
Tệp đi kèm
10
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 10 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được sunzhen222 công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Convert Keil To Cmake trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/sunzhen222/convert-keil-to-cmake/tree/main
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/sunzhen222/convert-keil-to-cmake.git \
  .claude/skills/convert-keil-to-cmake
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Convert Keil To Cmake trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Convert Keil To Cmake ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Convert Keil To Cmake với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Convert Keil to CMake

Create a maintainable CMake build that preserves the selected Keil target's firmware behavior while separating compiler-specific implementation details.

Workflow

  1. Locate .uvprojx, .uvoptx, startup files, scatter files, linker scripts, device packs, and existing build scripts. Do not edit generated IDE output directories.
  2. Ask for a target only when the project contains multiple materially different targets and the requested target cannot be inferred. Otherwise select the single target or the clearly named production target and state the choice.
  3. Run python scripts/inspect_uvprojx.py <project.uvprojx> [--target <name>] from this skill directory. Treat its JSON as an inventory, then verify paths and target/file overrides against the XML. Pay particular attention to runtime, memory_regions, existing_outputs, keil_build, and source_usage.
  4. Read references/conversion-reference.md before translating toolchain, CPU/FPU/ABI, optimization, scatter, library, startup, assembly, or RTOS settings.
  5. Copy assets/cmake/check_build_env.py into the project root as check_build_env.py, then tailor its required and optional tools to the selected generator, languages, toolchain, artifact steps, and existing project conventions. When Python is not a viable project prerequisite, generate an equivalent check_build_env.bat on Windows or check_build_env.sh on POSIX instead. Generate one appropriate checker, not every variant.
  6. Run the project-local checker before configuring. It must only inspect and report: it must not download software, invoke an installer or package manager, modify PATH, or change machine-wide state. Never install missing prerequisites without the user's explicit authorization.
  7. If required tools are missing, or the user requests no build, continue with generation-only, unverified mode when static project information is sufficient. Generate and statically review the migration files, but do not claim configure, compile, link, artifact, ELF, or parity validation. Report every missing prerequisite and the exact later verification commands.
  8. Reuse assets/cmake/ as a starting point when the repository has no stronger CMake convention. Use stm32-flash.ld.in only for a simple single-Flash/single-RAM layout. Replace every @...@ placeholder; remove unused sections instead of leaving speculative code.
  9. Generate a root CMakeLists.txt, a GNU Arm toolchain file, and a small host build wrapper only when useful. Follow the repository's established naming and directory organization.
  10. In normal validation mode, configure from a new build directory with CMAKE_EXPORT_COMPILE_COMMANDS=ON, build, and compare sources, defines, includes, artifacts, memory layout, and size with Keil. Fix errors rather than suppressing warnings globally.
  11. Run python scripts/validate_conversion.py <project.uvprojx> <build/compile_commands.json> --elf <build/firmware.elf> after a successful link. Pass each intentional compiler-specific replacement as --source-substitution <keil-path>=<gnu-path>.
  12. After generation and any available validation, create a concise project-root CMAKE_BUILD.md from assets/cmake/CMAKE_BUILD.md.in. Write every user-facing section in both Chinese and English, replace all placeholders, and ensure commands and artifact paths exactly match the generated project. Do not report the migration complete until this handoff document exists.

Authorization and Completion Status

  • Treat software installation as a separate, state-changing action. Detecting a missing command does not authorize installing or downloading it. Ask for explicit authorization before using an installer or package manager, changing PATH, or modifying machine-wide configuration; state the proposed tool, source, scope, and command first.
  • Do not make an installation quiet, unattended, or hidden merely to keep the migration moving. If authorization is not given, preserve the diagnostic result and use generation-only mode when possible.
  • Report validated only after the project checker passes, a clean configure and build succeeds, the firmware links, expected artifacts exist, and validate_conversion.py passes.
  • Report generated, unverified when CMake files and the project checker were generated and statically reviewed but any required configure, build, link, artifact, ELF, or parity check was not completed. This is a usable handoff state, not a validated migration.
  • If even generation cannot be completed because essential project data or a parsing runtime is unavailable, report the concrete blocker instead of labeling the result generated or validated.

User Handoff Document

  • Keep CMAKE_BUILD.md short and task-oriented. Include only status, prerequisites/environment check, exact configure/build commands, primary artifacts, and important validation limits or remaining differences.
  • Present Chinese first and English immediately after it within each section. Do not create separate language files, duplicate long logs, narrate the migration history, or paste full source/define/include inventories.
  • State either 已验证 / validated or 已生成、未验证 / generated, unverified prominently. In unverified mode, name the missing tools and unperformed checks without implying successful compilation.
  • Describe each primary artifact by path and purpose, normally .elf, .bin, .hex, .map, and any project-specific packaged image that is actually generated. Do not document hypothetical outputs.
  • Use commands that can be copied from the repository root. Include the project-local environment checker command before configure/build, and document optional clean, flash, or package commands only when those actions exist.

Conversion Rules

  • Make the Keil target the source of truth for source membership and preprocessor settings. Make the MCU datasheet, pack files, startup code, and scatter file the source of truth for architecture and memory layout.
  • Preserve source groups as readable CMake module lists. Use explicit lists for startup, HAL/LL drivers, middleware ports, syscall stubs, and other mutually exclusive implementations. Use GLOB only where the repository already accepts automatic discovery.
  • Keep compiler-specific files separate. Select GNU startup/assembly, GCC RTOS ports, and GCC syscall implementations; never compile Arm Compiler and GCC variants together.
  • Prefer target-scoped CMake commands. Keep CPU flags identical across C, C++, assembly, and link steps. Enable ASM explicitly.
  • Translate the scatter file deliberately. Reuse an existing validated GNU .ld script when present; otherwise create one from the actual memory regions and section rules. Never infer flash origin from total device capacity alone.
  • Preserve optimization and debug intent, but do not mechanically copy Arm Compiler flags into GCC. Record any semantic mismatch that cannot be reproduced exactly.
  • Avoid conflicting CMake build-type flags such as an implicit -O3 followed by a target -Os. Control or document the effective final optimization and do not add NDEBUG unless it matches the selected Keil target.
  • Map Keil MicroLIB deliberately. Inspect printf, floating-point formats, fputc, _write, semihosting markers, and available Flash before selecting newlib, newlib-nano, _printf_float, nosys, or a GCC syscall implementation.
  • Generate .elf, .bin, .hex, .map, and a size report. Preserve additional packaging, signing, OTA, flashing, or simulator steps only when they already belong to the project or the user requests them.
  • Keep the project-local environment checker diagnostic-only and version-controlled with the generated build files. Required tools must match the normal build path; deployment/debug tools should be optional unless the requested build inherently requires them.
  • Do not change application C/C++ code merely to make migration easier unless a genuine compiler portability issue is found. Keep such fixes small and explain them.
  • Do not delete or rewrite the Keil project unless explicitly requested. A migration should remain auditable.

Required Validation

  • Confirm every intended Keil source is represented once and every excluded or alternate-toolchain source remains excluded.
  • Confirm defines and include directories, including file/group overrides where relevant.
  • Confirm MCU core, instruction set, FPU, float ABI, startup object, interrupt vectors, linker entry point, and memory origin/length.
  • Confirm the selected RTOS, CMSIS, HAL/LL, USB, filesystem, C library, and syscall variants.
  • Classify diagnostics as migration errors, pre-existing application warnings, or expected runtime/toolchain warnings. Do not hide behavior-affecting warnings.
  • In validated mode, build from a clean directory and require successful configure and link. Inspect the map and size output; verify .bin and .hex generation. In generation-only mode, mark all of these checks unperformed.
  • When Keil CLI is available, build the same target and compare error count, warnings that affect behavior, code/data size, and key symbols. If hardware is available and flashing is authorized, perform the project's normal smoke check.
  • Report what was migrated, validation performed, remaining differences, and exact build command.
  • Verify CMAKE_BUILD.md is bilingual, concise, free of template placeholders, and consistent with the actual generator, toolchain file, target name, build directory, and artifact paths.
  • Compare Flash load bytes and RAM components separately. State whether reported RAM includes .data, .bss, heap, stack, retained sections, or runtime state.

Repository Style Baseline

When no local convention exists, use the style derived from the reference project:

  • one readable root build definition with named directory variables and module source collections;
  • Ninja out-of-source builds with arm-none-eabi-gcc, objcopy, and size;
  • a dedicated simulator/host branch only if the original repository already supports it;
  • explicit device definitions, GCC middleware ports, startup assembly, and linker script;
  • post-build firmware formats and map/size diagnostics;
  • compile_commands.json, linker-script LINK_DEPENDS, and declared post-build byproducts;
  • a thin wrapper for clean, build, package, copy, or flash actions, keeping optional deployment actions separate from compilation.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Convert Keil To Cmake làm được gì?

Convert Keil MDK/uVision embedded projects into reproducible CMake builds, normally using Ninja and an Arm GNU toolchain, with concise bilingual build documentation. Use for `.uvprojx` or `.uvoptx` migration, Keil-to-GCC flag and linker-script translation, source/include/define extraction, startup and RTOS port selection, firmware artifact generation, prerequisite checking, generation-only delivery, user build guidance, or parity checks between an existing Keil target and a new CMake target.

Vì sao nên dùng Convert Keil To Cmake trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Convert Keil To Cmake là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Convert Keil To Cmake trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/sunzhen222/convert-keil-to-cmake/tree/main. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Convert Keil To Cmake?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Convert Keil To Cmake với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Convert Keil To Cmake với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Convert Keil To Cmake có miễn phí không?

Có. Kỹ năng này được sunzhen222 phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇