← Commit history
README.md+23−2
@@ -1,3 +1,24 @@-# STM32 USB class test pack+# adom-usb-stub-stm32 -Flash stub firmware over USB DFU (0483:df11) to make any STM32 enumerate as each supported USB class — MSC, HID, CDC, RNDIS, audio, MIDI, DFU.+**adom-usb firmware device-test pack — STMicroelectronics.** Flash stub firmware over USB DFU (0483:df11) to make any STM32 enumerate as each supported USB class — MSC, HID, CDC, RNDIS, audio, MIDI, DFU.++```bash+adompkg install adom-usb-stub-stm32+```++## Personas++| id | flashes | enumerates as |+|---|---|---|+| `msc-disk` | Mass storage | Mass storage |+| `hid-keyboard` | HID keyboard | HID keyboard |+| `hid-mouse` | HID mouse | HID mouse |+| `cdc-serial` | CDC virtual COM | CDC serial |+| `cdc-rndis` | RNDIS/ECM ethernet | CDC ethernet |+| `audio` | USB Audio (UAC1) | Audio |+| `midi` | USB-MIDI | Audio/MIDI |+| `dfu` | DFU bootloader | DFU |++Chips: stm32f0, stm32f1, stm32f4, stm32f7, stm32h7, stm32l4 · flash method: `dfu-util`.++Once installed, `adom-usb` shows a **Flash ▾** persona picker on matching devices. Pick a persona, the pack flashes the stub, and the device re-enumerates as that USB class so you can mount / test / sniff it. This package ships the flash **contract** (a reference template) — drop your real signed firmware artifacts in `firmware/<persona>.<ext>` and publish your own version. See the adom-usb wiki page → *Writing a packet-sniffer plugin* (firmware packs share the same lifecycle).
adom-usb-stub-stm32added+28
@@ -0,0 +1,28 @@+#!/usr/bin/env bash+# STM32 USB class test pack — adom-usb FIRMWARE device-test pack (API v1). Implements: manifest, personas, flash.+# REFERENCE TEMPLATE: drop your real firmware artifacts in firmware/<persona>.<ext> and wire+# the dfu-util call below. Ships the flash CONTRACT; manufacturers ship the binaries.+set -euo pipefail; HERE="$(cd "$(dirname "$0")" && pwd)"+cmd="${1:-}"; shift || true+case "$cmd" in+  manifest) cat "$HERE/plugin.json";;+  personas) if command -v jq >/dev/null; then jq -c '.personas' "$HERE/plugin.json"; else grep -o '"personas".*' "$HERE/plugin.json"; fi;;+  flash)+    PERSONA="" VID="" PID="" BUSID="" TARGET=""+    while [ $# -gt 0 ]; do case "$1" in --persona)PERSONA="$2";shift 2;; --vid)VID="$2";shift 2;; --pid)PID="$2";shift 2;; --busid)BUSID="$2";shift 2;; --target)TARGET="$2";shift 2;; *)shift;; esac; done+    ART="$HERE/firmware/${PERSONA}.bin"; METHOD="dfu-util"+    # The real flash call (chip-specific). Degrades to a dry-run when the tool/artifact is absent.+    case "$METHOD" in+      uf2-bootsel) RUN="picotool load $HERE/firmware/${PERSONA}.uf2 -f && picotool reboot";;+      dfu-util)    RUN="dfu-util -a 0 -s 0x08000000:leave -D $ART";;+      esptool)     RUN="esptool.py --chip auto write_flash 0x0 $ART";;+      nrfutil)     RUN="nrfutil device program --firmware $ART";;+      openocd)     RUN="openocd -f board/ti_sitara.cfg -c 'program $ART verify reset exit'";;+      bossac)      RUN="bossac -e -w -v -R $ART";;+      wchisp)      RUN="wchisp flash $ART";;+      *)           RUN="<flash $ART via $METHOD>";;+    esac+    if [ -f "$ART" ] || [ -f "$HERE/firmware/${PERSONA}.uf2" ]; then eval "$RUN" >/dev/null 2>&1 && STATUS="flashed" || STATUS="flash-failed"; else STATUS="dry-run (no bundled artifact — template)"; fi+    printf '{"ok":true,"persona":"%s","method":"%s","status":"%s","command":"%s","summary":"%s: device will re-enumerate as the persona USB class — refresh adom-usb"}\n' "$PERSONA" "$METHOD" "$STATUS" "$RUN" "$PERSONA";;+  *) echo "usage: adom-usb-stub-stm32 manifest | personas | flash --persona <id> --vid <hex> --pid <hex> --busid <b> --target <host>" >&2; exit 2;;+esac
install.shadded+9
@@ -0,0 +1,9 @@+#!/bin/bash+set -euo pipefail+DIR="$(cd "$(dirname "$0")" && pwd)"; SLUG="adom-usb-stub-stm32"+PDIR="${HOME}/.adom/usb-plugins/${SLUG}"; mkdir -p "$PDIR" "${HOME}/.local/bin"+install -m 0644 "$DIR/plugin.json" "$PDIR/plugin.json"+install -m 0755 "$DIR/$SLUG" "$PDIR/$SLUG"+[ -d "$DIR/firmware" ] && cp -r "$DIR/firmware" "$PDIR/" || true+ln -sf "$PDIR/$SLUG" "${HOME}/.local/bin/$SLUG"+echo "Installed plugin $SLUG -> $PDIR (adom-usb discovers it on next refresh)"
package.jsonadded+116
@@ -0,0 +1,116 @@+{+  "slug": "adom-usb-stub-stm32",+  "version": "0.1.0",+  "type": "app",+  "description": "Flash stub firmware over USB DFU (0483:df11) to make any STM32 enumerate as each supported USB class \u2014 MSC, HID, CDC, RNDIS, audio, MIDI, DFU.",+  "dependencies": {},+  "keywords": [+    "adom-usb-plugin",+    "firmware",+    "usb-stub",+    "stmicroelectronics"+  ],+  "license": "MIT",+  "scripts": {+    "install": "./install.sh",+    "uninstall": "./uninstall.sh"+  },+  "files": [+    "adom-usb-stub-stm32",+    "plugin.json",+    "install.sh",+    "uninstall.sh",+    "package.json",+    "README.md",+    "page.json",+    "screenshots/**",+    "skills/**"+  ],+  "adom_usb_plugin": {+    "kind": "firmware",+    "entrypoint": "adom-usb-stub-stm32",+    "vendor": "STMicroelectronics",+    "chips": [+      "stm32f0",+      "stm32f1",+      "stm32f4",+      "stm32f7",+      "stm32h7",+      "stm32l4"+    ],+    "matches": {+      "vid": [+        "0483"+      ],+      "pid": [+        "*"+      ]+    },+    "flash_method": "dfu-util",+    "personas": [+      {+        "id": "msc-disk",+        "name": "Mass storage",+        "usb_class": "Mass storage",+        "result_vid": "0483",+        "result_pid": "5720"+      },+      {+        "id": "hid-keyboard",+        "name": "HID keyboard",+        "usb_class": "HID keyboard",+        "result_vid": "0483",+        "result_pid": "5750"+      },+      {+        "id": "hid-mouse",+        "name": "HID mouse",+        "usb_class": "HID mouse",+        "result_vid": "0483",+        "result_pid": "5751"+      },+      {+        "id": "cdc-serial",+        "name": "CDC virtual COM",+        "usb_class": "CDC serial",+        "result_vid": "0483",+        "result_pid": "5740"+      },+      {+        "id": "cdc-rndis",+        "name": "RNDIS/ECM ethernet",+        "usb_class": "CDC ethernet",+        "result_vid": "0483",+        "result_pid": "5760"+      },+      {+        "id": "audio",+        "name": "USB Audio (UAC1)",+        "usb_class": "Audio",+        "result_vid": "0483",+        "result_pid": "5730"+      },+      {+        "id": "midi",+        "name": "USB-MIDI",+        "usb_class": "Audio/MIDI",+        "result_vid": "0483",+        "result_pid": "5731"+      },+      {+        "id": "dfu",+        "name": "DFU bootloader",+        "usb_class": "DFU",+        "result_vid": "0483",+        "result_pid": "df11"+      }+    ],+    "api_version": "1"+  },+  "tags": [+    "adom-usb-plugin",+    "firmware",+    "usb-stub",+    "stmicroelectronics"+  ]+}\ No newline at end of file
page.json+3−20
@@ -1,9 +1,8 @@ {-  "schema_version": 1,   "type": "app",   "slug": "adom-usb-stub-stm32",   "title": "STM32 USB class test pack",-  "brief": "Flash stub firmware over USB DFU (0483:df11) to make any STM32 enumerate as each supported USB class — MSC, HID, CDC, RNDIS, audio, MIDI, DFU.",+  "brief": "Flash stub firmware over USB DFU (0483:df11) to make any STM32 enumerate as each supported USB class \u2014 MSC, HID, CDC, RNDIS, audio, MIDI, DFU.",   "version": "0.1.0",   "visibility": "public",   "hero": {@@ -11,10 +10,7 @@     "path": "screenshots/hero.png"   },   "install": {-    "binary_name": "adom-usb-stub-stm32",-    "install_dir": "",-    "install_hint": "",-    "version_cmd": ""+    "binary_name": "adom-usb-stub-stm32"   },   "metadata": {     "version": "0.1.0",@@ -29,18 +25,5 @@       "flash usb persona",       "test usb device"     ]-  },-  "author": {-    "id": "6738b00a4dc87b8adbb0a5a3",-    "name": "John Lauer",-    "email": "[email protected]"-  },-  "tags": [],-  "license": "proprietary",-  "sample_prompts": [],-  "discovery_triggers": [],-  "discovery_pitch": null,-  "created_at": "2026-06-20T02:58:25.882Z",-  "updated_at": "2026-06-20T02:58:25.882Z",-  "skills": []+  } }\ No newline at end of file
plugin.jsonadded+86
@@ -0,0 +1,86 @@+{+  "slug": "adom-usb-stub-stm32",+  "name": "STM32 USB class test pack",+  "version": "0.1.0",+  "api_version": "1",+  "kind": "firmware",+  "entrypoint": "adom-usb-stub-stm32",+  "vendor": "STMicroelectronics",+  "chips": [+    "stm32f0",+    "stm32f1",+    "stm32f4",+    "stm32f7",+    "stm32h7",+    "stm32l4"+  ],+  "matches": {+    "vid": [+      "0483"+    ],+    "pid": [+      "*"+    ]+  },+  "flash_method": "dfu-util",+  "personas": [+    {+      "id": "msc-disk",+      "name": "Mass storage",+      "usb_class": "Mass storage",+      "result_vid": "0483",+      "result_pid": "5720"+    },+    {+      "id": "hid-keyboard",+      "name": "HID keyboard",+      "usb_class": "HID keyboard",+      "result_vid": "0483",+      "result_pid": "5750"+    },+    {+      "id": "hid-mouse",+      "name": "HID mouse",+      "usb_class": "HID mouse",+      "result_vid": "0483",+      "result_pid": "5751"+    },+    {+      "id": "cdc-serial",+      "name": "CDC virtual COM",+      "usb_class": "CDC serial",+      "result_vid": "0483",+      "result_pid": "5740"+    },+    {+      "id": "cdc-rndis",+      "name": "RNDIS/ECM ethernet",+      "usb_class": "CDC ethernet",+      "result_vid": "0483",+      "result_pid": "5760"+    },+    {+      "id": "audio",+      "name": "USB Audio (UAC1)",+      "usb_class": "Audio",+      "result_vid": "0483",+      "result_pid": "5730"+    },+    {+      "id": "midi",+      "name": "USB-MIDI",+      "usb_class": "Audio/MIDI",+      "result_vid": "0483",+      "result_pid": "5731"+    },+    {+      "id": "dfu",+      "name": "DFU bootloader",+      "usb_class": "DFU",+      "result_vid": "0483",+      "result_pid": "df11"+    }+  ],+  "description": "Flash stub firmware over USB DFU (0483:df11) to make any STM32 enumerate as each supported USB class \u2014 MSC, HID, CDC, RNDIS, audio, MIDI, DFU.",+  "homepage": "https://wiki.adom.inc/john/adom-usb-stub-stm32"+}\ No newline at end of file
skills/adom-usb-stub-stm32/SKILL.mdadded+11
@@ -0,0 +1,11 @@+---+name: adom-usb-stub-stm32+description: >+  adom-usb firmware plugin. Flash stub firmware over USB DFU (0483:df11) to make any STM32 enumerate as each supported USB class — MSC, HID, CDC, RNDIS, audio, MIDI, DFU. Trigger words: adom-usb-stub-stm32, adom-usb plugin, usb firmware, flash usb persona, stub firmware, make device act like keyboard/disk/mouse.+---++# adom-usb-stub-stm32++Flash stub firmware over USB DFU (0483:df11) to make any STM32 enumerate as each supported USB class — MSC, HID, CDC, RNDIS, audio, MIDI, DFU.++Install: `adompkg install adom-usb-stub-stm32`. adom-usb discovers it automatically (scans `~/.adom/usb-plugins/`) and shows a Flash persona picker on matching devices. See the adom-usb wiki page for the plugin API.
uninstall.shadded+4
@@ -0,0 +1,4 @@+#!/bin/bash+set -euo pipefail+rm -rf "${HOME}/.adom/usb-plugins/adom-usb-stub-stm32" "${HOME}/.local/bin/adom-usb-stub-stm32"+echo "Removed adom-usb-stub-stm32"