Skip to content
us01srv-surfPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

hci_usb build for nice_nano (GitHub Actions cloud build)

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/.

What you get

  • zephyr.uf2 — linked at 0x26000 for the Adafruit nRF52 bootloader (the code partition ZMK defines in nrf52840_uf2_boot_mode.dtsi).
  • After flashing, the board enumerates as 2FE3:000B "Zephyr USBD BT HCI".

Steps (all from this terminal)

# 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.uf2

No 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.

Flash

# 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 list

Restore the keyboard firmware (any time)

The 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/

Notes

  • 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 harmless undefined symbol warnings — 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/nrf52840 with a manual offset: west build -b nrf52840dk/nrf52840 -s zephyr/samples/bluetooth/hci_usb -- -DCONFIG_FLASH_LOAD_OFFSET=0x26000 (then convert to UF2 with uf2conv.py -f 0xADA52840).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors