Turns the ZMK Lily58 nRF52840 Pro Micro clone into a Bluetooth HCI-USB dongle
(Zephyr samples/bluetooth/hci_usb) without touching local disk: GitHub's free
runner downloads ZMK + Zephyr, builds, and returns a ready-to-flash zephyr.uf2.
Everything is staged in RAM at /tmp/opencode/hci-usb-build/.
zephyr.uf2— linked at0x26000for the Adafruit nRF52 bootloader (the code partition ZMK defines innrf52840_uf2_boot_mode.dtsi).- After flashing, the board enumerates as
2FE3:000B"Zephyr USBD BT HCI".
# 0. Make sure gh exists (else: browser path below)
gh --version
# 1. Authenticate (device flow: opens a code, enter it on github.com on any device)
gh auth login
# 2. Create the repo and push the workflow (public or private both fine)
cd /tmp/opencode/hci-usb-build
git init -b main
git add .
git commit -m "hci_usb cloud build"
gh repo create hci-usb-build --source . --push --public
# 3. Trigger the build (default board = nice_nano v1)
gh workflow run hci_usb.yml --repo <your-user>/hci-usb-build -f board=nice_nano@1//zmk
# 4. Wait ~5-10 min (first run downloads Zephyr; cached on repeats)
gh run watch --repo <your-user>/hci-usb-build
# 5. Download the artifact (fetches as a zip into a tmpfs dir)
mkdir -p /tmp/opencode/hci_usb_dl
gh run download --repo <your-user>/hci-usb-build \
-n hci_usb_uf2 -D /tmp/opencode/hci_usb_dl
ls -l /tmp/opencode/hci_usb_dl/zephyr.uf2No browser? gh auth login supports a device code flow — scroll-friendly one-liner.
GitHub-token-less alternative (browser): create an empty repo at github.com →
upload .github/workflows/hci_usb.yml via the web editor → Actions tab →
"Run workflow" → download artifact in browser → copy the .uf2 over however
you move files to this machine.
# Ensure the bootloader drive is mounted
ls /media/surfer/NICENANO
# Copy the UF2 -> bootloader auto-flashes and reboots
cp /tmp/opencode/hci_usb_dl/zephyr.uf2 /media/surfer/NICENANO/
sync; sleep 3; lsusb # expect "Zephyr USBD BT HCI"
hciconfig -a # or bluetoothctl listThe original ZMK backup is already saved at /tmp/opencode/zmk_lily58_backup.uf2.
# Re-enter bootloader (twice-fast reset / reset button), then:
cp /tmp/opencode/zmk_lily58_backup.uf2 /media/surfer/NICENANO/- Board identifiers are ZMK's Zephyr-4.1 variant syntax:
nice_nano@1//zmk= nice!nano v1 (default — matches your clone's bootloader era, 0.6.0)nice_nano//zmk= nice!nano v2 (ZMK's default revision is 2.0.0)- Both revisions share the same Adafruit nRF52 bootloader ("NICENANO" drive), so either image flashes on your board — v1 is just the faithful match.
- The nice_nano defconfig sets ZMK-only Kconfig symbols (
CONFIG_ZMK_USB,CONFIG_ZMK_BLE). When building the plain hci_usb sample these produce harmlessundefined symbolwarnings — the build still succeeds (non-fatal, per ZMK's own docs). - If the nice_nano board ever fails to build (shouldn't), fallback is upstream
nrf52840dk/nrf52840with a manual offset:west build -b nrf52840dk/nrf52840 -s zephyr/samples/bluetooth/hci_usb -- -DCONFIG_FLASH_LOAD_OFFSET=0x26000(then convert to UF2 withuf2conv.py -f 0xADA52840).