agentleFS
54xkeee54xkeee/agent-diansai-skill/skills/stm32cubemx/SKILL.md

stm32cubemx

Skill4 starsChanged 6 months agoMITView on GitHub

Use when Codex needs to operate STM32CubeMX from the command line to validate or load .ioc files, generate STM32CubeMX projects, create Keil/MDK-ARM project files, run Keil UV4 command-line builds, inspect CubeMX/Keil logs, or diagnose STM32CubeMX generation and STM32 HAL project build failures.

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 6 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill to turn .ioc validation into an actual STM32CubeMX and Keil build check, not just text parsing.

    line 8
  2. Very specific:

    Start with an existing .ioc file.

    line 12
  3. Distinctive:

    Prefer the bundled script:

    line 13
  4. Distinctive:

    If CubeMX or Keil is not found, rerun with explicit paths:

    line 19
  5. Distinctive:

    Use STM32CubeMX quiet script mode for real validation:

    line 29
  6. Distinctive:

    Run it on Windows as:

    line 40
  7. Very specific:

    Treat config load followed by OK, project generate followed by OK, and generated Core/Src/main.c as the baseline CubeMX success criteria.

    line 46
  8. Very specific:

    Use UV4.exe -b <project.uvprojx> -j0 -o <log> for build verification.

    line 50
  9. Very specific:

    If CubeMX cannot load the .ioc, inspect the CubeMX log around config load first.

    line 58
  10. Very specific:

    If CubeMX loads but cannot generate, inspect the log around project generate.

    line 59
  11. Very specific:

    If Keil fails before compiling user files and mentions C:\WINDOWS\TEMP, rerun with a writable temp directory.

    line 60
  12. Very specific:

    If Keil reports I/O error writing file ...

    line 61
  13. Distinctive:

    If Keil compiles but links fail because object files are missing, read earlier compile errors.

    line 62
  14. Distinctive:

    Do not claim the firmware is hardware-tested unless flashing and board-level runtime checks were actually performed.

    line 64
  15. Very specific:

    Keep validation artifacts near the .ioc unless the user requests a different destination:

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

STM32CubeMX

Use this skill to turn .ioc validation into an actual STM32CubeMX and Keil build check, not just text parsing.

Workflow

  1. Start with an existing .ioc file. If the user only has a desired STM32 configuration, first create or obtain the .ioc using the relevant STM32 configuration skill or local tooling.
  2. Prefer the bundled script:
python "$env:USERPROFILE\.codex\skills\stm32cubemx\scripts\cubemx_generate_build.py" --ioc "D:\path\project.ioc" --build-keil --clean-keil-output
  1. If CubeMX or Keil is not found, rerun with explicit paths:
python "$env:USERPROFILE\.codex\skills\stm32cubemx\scripts\cubemx_generate_build.py" --ioc "D:\path\project.ioc" --cubemx "D:\STM32CubeMX" --uv4 "C:\Keil_v5\UV4\UV4.exe" --build-keil
  1. Report the generated project directory, CubeMX log, Keil log, and whether the build produced 0 Error(s), 0 Warning(s).

CubeMX Command Mode

Use STM32CubeMX quiet script mode for real validation:

config load "<absolute .ioc path>"
project name <project_name>
project toolchain "MDK-ARM"
project path "<output root>"
project generate
exit

Run it on Windows as:

& "<CubeMX>\jre\bin\java.exe" -jar "<CubeMX>\STM32CubeMX.exe" -q "<script file>"

Treat config load followed by OK, project generate followed by OK, and generated Core/Src/main.c as the baseline CubeMX success criteria.

Keil Build Mode

Use UV4.exe -b <project.uvprojx> -j0 -o <log> for build verification. In this environment ARMCC V5 builds the CubeMX project reliably with Keil's default parallel setting.

Set TEMP and TMP to a writable folder before running Keil. ARMCC can fail with cannot open embedded assembler output file "C:\WINDOWS\TEMP\..." when the process cannot write to the default temp directory. This is an environment problem, not an .ioc problem.

The bundled script handles this by creating a local keil_temp folder and overriding TEMP/TMP for the build subprocess.

Diagnosis Rules

  • If CubeMX cannot load the .ioc, inspect the CubeMX log around config load first.
  • If CubeMX loads but cannot generate, inspect the log around project generate.
  • If Keil fails before compiling user files and mentions C:\WINDOWS\TEMP, rerun with a writable temp directory.
  • If Keil reports I/O error writing file ... .o, retry with --jobs 0 --clean-keil-output and a writable local TEMP/TMP.
  • If Keil compiles but links fail because object files are missing, read earlier compile errors; the link error is usually downstream.
  • Ignore CubeMX update, advertisement image, and SQLite temp cleanup warnings unless they occur before config load or block project generate.
  • Do not claim the firmware is hardware-tested unless flashing and board-level runtime checks were actually performed.

Outputs

Keep validation artifacts near the .ioc unless the user requests a different destination:

<ioc folder>/cubemx_project/<project_name>/
<ioc folder>/cubemx_verify_script.txt
<ioc folder>/cubemx_generate.log
<ioc folder>/keil_build.log

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.