refactor(boards): Move to ZMK specific variant for the bluemicro840 board

For consistency, adjust the bluemicro840 board definition to offer a
"vanilla" Zephyr board, and then ZMK variant, e.g. `bluemicro840//zmk`.
This commit is contained in:
Peter Johanson 2026-01-06 23:21:57 -07:00
parent abe09d32e0
commit b1c89847e2
17 changed files with 90 additions and 26 deletions

View File

@ -1,8 +1,8 @@
# Copyright (c) 2020 Pete Johanson, Derek Schmell
# Copyright (c) 2026 Pete Johanson, Derek Schmell
# SPDX-License-Identifier: Apache-2.0
config BOARD_BLUEMICRO840
select SOC_NRF52840_QIAA
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE
imply RETAINED_MEM if BOARD_BLUEMICRO840_NRF52840_ZMK
imply RETENTION if BOARD_BLUEMICRO840_NRF52840_ZMK
imply RETENTION_BOOT_MODE if BOARD_BLUEMICRO840_NRF52840_ZMK

View File

@ -1,5 +1,5 @@
file_format: "1"
id: bluemicro840
id: bluemicro840//zmk
name: BlueMicro840 v1
type: board
arch: arm

View File

@ -0,0 +1,29 @@
/*
* Copyright (c) 2026 Pete Johanson, Derek Schmell
*
* SPDX-License-Identifier: MIT
*/
#include <../boards/jpconstantineau/bluemicro840/bluemicro840.dts>
#include <common/nordic/nrf52840_uf2_boot_mode.dtsi>
/ {
chosen {
zmk,battery = &vbatt;
};
// Node name must match original "EXT_POWER" label to preserve user settings.
EXT_POWER {
compatible = "zmk,ext-power-generic";
init-delay-ms = <20>;
control-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
};
vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
io-channels = <&adc 7>;
output-ohms = <2000000>;
full-ohms = <(2000000 + 806000)>;
};
};

View File

@ -1,5 +1,5 @@
board:
name: bluemicro840
vendor: jpconstantineau
socs:
- name: nrf52840
extend: bluemicro840
variants:
- name: zmk
qualifier: nrf52840

View File

@ -0,0 +1,5 @@
# Copyright (c) 2026 Pete Johanson, Derek Schmell
# SPDX-License-Identifier: Apache-2.0
config BOARD_BLUEMICRO840
select SOC_NRF52840_QIAA

View File

@ -6,7 +6,6 @@
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include <common/nordic/nrf52840_uf2_boot_mode.dtsi>
#include "arduino_pro_micro_pins.dtsi"
#include "bluemicro840-pinctrl.dtsi"
@ -19,7 +18,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zmk,battery = &vbatt;
};
leds {
@ -28,21 +26,6 @@
gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
};
};
// Node name must match original "EXT_POWER" label to preserve user settings.
EXT_POWER {
compatible = "zmk,ext-power-generic";
init-delay-ms = <20>;
control-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
};
vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
io-channels = <&adc 7>;
output-ohms = <2000000>;
full-ohms = <(2000000 + 806000)>;
};
};
&adc {

View File

@ -0,0 +1,15 @@
identifier: bluemicro840
name: BlueMicro840_V1
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- adc
- usb_device
- ble
- ieee802154
- pwm
- watchdog

View File

@ -0,0 +1,13 @@
# SPDX-License-Identifier: MIT
# Enable MPU
CONFIG_ARM_MPU=y
CONFIG_PINCTRL=y
# enable GPIO
CONFIG_GPIO=y
CONFIG_USE_DT_CODE_PARTITION=y
CONFIG_BUILD_OUTPUT_UF2=y

View File

@ -0,0 +1,5 @@
# SPDX-License-Identifier: MIT
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)

View File

@ -0,0 +1,5 @@
board:
name: bluemicro840
vendor: jpconstantineau
socs:
- name: nrf52840

View File

@ -0,0 +1,9 @@
#
# Copyright (c) 2026 The ZMK Contributors
# SPDX-License-Identifier: MIT
#
# Suppresses duplicate unit-address warning at build time for power, clock, acl and flash-controller
# https://docs.zephyrproject.org/latest/build/dts/intro-input-output.html
list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")