Logo: Convert Keil To Cmake

Convert Keil To Cmake

Communautéit
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.

Iwwersiicht

Editeursunzhen222
Repositoryconvert-keil-to-cmake
Skill-Nummconvert-keil-to-cmake
Stären
34
Forks
6
Matgeliwwert Dateien
10
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 10 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    sunzhen222 huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Convert Keil To Cmake an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/sunzhen222/convert-keil-to-cmake/tree/main
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/sunzhen222/convert-keil-to-cmake.git \
  .claude/skills/convert-keil-to-cmake
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Convert Keil To Cmake an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Convert Keil To Cmake automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Convert Keil To Cmake net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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.

Firwat Convert Keil To Cmake op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Convert Keil To Cmake besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Convert Keil To Cmake an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/sunzhen222/convert-keil-to-cmake/tree/main an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Convert Keil To Cmake benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Convert Keil To Cmake benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Convert Keil To Cmake domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Convert Keil To Cmake gratis?

Jo. sunzhen222 huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇