From 38a778eafe035347bc73fd36a0b365ad4fb715ea Mon Sep 17 00:00:00 2001 From: zackees Date: Sat, 30 May 2026 03:23:25 -0700 Subject: [PATCH] fix(board-db): add Seeed XIAO BLE / BLE Sense (nRF52840) board defs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `fbuild`'s bundled board DB (`crates/fbuild-config/assets/boards/json/`, loaded at compile time via `include_dir!`) was missing both Seeed XIAO BLE variants. Every downstream consumer of `xiaoble_adafruit` or `xiaoblesense_adafruit` (notably FastLED's `nrf52_xiaoblesense` and `adafruit_xiaoblesense` workflows) hit: build error: config error: unknown board 'xiaoble_adafruit' (no built-in defaults) build error: config error: unknown board 'xiaoblesense_adafruit' (no built-in defaults) before any code was compiled. fbuild does not consult `~/.platformio/platforms/` at runtime, so the maxgerhardt platform's board JSONs are invisible — they must be baked into the bundle. Add both JSONs to the bundle, mirroring the values from maxgerhardt/platform-nordicnrf52/boards/{xiaoble_adafruit, xiaoblesense_adafruit}.json (develop branch): - mcu = NRF52840, fcpu = 64 MHz - core = nRF5, variant = Seeed_XIAO_nRF52840[_Sense] - ldscript = nrf52840_s140_v7.ld - ram = 237568, rom = 811008 (from upstream upload.maximum_ram_size / maximum_size) - platform = nordicnrf52 Add regression tests `test_xiaoble_adafruit_board_config` and `test_xiaoblesense_adafruit_board_config`. All 55 board tests pass. Fixes #293 --- .../assets/boards/json/xiaoble_adafruit.json | 31 +++++++++++++++++++ .../boards/json/xiaoblesense_adafruit.json | 31 +++++++++++++++++++ crates/fbuild-config/src/board/tests.rs | 21 +++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 crates/fbuild-config/assets/boards/json/xiaoble_adafruit.json create mode 100644 crates/fbuild-config/assets/boards/json/xiaoblesense_adafruit.json diff --git a/crates/fbuild-config/assets/boards/json/xiaoble_adafruit.json b/crates/fbuild-config/assets/boards/json/xiaoble_adafruit.json new file mode 100644 index 00000000..88bd7d1e --- /dev/null +++ b/crates/fbuild-config/assets/boards/json/xiaoble_adafruit.json @@ -0,0 +1,31 @@ +{ + "build": { + "core": "nRF5", + "variant": "Seeed_XIAO_nRF52840", + "arduino": { + "ldscript": "nrf52840_s140_v7.ld" + } + }, + "connectivity": [ + "bluetooth" + ], + "debug": { + "tools": { + "blackmagic": {}, + "jlink": {}, + "cmsis-dap": {} + } + }, + "fcpu": 64000000, + "frameworks": [ + "arduino" + ], + "id": "xiaoble_adafruit", + "mcu": "NRF52840", + "name": "Seeed XIAO BLE nRF52840", + "platform": "nordicnrf52", + "ram": 237568, + "rom": 811008, + "url": "https://wiki.seeedstudio.com/XIAO_BLE", + "vendor": "Seeed" +} diff --git a/crates/fbuild-config/assets/boards/json/xiaoblesense_adafruit.json b/crates/fbuild-config/assets/boards/json/xiaoblesense_adafruit.json new file mode 100644 index 00000000..4f0962b8 --- /dev/null +++ b/crates/fbuild-config/assets/boards/json/xiaoblesense_adafruit.json @@ -0,0 +1,31 @@ +{ + "build": { + "core": "nRF5", + "variant": "Seeed_XIAO_nRF52840_Sense", + "arduino": { + "ldscript": "nrf52840_s140_v7.ld" + } + }, + "connectivity": [ + "bluetooth" + ], + "debug": { + "tools": { + "blackmagic": {}, + "jlink": {}, + "cmsis-dap": {} + } + }, + "fcpu": 64000000, + "frameworks": [ + "arduino" + ], + "id": "xiaoblesense_adafruit", + "mcu": "NRF52840", + "name": "Seeed XIAO BLE Sense", + "platform": "nordicnrf52", + "ram": 237568, + "rom": 811008, + "url": "https://wiki.seeedstudio.com/XIAO_BLE", + "vendor": "Seeed" +} diff --git a/crates/fbuild-config/src/board/tests.rs b/crates/fbuild-config/src/board/tests.rs index 77790405..8d2edbd7 100644 --- a/crates/fbuild-config/src/board/tests.rs +++ b/crates/fbuild-config/src/board/tests.rs @@ -494,6 +494,27 @@ fn test_nano_every_board_config() { assert_eq!(config.platform(), Some(fbuild_core::Platform::AtmelMegaAvr)); } +#[test] +fn test_xiaoble_adafruit_board_config() { + // Seeed XIAO BLE (nRF52840, no IMU); maxgerhardt platform-nordicnrf52. + // Regression for FastLED `nrf52_xiaoblesense` workflow (#293). + let config = BoardConfig::from_board_id("xiaoble_adafruit", &HashMap::new()).unwrap(); + assert_eq!(config.mcu, "nrf52840"); + assert_eq!(config.core, "nRF5"); + assert_eq!(config.variant, "Seeed_XIAO_nRF52840"); +} + +#[test] +fn test_xiaoblesense_adafruit_board_config() { + // Seeed XIAO BLE Sense (nRF52840 + IMU/mic). + // Regression for FastLED `adafruit_xiaoblesense` workflow (#293). + let config = + BoardConfig::from_board_id("xiaoblesense_adafruit", &HashMap::new()).unwrap(); + assert_eq!(config.mcu, "nrf52840"); + assert_eq!(config.core, "nRF5"); + assert_eq!(config.variant, "Seeed_XIAO_nRF52840_Sense"); +} + /// Validate that ALL megatinycore boards have the required framework-injected /// defines in extra_flags. PlatformIO's builder script injects these at build /// time, but fbuild must carry them in the board JSON since we don't run