Add ZMK_BOARD_COMPAT symbol, that we can enable for our ZMK variants (#3265)

feat: Add ZMK_BOARD_COMPAT Kconfig symbol, and check for it

To properly detect users selecting a base board ID, when a ZMK variant
is available, add a ZMK_BOARD_COMPAT Kconfig symbol that the ZMK
variants will enable, allowing us to detect using the bare varand and
warn/error in CI so users don't end up with passing CI that results in
an unusable firmware due to missing ZMK enablement for keyboard name,
settings storage, etc.

refactor(boards): Add ZMK_BOARD_COMPAT to ZMK board variants

To clearly indicate the ZMK board variants are set up for ZMK usage,
select the ZMK_BOARD_COMPAT symbols for them.

fix(boards): Fix pillbug board.yml to report extension

Properly not the ZMK variant is part of an extension of the existing
pillbug board.
This commit is contained in:
Pete Johanson
2026-03-03 08:39:11 -07:00
committed by GitHub
parent 2a9ac3ba7f
commit a23aa009d7
39 changed files with 155 additions and 12 deletions

View File

@@ -147,6 +147,24 @@ jobs:
echo "See also the [list of released versions](https://github.com/zmkfirmware/zmk/releases)." >> $GITHUB_STEP_SUMMARY
echo "If you wish to stay on main, check the most recent pending release PR for breaking changes. [Our blog](https://zmk.dev/blog) may have upgrade information if breaking changes are significant." >> $GITHUB_STEP_SUMMARY
- name: Check if building a board without explicit ZMK compat
if: always()
working-directory: ${{ env.base_dir }}/zmk/app
run: |
if ! (grep "CONFIG_ZMK_BOARD_COMPAT=y" "${{ env.build_dir }}/zephyr/.config" > /dev/null)
then
original_board=$(echo "${{ matrix.board }}" | sed -e 's$/.*$$')
west boards --board-root module --board-root . --board "${original_board}" --format "{qualifiers}" | grep "zmk" > /dev/null
if [ $? -ne 0 ]
then
echo "::warning file=build/zephyr/.config,title=Missing ZMK Compat::The selected board does not report explicit ZMK compat. Please verify you've selected the correct board and ZMK variant if one exists"
else
echo "::error file=build/zephyr/.config,title=Missing ZMK Compat::The selected board is not set up for ZMK and there is a ZMK variant available. See https://zmk.dev/blog/2025/12/09/zephyr-4-1#zmk-board-variant."
exit 1
fi
fi
- name: ${{ env.display_name }} Kconfig file
run: |
if [ -f "${{ env.build_dir }}/zephyr/.config" ]

View File

@@ -5,6 +5,17 @@ mainmenu "ZMK Firmware"
menu "ZMK"
config ZMK_BOARD_COMPAT
bool
help
Hidden symbol used to hint that a board has been specifically
set up with various ZMK requirements in mind, e.g. settings
storage, bootloader integration, etc.
Failure to set this will warn users they may want to verify they
used a ZMK variant of an upstream board, or are using a board
properly migrated to a newer ZMK version.
menu "Basic Keyboard Setup"
config ZMK_KEYBOARD_NAME

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2026 The ZMK Contributors
# SPDX-License-Identifier: MIT
config BOARD_ADAFRUIT_KB2040
select ZMK_BOARD_COMPAT if BOARD_ADAFRUIT_KB2040_RP2040_ZMK
imply RETAINED_MEM if BOARD_ADAFRUIT_KB2040_RP2040_ZMK
imply RETENTION if BOARD_ADAFRUIT_KB2040_RP2040_ZMK
imply RETENTION_BOOT_MODE if BOARD_ADAFRUIT_KB2040_RP2040_ZMK

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2026 The ZMK Contributors
# SPDX-License-Identifier: MIT
config BOARD_ADAFRUIT_QT_PY_RP2040
select ZMK_BOARD_COMPAT if BOARD_ADAFRUIT_QT_PY_RP2040_RP2040_ZMK
imply RETAINED_MEM if BOARD_ADAFRUIT_QT_PY_RP2040_RP2040_ZMK
imply RETENTION if BOARD_ADAFRUIT_QT_PY_RP2040_RP2040_ZMK
imply RETENTION_BOOT_MODE if BOARD_ADAFRUIT_QT_PY_RP2040_RP2040_ZMK

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2026 Pete Johanson
# SPDX-License-Identifier: MIT
config BOARD_BOARDSOURCE_BLOK
select ZMK_BOARD_COMPAT if BOARD_BOARDSOURCE_BLOK_RP2040_ZMK
imply RETAINED_MEM if BOARD_BOARDSOURCE_BLOK_RP2040_ZMK
imply RETENTION if BOARD_BOARDSOURCE_BLOK_RP2040_ZMK
imply RETENTION_BOOT_MODE if BOARD_BOARDSOURCE_BLOK_RP2040_ZMK

View File

@@ -7,6 +7,7 @@ config BOARD_NRFMICRO
select SOC_NRF52840_QIAA if BOARD_NRFMICRO_NRF52840_ZMK
select SOC_NRF52840_QIAA if BOARD_NRFMICRO_NRF52840_FLIPPED_ZMK
select SOC_NRF52833_QIAA if BOARD_NRFMICRO_NRF52833_ZMK
select ZMK_BOARD_COMPAT if BOARD_NRFMICRO_NRF52840_ZMK || BOARD_NRFMICRO_NRF52840_FLIPPED_ZMK || BOARD_NRFMICRO_NRF52833_ZMK
imply RETAINED_MEM if BOARD_NRFMICRO_NRF52840_ZMK || BOARD_NRFMICRO_NRF52840_FLIPPED_ZMK || BOARD_NRFMICRO_NRF52833_ZMK
imply RETENTION if BOARD_NRFMICRO_NRF52840_ZMK || BOARD_NRFMICRO_NRF52840_FLIPPED_ZMK || BOARD_NRFMICRO_NRF52833_ZMK
imply RETENTION_BOOT_MODE if BOARD_NRFMICRO_NRF52840_ZMK || BOARD_NRFMICRO_NRF52840_FLIPPED_ZMK || BOARD_NRFMICRO_NRF52833_ZMK

View File

@@ -3,6 +3,7 @@
config BOARD_BLUEMICRO840
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT if BOARD_BLUEMICRO840_NRF52840_ZMK
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

@@ -3,6 +3,7 @@
config BOARD_TOFU65
select SOC_RP2040
select ZMK_BOARD_COMPAT
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE

View File

@@ -3,3 +3,4 @@
config BOARD_BDN9
select SOC_STM32F072XB
select ZMK_BOARD_COMPAT

View File

@@ -5,6 +5,7 @@
config BOARD_PUCHI_BLE
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT if BOARD_PUCHI_BLE_NRF52840_ZMK
imply RETAINED_MEM if BOARD_PUCHI_BLE_NRF52840_ZMK
imply RETENTION if BOARD_PUCHI_BLE_NRF52840_ZMK
imply RETENTION_BOOT_MODE if BOARD_PUCHI_BLE_NRF52840_ZMK

View File

@@ -5,6 +5,7 @@
config BOARD_ADV360PRO_LEFT
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE

View File

@@ -5,6 +5,7 @@
config BOARD_ADV360PRO_RIGHT
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE

View File

@@ -5,6 +5,7 @@
config BOARD_CORNEISH_ZEN_LEFT
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE

View File

@@ -5,6 +5,7 @@
config BOARD_CORNEISH_ZEN_RIGHT
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE

View File

@@ -3,6 +3,7 @@
config BOARD_NRF52840_M2
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT if BOARD_NRF52840_M2_NRF52840_ZMK
imply RETAINED_MEM if BOARD_NRF52840_M2_NRF52840_ZMK
imply RETENTION if BOARD_NRF52840_M2_NRF52840_ZMK
imply RETENTION_BOOT_MODE if BOARD_NRF52840_M2_NRF52840_ZMK

View File

@@ -3,6 +3,7 @@
config BOARD_PILLBUG
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT if BOARD_PILLBUG_NRF52840_ZMK
imply RETAINED_MEM if BOARD_PILLBUG_NRF52840_ZMK
imply RETENTION if BOARD_PILLBUG_NRF52840_ZMK
imply RETENTION_BOOT_MODE if BOARD_PILLBUG_NRF52840_ZMK

View File

@@ -1,5 +1,5 @@
board:
name: pillbug
extend: pillbug
variants:
- name: zmk
qualifier: nrf52840

View File

@@ -3,6 +3,7 @@
config BOARD_GLOVE80_LH
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE

View File

@@ -3,6 +3,7 @@
config BOARD_GLOVE80_RH
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE

View File

@@ -3,6 +3,7 @@
config BOARD_NICE60
select SOC_NRF52840_QIAA
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE
select ZMK_BOARD_COMPAT if BOARD_NICE60_NRF52840_ZMK
imply RETAINED_MEM if BOARD_NICE60_NRF52840_ZMK
imply RETENTION if BOARD_NICE60_NRF52840_ZMK
imply RETENTION_BOOT_MODE if BOARD_NICE60_NRF52840_ZMK

View File

@@ -3,6 +3,7 @@
config BOARD_NICE_NANO
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT if BOARD_NICE_NANO_NRF52840_ZMK
imply RETAINED_MEM if BOARD_NICE_NANO_NRF52840_ZMK
imply RETENTION if BOARD_NICE_NANO_NRF52840_ZMK
imply RETENTION_BOOT_MODE if BOARD_NICE_NANO_NRF52840_ZMK

View File

@@ -1,3 +1,4 @@
config BOARD_NRF52840DK
select SOC_NRF52840_QIAA if BOARD_NRF52840DK_NRF52840_ZMK
select ZMK_BOARD_COMPAT if BOARD_NRF52840DK_NRF52840_ZMK

View File

@@ -4,5 +4,5 @@
# SPDX-License-Identifier: MIT
config BOARD_PLANCK
bool "Planck Keyboard"
select SOC_STM32F303XC
select ZMK_BOARD_COMPAT

View File

@@ -5,3 +5,4 @@
config BOARD_PREONIC
select SOC_STM32F303XC
select ZMK_BOARD_COMPAT

View File

@@ -5,6 +5,7 @@
config BOARD_FERRIS
select SOC_STM32F072XB
select ZMK_BOARD_COMPAT
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE

View File

@@ -5,6 +5,7 @@
config BOARD_BT60
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE

View File

@@ -5,6 +5,7 @@
config BOARD_BT60_HS
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE

View File

@@ -5,6 +5,7 @@
config BOARD_BT65
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE

View File

@@ -5,6 +5,7 @@
config BOARD_BT75
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT
imply RETAINED_MEM
imply RETENTION
imply RETENTION_BOOT_MODE

View File

@@ -0,0 +1,6 @@
# Copyright (c) 2026 The ZMK Contributors
# SPDX-License-Identifier: Apache-2.0
config BOARD_PROTON_C
select ZMK_BOARD_COMPAT

View File

@@ -0,0 +1,10 @@
# Copyright (c) 2026 The ZMK Contributors
# SPDX-License-Identifier: MIT
config BOARD_RPI_PICO
select SOC_RP2040
select ZMK_BOARD_COMPAT if BOARD_RPI_PICO_RP2040_ZMK
imply RETAINED_MEM if BOARD_RPI_PICO_RP2040_ZMK
imply RETENTION if BOARD_RPI_PICO_RP2040_ZMK
imply RETENTION_BOOT_MODE if BOARD_RPI_PICO_RP2040_ZMK

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2026 Pete Johanson
# SPDX-License-Identifier: MIT
config BOARD_SEEEDUINO_XIAO
select ZMK_BOARD_COMPAT if BOARD_SEEEDUINO_XIAO_SAMD21G18A_ZMK
imply RETAINED_MEM if BOARD_SEEEDUINO_XIAO_SAMD21G18A_ZMK
imply RETENTION if BOARD_SEEEDUINO_XIAO_SAMD21G18A_ZMK
imply RETENTION_BOOT_MODE if BOARD_SEEEDUINO_XIAO_SAMD21G18A_ZMK

View File

@@ -0,0 +1,10 @@
# Copyright (c) 2026 Pete Johanson
# SPDX-License-Identifier: MIT
config BOARD_XIAO_BLE
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT if BOARD_XIAO_BLE_NRF52840_ZMK
imply RETAINED_MEM if BOARD_XIAO_BLE_NRF52840_ZMK
imply RETENTION if BOARD_XIAO_BLE_NRF52840_ZMK
imply RETENTION_BOOT_MODE if BOARD_XIAO_BLE_NRF52840_ZMK

View File

@@ -0,0 +1,10 @@
# Copyright (c) 2026 The ZMK Contributors
# SPDX-License-Identifier: MIT
config BOARD_SPARKFUN_PRO_MICRO_RP2040
select ZMK_BOARD_COMPAT if BOARD_SPARKFUN_PRO_MICRO_RP2040_RP2040_ZMK
imply RETAINED_MEM if BOARD_SPARKFUN_PRO_MICRO_RP2040_RP2040_ZMK
imply RETENTION if BOARD_SPARKFUN_PRO_MICRO_RP2040_RP2040_ZMK
imply RETENTION_BOOT_MODE if BOARD_SPARKFUN_PRO_MICRO_RP2040_RP2040_ZMK

View File

@@ -0,0 +1,6 @@
# Copyright (c) 2026 The ZMK Contributors
# SPDX-License-Identifier: MIT
config BOARD_BLACKPILL_F401CC
select ZMK_BOARD_COMPAT

View File

@@ -0,0 +1,6 @@
# Copyright (c) 2026 The ZMK Contributors
# SPDX-License-Identifier: MIT
config BOARD_BLACKPILL_F401CE
select ZMK_BOARD_COMPAT

View File

@@ -0,0 +1,6 @@
# Copyright (c) 2026 The ZMK Contributors
# SPDX-License-Identifier: MIT
config BOARD_BLACKPILL_F411CE
select ZMK_BOARD_COMPAT

View File

@@ -3,6 +3,7 @@
config BOARD_MIKOTO
select SOC_NRF52840_QIAA
select ZMK_BOARD_COMPAT if BOARD_MIKOTO_NRF52840_ZMK
imply RETAINED_MEM if BOARD_MIKOTO_NRF52840_ZMK
imply RETENTION if BOARD_MIKOTO_NRF52840_ZMK
imply RETENTION_BOOT_MODE if BOARD_MIKOTO_NRF52840_ZMK

View File

@@ -14,7 +14,8 @@ Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/
### General
| Config | Type | Description | Default |
| --------------------------- | ------ | -------------------------------------------- | ------- |
| --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `CONFIG_ZMK_BOARD_COMPAT` | bool | A special config for boards to enable. This helps check if users have accidentally used an upstream Zephyr board without ZMK additions applied | n |
| `CONFIG_ZMK_KEYBOARD_NAME` | string | The name of the keyboard (max 16 characters) | |
| `CONFIG_ZMK_WPM` | bool | Enable calculating words per minute | n |
| `CONFIG_HEAP_MEM_POOL_SIZE` | int | Size of the heap memory pool | 8192 |