From 5fd46f45987124b91fd3ce236bf524c1d28eb8b6 Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Wed, 9 Jul 2025 00:58:31 -0600 Subject: [PATCH] fix(boards): Retore bootloader support on XIAO BLE. Set up necessary boot mode/retention to properly set GPREGRET to trigger Adafruit bootloader to run on the XIAO BLE. --- app/boards/xiao_ble.conf | 7 ++++++- app/boards/xiao_ble.overlay | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/app/boards/xiao_ble.conf b/app/boards/xiao_ble.conf index 205f67e91..49eaacf65 100644 --- a/app/boards/xiao_ble.conf +++ b/app/boards/xiao_ble.conf @@ -12,4 +12,9 @@ CONFIG_NVS=y CONFIG_SETTINGS_NVS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y -CONFIG_FLASH_MAP=y \ No newline at end of file +CONFIG_FLASH_MAP=y + +CONFIG_RETAINED_MEM=y +CONFIG_RETENTION=y +CONFIG_RETENTION_BOOT_MODE=y +CONFIG_ZMK_BOOTMODE_MAGIC_VALUE_BOOTLOADER_TYPE_ADAFRUIT_NRF52=y diff --git a/app/boards/xiao_ble.overlay b/app/boards/xiao_ble.overlay index 3b7710ef6..328b2717c 100644 --- a/app/boards/xiao_ble.overlay +++ b/app/boards/xiao_ble.overlay @@ -4,10 +4,33 @@ * SPDX-License-Identifier: MIT */ +&gpregret1 { + adafruit_boot_retention: retention@0 { + compatible = "zephyr,retention"; + status = "okay"; + reg = <0x0 0x1>; + }; +}; / { chosen { zmk,battery = &vbatt; + zephyr,boot-mode = &boot_retention; + zmk,magic-boot-mode = &adafruit_boot_retention; + }; + + magic_mapper { + compatible = "zmk,bootmode-to-magic-mapper"; + status = "okay"; + + #address-cells = <1>; + #size-cells = <1>; + + boot_retention: retention@0 { + compatible = "zephyr,retention"; + status = "okay"; + reg = <0x0 0x1>; + }; }; vbatt: vbatt {