Logo : Convert Keil To Cmake

Convert Keil To Cmake

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

Présentation

Éditeursunzhen222
Dépôtconvert-keil-to-cmake
Nom de la compétenceconvert-keil-to-cmake
Étoiles
34
Forks
6
Fichiers inclus
10
LicenceMIT
Liens
  • Instructions en Markdown

    Un fichier SKILL.md que le modèle charge à la demande : il ne consomme donc des tokens que lorsqu’une demande correspond réellement à la compétence.

  • Compatible avec tous les LLM

    Les compétences IA sont rédigées en Markdown et non sous forme de code propre à un fournisseur. Elles fonctionnent donc avec GPT, Claude, Gemini, Grok ou un modèle local.

  • Fichiers inclus : 10

    Des scripts, des gabarits et des références que le modèle peut consulter pendant son travail. Les fichiers sont en lecture seule et ne sont jamais exécutés.

  • Open source

    Publiée par sunzhen222 sur GitHub. Consultez les sources avant de l’installer.

Installation

Installez la compétence IA Convert Keil To Cmake dans TypingMind pour l’utiliser avec n’importe quel LLM, ou ajoutez-la à un autre agent capable de lire SKILL.md.

1

Installer dans TypingMind

TypingMind installe une compétence directement depuis son dossier GitHub : l’application lit SKILL.md, regroupe les fichiers de ressources et enregistre le tout localement.

  1. Ouvrez l’application et accédez à Plugins → Compétences.
  2. Choisissez « Installer depuis GitHub ».
  3. Copiez l’URL ci-dessous, qui pointe vers le dossier de la compétence, puis collez-la et confirmez.
    https://github.com/sunzhen222/convert-keil-to-cmake/tree/main
  4. Activez la compétence dans chaque discussion où vous souhaitez pouvoir l’utiliser.
Plugins → Compétences → Ajouter une compétence → Via une URL GitHub, puis collez l’URL du dossier et appuyez sur Continuer.
2

Installer dans un autre agent

Tout agent capable de lire le format Agent Skills peut utiliser cette compétence : copiez le dossier dans le répertoire des compétences de cet agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/sunzhen222/convert-keil-to-cmake.git \
  .claude/skills/convert-keil-to-cmake
Redémarrez Claude Code après la copie pour que la nouvelle compétence soit prise en compte.

Utilisez cette compétence dans TypingMind

Activez Convert Keil To Cmake dans n’importe quelle discussion TypingMind et le modèle s’occupe du reste. Le nom et la description de la compétence figurent dans le prompt système. Dès qu’une demande correspond, le modèle charge lui-même l’intégralité des instructions : vous n’avez jamais à l’invoquer manuellement, et elle ne consomme aucun token tant qu’elle n’est pas utilisée.

Le modèle charge automatiquement Convert Keil To Cmake dès qu’une demande correspond à cette compétence.

Compatible avec tous les modèles IA

Les compétences IA sont de simples instructions Markdown, et non du code propre à un fournisseur. Ainsi, la compétence Convert Keil To Cmake n’est pas liée au modèle pour lequel elle a été conçue. Installez-la une seule fois dans TypingMind et utilisez-la avec GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou un modèle local que vous exécutez vous-même, le tout avec vos propres clés API.

  • Chargée uniquement en cas de besoin

    Le prompt système ne contient que le nom et la description. Les instructions sont récupérées à la première demande correspondante : une compétence inutilisée ne coûte donc rien.

  • Changez de modèle en cours de discussion

    La compétence étant constituée d’instructions et non de code, elle reste fonctionnelle lorsque vous changez de modèle : le nouveau modèle lit le même fichier SKILL.md.

Instructions de la compétence

Voici le contenu de SKILL.md que le modèle charge. Lisez-le avant l’installation : une compétence contient des instructions que votre modèle suivra.

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.

Fichiers inclus

Le modèle lit ces fichiers à la demande lorsque la compétence est chargée. Ils sont accessibles en lecture et ne sont jamais exécutés.

Foire aux questions

À quoi sert la compétence IA 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.

Pourquoi utiliser Convert Keil To Cmake sur TypingMind ?

Parce que vous l’installez une seule fois pour l’utiliser avec n’importe quel modèle. Convert Keil To Cmake se compose de simples instructions en Markdown plutôt que de code propre à un fournisseur. La même compétence fonctionne donc avec GPT-5, Claude, Gemini, Grok ou un modèle local, et vous pouvez changer de modèle en cours de discussion sans perturber son fonctionnement. TypingMind utilise vos propres clés API : vous payez donc directement les fournisseurs plutôt qu’un abonnement par siège, et vos compétences et discussions restent dans votre propre espace de stockage.

Comment installer Convert Keil To Cmake dans TypingMind ?

Dans TypingMind, ouvrez Plugins → Compétences → Installer depuis GitHub et collez https://github.com/sunzhen222/convert-keil-to-cmake/tree/main. TypingMind lit le fichier SKILL.md, regroupe les fichiers associés et installe le tout sous forme de compétence que vous pouvez activer pour chaque discussion.

Quels modèles d’IA peuvent utiliser Convert Keil To Cmake ?

N’importe quel modèle que vous connectez dans TypingMind. Les compétences IA sont de simples instructions en Markdown, et non du code propre à un fournisseur. GPT, Claude, Gemini, Grok et les modèles locaux peuvent donc tous charger cette compétence lorsqu’une demande lui correspond.

Combien de modèles d’IA puis-je utiliser avec Convert Keil To Cmake ?

Autant que vous le souhaitez. Vous pouvez utiliser Convert Keil To Cmake avec tout modèle qui prend en charge les compétences : GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama et bien d’autres, le tout dans TypingMind avec vos propres clés API.

La compétence IA Convert Keil To Cmake est-elle gratuite ?

Oui. Cette compétence est publiée sur GitHub par sunzhen222 sous licence MIT. Vous ne payez que votre propre fournisseur d’IA pour les tokens utilisés.

Que sont les compétences IA ?

Une compétence IA est un ensemble d’instructions réutilisables qui apprend à un modèle d’IA à accomplir une tâche précise. Elle suit le format ouvert Agent Skills : un fichier SKILL.md contenant un nom et une description, ainsi que les éventuels scripts, gabarits ou fichiers de référence dont le modèle peut avoir besoin. Le modèle ne lit les instructions que lorsque votre demande correspond à la compétence. Une compétence installée ne coûte donc rien tant qu’elle n’est pas utilisée.

En quoi les compétences IA diffèrent-elles des plugins ou des serveurs MCP ?

Un plugin ou un serveur MCP fournit au modèle de nouveaux outils à appeler : du code qui s’exécute quelque part et renvoie un résultat. Une compétence IA lui apporte plutôt des connaissances et une méthode : comment aborder une tâche, quelles étapes suivre et à quoi ressemble un bon résultat. Les compétences sont de simples instructions en Markdown. Elles ne nécessitent donc ni serveur, ni clé API, ni environnement d’exécution, et fonctionnent avec n’importe quel modèle.

Tout voir

Créez votre propre espace de travail IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇