From e5967be1363298e0605059665cf103e6227e60c9 Mon Sep 17 00:00:00 2001 From: nils Date: Tue, 18 Aug 2026 00:26:23 +0200 Subject: [PATCH] BLE module selection: choose nRF52840 (MDBT50Q, SWD pins 51/53); note u.FL vs chip-antenna SKU; reject AT-command and SPI-host modules --- BLE_MIDI_PROTOCOL.md | 57 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/BLE_MIDI_PROTOCOL.md b/BLE_MIDI_PROTOCOL.md index 55a3a6e..196315f 100644 --- a/BLE_MIDI_PROTOCOL.md +++ b/BLE_MIDI_PROTOCOL.md @@ -1,15 +1,62 @@ # BLE-MIDI add-on: EFM8 ↔ nRF52 custom framed protocol Plan for adding Bluetooth MIDI to the QuNexus by attaching a BLE-MIDI -module (bare **nRF52832**, chosen for lowest power / battery-later) to the -EFM8's dormant **UART1** — the same pair wired to the empty MIDI-expander -jack (**P1.2 / P1.3**, pins 44 / 43). UART1 is never enabled in stock v2.2.1 -firmware (no `XBR2` write, no `SBUF1`/`SCON1` use), so we reclaim it for BLE -without disturbing the DIN-MIDI UART0 or the P2/P3/P4 scan bus. +module to the EFM8's dormant **UART1** — the same pair wired to the empty +MIDI-expander jack (**P1.2 / P1.3**, pins 44 / 43). UART1 is never enabled +in stock v2.2.1 firmware (no `XBR2` write, no `SBUF1`/`SCON1` use), so we +reclaim it for BLE without disturbing the DIN-MIDI UART0 or the P2/P3/P4 +scan bus. See [[EFM8UB20_PINOUT.md]] for the pin map and the port-config block this modifies. +## Module selection + +**Chosen: Seeed/Raytac MDBT50Q — nRF52840, 1 MB flash / 256 kB RAM, BT 5.4, +~15.5 × 10.5 × 2.05 mm, certified.** SWD is broken out (**pin 51 = SWDIO, +pin 53 = SWDCLK**), it ships **blank**, so we SWD-flash our own BLE-MIDI + +framed-protocol firmware onto it. The nRF52840 has the most BLE-MIDI +reference code of any nRF52 (Nordic nRF5 SDK BLE-MIDI example, Adafruit +Bluefruit MIDI mode) — we lift the BLE-MIDI GATT layer and add our +framed-protocol UART handler on top. Battery-acceptable (system-off ~1.5 µA, +BLE-connected a few mA avg). Wiring uses only 6 of its 61 pads: VDD, GND, +UART TX, UART RX, SWDIO, SWDCLK. + +> **Antenna variant — watch the SKU.** The Seeed **MDBT50Q-U1M** is the +> **u.FL** variant: **no onboard antenna**, just a u.FL jack → needs an +> **external 2.4 GHz antenna on a u.FL pigtail** routed to a board edge +> inside the case (keep-out ~3–5 mm at the antenna end). If you'd rather +> avoid the external antenna, get the **chip-antenna variant Raytac +> MDBT50Q-1MEN** (same module, onboard chip antenna, no u.FL). Same SWD +> pins, same firmware. Prefer the chip-antenna SKU unless the u.FL + +> external antenna is deliberately wanted for edge placement. + +**Smaller fallback (if case space is tight): Raytac MDBT42Q-512KV2 — +nRF52832, 512 kB / 64 kB, ~6.5 × 7.1 × 1.6 mm, onboard chip antenna.** Same +SWD-exposed/blank profile, lowest power, smallest fit, and it *does* have +the integrated antenna — but less headroom and less ready-made BLE-MIDI +code than the 52840. + +### Hard selection rules (do not re-evaluate against these) + +- **Must expose SWD and be blank/reflashable.** We load our own BLE-MIDI + firmware; a sealed module is unusable. +- **Reject AT-command / "transparent serial" modules** (e.g. Raytac + MDBT42T-AT / WRL-25466, nRF52805). They advertise the **Nordic UART + Service** (`6E400001-…`), not **BLE-MIDI** (`03B80E5A-…`). iOS/macOS/DAWs + scan for the MIDI UUID and will not present an NUS device as a MIDI + source. Their AT command set cannot change the advertised service. The + MDBT42T-AT also exposes **no SWD** (19 pads, none SWDIO/SWCLK), so it + can't be reflashed either — doubly unsuitable. +- **Reject SPI-only radio modules that need a host to run the BLE stack** + (e.g. Raspberry Pi Radio Module 2 / RMC20452T, Infineon CYW43439). The + BLE stack (BTstack) runs on an RP2040 host over a bespoke gSPI; the + module cannot talk to the EFM8 directly (no SPI on the EFM8, and it + can't run BTstack). That makes a 3-chip build (EFM8 + RP2040 + radio), + and the Wi-Fi combo chip is power-hungry — wrong for battery-later. + (A Pico W is the cheap bench-prototype instantiation of that + architecture, but it is not the final-build path.) + ## Transport: frame everything (SLIP-style) MIDI bytes and control commands share one UART, so **both** are carried in