[PR #221] [CLOSED] Add Seeed XIAO nRF52840 board target #245

Closed
opened 2026-10-22 05:08:12 +00:00 by roman · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/safijari/openpuck/pull/221
Author: @TheFilipcom4607
Created: 8/7/2026
Status: ❌ Closed

Base: main ← Head: xiao-nrf52840


📝 Commits (1)

  • ed8626d Add Seeed XIAO nRF52840 board target

📊 Changes

6 files changed (+142 additions, -8 deletions)

View changed files

📝 Makefile (+23 -2)
📝 OpenPuck/board_config.h (+10 -0)
📝 OpenPuck/fw_update.cpp (+8 -5)
📝 OpenPuck/status_led.h (+10 -0)
📝 docs/BUILD_AND_DEPLOY.md (+86 -0)
📝 gen_uf2.sh (+5 -1)

📄 Description

Adds a build-xiao / deploy-xiao target so OpenPuck runs on the Seeed XIAO nRF52840 (Sense variant tested), using Seeed's non-mbed "Seeed nRF52 Boards" core.

Board deltas vs the Feather/SuperMini build

Seeed's core ships S140 7.3.0, so the app region starts at 0x27000 instead of 0x26000. fw_update.cpp hardcoded the Feather base, which would misplace the staged image; it now derives from a new OPK_APP_BASE in board_config.h. LittleFS (0xED000), bootloader (0xF4000) and its settings page (0xFF000) are unchanged.
status_led.h drives pin 24 for the SuperMini's blue LED, but D24 in the XIAO pin map is P0.21 = QSPI_SCK — driving it fights the on-board QSPI flash. Overridden to LED_BUILTIN on both pins.
The XIAO's RGB LEDs are active-low (variant.cpp parks them HIGH) despite variant.h declaring LED_STATE_ON 1, so WAKE_LED_ON is LOW.

Prerequisite worth knowing about: Seeed's core bundles Adafruit TinyUSB 1.7.0, which hardcodes #define CFG_TUD_HID 1 with no #ifndef guard (silently overriding the build flag) and predates setConfigurationAttribute(), allocEndpoint() and setSerialDescriptor(). A user-library install of 3.7.0–3.7.4 fixes it. Not 3.7.5+ — that added an is_isr parameter to usbd_edpt_xfer() which doesn't compile against mode_xinput.cpp. Worth noting this will break the standard build too whenever Adafruit bumps their core past 3.7.4.

Staged WebUSB updates don't work on this board yet. docs/index.html hardcodes const APP_BASE=0x26000 and rejects any UF2 whose base differs, so a XIAO-built image (0x27000) is refused, while an official release image passes that check but can't run — applying one leaves the board app-less (recoverable via double-tap RST + serial DFU; bootloader untouched). fwupBegin carries no target address, and vectorsPlausible() passes because a Feather image's reset vector still lands inside the XIAO's app region. Documented as unsupported for now; a proper fix means the puck reporting its app base in the status blob and the panel using that instead of a constant. Happy to do that as a follow-up if you want it that way.

gen_uf2.sh also now searches the Seeeduino package dir for uf2conv.py, not just Adafruit's.

Tested on hardware (XIAO nRF52840 Sense, Windows):

Enumerates as Steam Controller Puck ✅
Controller pairs and connects wirelessly ✅
Bond survives reboot, no re-pairing ✅
WebUSB panel connects ✅
Xbox mode (back-4 + X) → host sees Xbox 360 Controller ✅
Switch mode (back-4 + Y) → host sees Switch Pro Controller ✅
Back to Steam mode (back-4 + A) ✅
Staged WebUSB update ❌ (see above)

This was done using Claude Opus 5, I have tested it on my own steam controller and xiao nrf52 and it works.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/safijari/openpuck/pull/221 **Author:** [@TheFilipcom4607](https://github.com/TheFilipcom4607) **Created:** 8/7/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `xiao-nrf52840` --- ### 📝 Commits (1) - [`ed8626d`](https://github.com/safijari/openpuck/commit/ed8626d35ec435ab6a8d331933dc123c27c1e5bd) Add Seeed XIAO nRF52840 board target ### 📊 Changes **6 files changed** (+142 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `Makefile` (+23 -2) 📝 `OpenPuck/board_config.h` (+10 -0) 📝 `OpenPuck/fw_update.cpp` (+8 -5) 📝 `OpenPuck/status_led.h` (+10 -0) 📝 `docs/BUILD_AND_DEPLOY.md` (+86 -0) 📝 `gen_uf2.sh` (+5 -1) </details> ### 📄 Description Adds a build-xiao / deploy-xiao target so OpenPuck runs on the Seeed XIAO nRF52840 (Sense variant tested), using Seeed's non-mbed "Seeed nRF52 Boards" core. Board deltas vs the Feather/SuperMini build Seeed's core ships S140 7.3.0, so the app region starts at 0x27000 instead of 0x26000. fw_update.cpp hardcoded the Feather base, which would misplace the staged image; it now derives from a new OPK_APP_BASE in board_config.h. LittleFS (0xED000), bootloader (0xF4000) and its settings page (0xFF000) are unchanged. status_led.h drives pin 24 for the SuperMini's blue LED, but D24 in the XIAO pin map is P0.21 = QSPI_SCK — driving it fights the on-board QSPI flash. Overridden to LED_BUILTIN on both pins. The XIAO's RGB LEDs are active-low (variant.cpp parks them HIGH) despite variant.h declaring LED_STATE_ON 1, so WAKE_LED_ON is LOW. Prerequisite worth knowing about: Seeed's core bundles Adafruit TinyUSB 1.7.0, which hardcodes #define CFG_TUD_HID 1 with no #ifndef guard (silently overriding the build flag) and predates setConfigurationAttribute(), allocEndpoint() and setSerialDescriptor(). A user-library install of 3.7.0–3.7.4 fixes it. Not 3.7.5+ — that added an is_isr parameter to usbd_edpt_xfer() which doesn't compile against mode_xinput.cpp. Worth noting this will break the standard build too whenever Adafruit bumps their core past 3.7.4. Staged WebUSB updates don't work on this board yet. docs/index.html hardcodes const APP_BASE=0x26000 and rejects any UF2 whose base differs, so a XIAO-built image (0x27000) is refused, while an official release image passes that check but can't run — applying one leaves the board app-less (recoverable via double-tap RST + serial DFU; bootloader untouched). fwupBegin carries no target address, and vectorsPlausible() passes because a Feather image's reset vector still lands inside the XIAO's app region. Documented as unsupported for now; a proper fix means the puck reporting its app base in the status blob and the panel using that instead of a constant. Happy to do that as a follow-up if you want it that way. gen_uf2.sh also now searches the Seeeduino package dir for uf2conv.py, not just Adafruit's. Tested on hardware (XIAO nRF52840 Sense, Windows): Enumerates as Steam Controller Puck ✅ Controller pairs and connects wirelessly ✅ Bond survives reboot, no re-pairing ✅ WebUSB panel connects ✅ Xbox mode (back-4 + X) → host sees Xbox 360 Controller ✅ Switch mode (back-4 + Y) → host sees Switch Pro Controller ✅ Back to Steam mode (back-4 + A) ✅ Staged WebUSB update ❌ (see above) This was done using Claude Opus 5, I have tested it on my own steam controller and xiao nrf52 and it works. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
roman 2026-10-22 05:08:12 +00:00
Sign in to join this conversation.
No labels
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
safijari/openpuck#245
No description provided.