forked from kofal.net/zmk
refactor(core): Adjust our approach for upstream Zephyr boards (#3145)
refactor(core): Adjust our approach for upstream Zephyr boards Move to using proper HWMv2 board extensions https://docs.zephyrproject.org/4.1.0/hardware/porting/board_porting.html#board-extensions for extending upstream Zephyr boards for use with ZMK. With this change, using upstream Zephyr board IDs directly, e.g. `seeeduino_xiao` will be stock versions as found upstream. To use a board variant that is tuned for ZMK use, use the `zmk` variant, e.g. `seeeduino_xiao//zmk` which is shorthand for `seeeduino_xiao/samd21g18a/zmk`. refactor(boards): Move to ZMK specific variants for the nRFMicro board For consistency, adjust the nRFMicro board definition to offer a "vanilla" Zephyr board, and then ZMK variants, e.g. `nrfmicro/nrf52840/zmk`. 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`. refactor(boards): Make tofu65 to ZMK variant by default Make the standard Tofu65 board ID be `tofu65/rp2040/zmk` or `tofu65//zmk` by shorthand. refactor(boards): Move BDN9 to ZMK variant by default Make the standard BDN9 board ID be `bdn9/stm32f072xb/zmk` or `bdn9//zmk` by shorthand. refactor(boards): Move Puchi BLE to ZMK variant by default Make the standard Puchi BLE board ID be `puchi_ble/nrf52840/zmk` or `puchi_ble//zmk` by shorthand. refactor(boards): Move Adv360 Pro to ZMK variant by default Make the standard Adv360 Pro board ID be `adv360pro_left/nrf52840/zmk` or `adv360pro_left//zmk` by shorthand and for right as well. refactor(boards): Move nRF52840 M2 to ZMK variant by default Make the standard nRF52840 M2 board ID be `nrf52840_m2/nrf52840/zmk` or `nrf52840_m2//zmk` by shorthand. refactor(boards): Move Pillbug to ZMK variant by default Make the standard Pillbug board ID be `pillbug/nrf52840/zmk` or `pillbug//zmk` by shorthand. refactor(boards): Move s40nc to ZMK variant by default Make the standard s40nc board ID be `s40nc/nrf52840/zmk` or `s40nc//zmk` by shorthand. refactor(boards): Move nice!60 to ZMK variant by default Make the standard nice!60 board ID be `nice60/nrf52840/zmk` or `nice60//zmk` by shorthand. refactor(boards): Move planck to ZMK variant by default Make the standard planck board ID be `planck/stm32f303xc/zmk` or `planck//zmk` by shorthand. refactor(boards): Move preonic to ZMK variant by default Make the standard preonic board ID be `preonic/stm32f303xc/zmk` or `preonic//zmk` by shorthand. refactor(boards): Move ferris to ZMK variant by default Make the standard ferris board ID be `ferris/stm32f072xb/zmk` or `ferris//zmk` by shorthand. refactor(boards): Move Proton-C to ZMK variant by default Make the standard Proton-C board ID be `proton_c/stm32f303xc/zmk` or `proton_c//zmk` by shorthand. refactor(boards): Move Corneish Zen to ZMK variant by default Make the standard Corneish Zen board ID be `corneish_zen_left/nrf52840/zmk` or `corneish_zen_left//zmk` by shorthand and for right as well. refactor(boards): Move nice!nano to ZMK variant by default Make the standard nice!nano board ID be `nice_nano/nrf52840/zmk` or `nice_nano//zmk` by shorthand. refactor(boards): Move mikoto to ZMK variant by default Make the standard mikoto board ID be `mikoto/nrf52840/zmk` or `mikoto//zmk` by shorthand. refactor(boards): Move Polarity Works boards to ZMK variants Make the standard Polarity Works board IDs be `zmk` variants. doc: Update docs/blog post to reference ZMK variants * Update Zephyr 4.1 blog post to mention ZMK variants * Add note to hardware support page about variants docs: Fix up shield board overlays for new board IDs Adjust our documentation to properly use the correct qualified board overlay file names that match our new board conventions.
This commit is contained in:
7
app/module/boards/mechwild/pillbug/Kconfig
Normal file
7
app/module/boards/mechwild/pillbug/Kconfig
Normal file
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
config BOARD_ENABLE_DCDC
|
||||
bool "Enable DCDC mode"
|
||||
select SOC_DCDC_NRF52X
|
||||
default y
|
||||
depends on (BOARD_PILLBUG)
|
||||
16
app/module/boards/mechwild/pillbug/Kconfig.defconfig
Normal file
16
app/module/boards/mechwild/pillbug/Kconfig.defconfig
Normal file
@@ -0,0 +1,16 @@
|
||||
# Copyright (c) 2022 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if BOARD_PILLBUG
|
||||
|
||||
if USB_DEVICE_STACK
|
||||
|
||||
config USB_NRFX
|
||||
default y
|
||||
|
||||
endif # USB_DEVICE_STACK
|
||||
|
||||
config BT_CTLR
|
||||
default BT
|
||||
|
||||
endif # BOARD_PILLBUG
|
||||
8
app/module/boards/mechwild/pillbug/Kconfig.pillbug
Normal file
8
app/module/boards/mechwild/pillbug/Kconfig.pillbug
Normal file
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2026 The ZMK Contributors
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config BOARD_PILLBUG
|
||||
select SOC_NRF52840_QIAA
|
||||
imply RETAINED_MEM
|
||||
imply RETENTION
|
||||
imply RETENTION_BOOT_MODE
|
||||
50
app/module/boards/mechwild/pillbug/blackpill_pins.dtsi
Normal file
50
app/module/boards/mechwild/pillbug/blackpill_pins.dtsi
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Kyle McCreery
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/ {
|
||||
blackpill: connector {
|
||||
compatible = "blackpill";
|
||||
#gpio-cells = <2>;
|
||||
gpio-map-mask = <0xffffffff 0xffffffc0>;
|
||||
gpio-map-pass-thru = <0 0x3f>;
|
||||
gpio-map
|
||||
= <2 0 &gpio0 9 0> /* PC13 */
|
||||
, <3 0 &gpio0 10 0> /* PC14 */
|
||||
, <4 0 &gpio1 6 0> /* PC15 */
|
||||
, <10 0 &gpio0 25 0> /* PA0 */
|
||||
, <11 0 &gpio0 5 0> /* PA1 */
|
||||
, <12 0 &gpio1 15 0> /* PA2 */
|
||||
, <13 0 &gpio0 2 0> /* PA3 */
|
||||
, <14 0 &gpio1 11 0> /* PA4 */
|
||||
, <15 0 &gpio1 8 0> /* PA5 */
|
||||
, <16 0 &gpio0 26 0> /* PA6 */
|
||||
, <17 0 &gpio0 11 0> /* PA7 */
|
||||
, <18 0 &gpio1 9 0> /* PB0 */
|
||||
, <19 0 &gpio1 14 0> /* PB1 */
|
||||
, <20 0 &gpio0 3 0> /* PB2 */
|
||||
, <21 0 &gpio0 31 0> /* PB10 */
|
||||
, <25 0 &gpio0 12 0> /* PB12 */
|
||||
, <26 0 &gpio0 19 0> /* PB13 */
|
||||
, <27 0 &gpio1 1 0> /* PB14 */
|
||||
, <28 0 &gpio0 29 0> /* PB15 */
|
||||
, <29 0 &gpio1 13 0> /* PA8 */
|
||||
, <30 0 &gpio0 6 0> /* PA9 */
|
||||
, <31 0 &gpio0 8 0> /* PA10 */
|
||||
, <38 0 &gpio1 0 0> /* PA15 */
|
||||
, <39 0 &gpio1 10 0> /* PB3 */
|
||||
, <40 0 &gpio1 2 0> /* PB4 */
|
||||
, <41 0 &gpio1 4 0> /* PB5 */
|
||||
, <42 0 &gpio0 13 0> /* PB6 */
|
||||
, <43 0 &gpio0 15 0> /* PB7 */
|
||||
, <45 0 &gpio0 17 0> /* PB8 */
|
||||
, <46 0 &gpio0 24 0> /* PB9 */
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
blackpill_i2c: &i2c0 {};
|
||||
blackpill_spi: &spi1 {};
|
||||
blackpill_serial: &uart0 {};
|
||||
7
app/module/boards/mechwild/pillbug/board.cmake
Normal file
7
app/module/boards/mechwild/pillbug/board.cmake
Normal file
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
set(OPENOCD_NRF5_SUBFAMILY nrf52)
|
||||
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
|
||||
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake)
|
||||
5
app/module/boards/mechwild/pillbug/board.yml
Normal file
5
app/module/boards/mechwild/pillbug/board.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
board:
|
||||
name: pillbug
|
||||
vendor: mechwild
|
||||
socs:
|
||||
- name: nrf52840
|
||||
56
app/module/boards/mechwild/pillbug/pillbug-pinctrl.dtsi
Normal file
56
app/module/boards/mechwild/pillbug/pillbug-pinctrl.dtsi
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (c) 2026 The ZMK Contributors
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
&pinctrl {
|
||||
uart0_default: uart0_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(UART_RX, 0, 8)>;
|
||||
bias-pull-up;
|
||||
};
|
||||
group2 {
|
||||
psels = <NRF_PSEL(UART_TX, 0, 6)>;
|
||||
};
|
||||
};
|
||||
|
||||
uart0_sleep: uart0_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(UART_RX, 0, 8)>,
|
||||
<NRF_PSEL(UART_TX, 0, 6)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
i2c0_default: i2c0_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(TWIM_SDA, 0, 15)>,
|
||||
<NRF_PSEL(TWIM_SCL, 0, 13)>;
|
||||
};
|
||||
};
|
||||
|
||||
i2c0_sleep: i2c0_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(TWIM_SDA, 0, 15)>,
|
||||
<NRF_PSEL(TWIM_SCL, 0, 13)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
|
||||
spi1_default: spi1_default {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 0, 40)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 0, 11)>,
|
||||
<NRF_PSEL(SPIM_MISO, 1, 26)>;
|
||||
};
|
||||
};
|
||||
|
||||
spi1_sleep: spi1_sleep {
|
||||
group1 {
|
||||
psels = <NRF_PSEL(SPIM_SCK, 0, 40)>,
|
||||
<NRF_PSEL(SPIM_MOSI, 0, 11)>,
|
||||
<NRF_PSEL(SPIM_MISO, 1, 26)>;
|
||||
low-power-enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
110
app/module/boards/mechwild/pillbug/pillbug.dts
Normal file
110
app/module/boards/mechwild/pillbug/pillbug.dts
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include <nordic/nrf52840_qiaa.dtsi>
|
||||
|
||||
#include "pillbug-pinctrl.dtsi"
|
||||
#include "blackpill_pins.dtsi"
|
||||
|
||||
/ {
|
||||
model = "PillBug";
|
||||
compatible = "pillbug";
|
||||
|
||||
chosen {
|
||||
zephyr,code-partition = &code_partition;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
blue_led: led_0 {
|
||||
gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&adc {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpiote {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
compatible = "nordic,nrf-twi";
|
||||
pinctrl-0 = <&i2c0_default>;
|
||||
pinctrl-1 = <&i2c0_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
};
|
||||
|
||||
&spi1 {
|
||||
status = "disabled";
|
||||
compatible = "nordic,nrf-spim";
|
||||
pinctrl-0 = <&spi1_default>;
|
||||
pinctrl-1 = <&spi1_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
compatible = "nordic,nrf-uarte";
|
||||
current-speed = <115200>;
|
||||
pinctrl-0 = <&uart0_default>;
|
||||
pinctrl-1 = <&uart0_sleep>;
|
||||
pinctrl-names = "default", "sleep";
|
||||
};
|
||||
|
||||
zephyr_udc0: &usbd {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&flash0 {
|
||||
/*
|
||||
* For more information, see:
|
||||
* http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html
|
||||
*/
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
sd_partition: partition@0 {
|
||||
reg = <0x00000000 0x00001000>;
|
||||
};
|
||||
|
||||
code_partition: partition@1000 {
|
||||
reg = <0x00001000 0x000d3000>;
|
||||
};
|
||||
|
||||
/*
|
||||
* The flash starting at 0x000d4000 and ending at
|
||||
* 0x000f3fff is reserved for use by the application.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Storage partition will be used by FCB/LittleFS/NVS
|
||||
* if enabled.
|
||||
*/
|
||||
storage_partition: partition@d4000 {
|
||||
reg = <0x000d4000 0x00020000>;
|
||||
};
|
||||
|
||||
boot_partition: partition@f4000 {
|
||||
reg = <0x000f4000 0x0000c000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
15
app/module/boards/mechwild/pillbug/pillbug.yaml
Normal file
15
app/module/boards/mechwild/pillbug/pillbug.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
identifier: pillbug
|
||||
name: PillBug
|
||||
type: mcu
|
||||
arch: arm
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
- xtools
|
||||
supported:
|
||||
- adc
|
||||
- usb_device
|
||||
- ble
|
||||
- ieee802154
|
||||
- pwm
|
||||
- watchdog
|
||||
14
app/module/boards/mechwild/pillbug/pillbug_defconfig
Normal file
14
app/module/boards/mechwild/pillbug/pillbug_defconfig
Normal file
@@ -0,0 +1,14 @@
|
||||
# Copyright (c) 2026 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# Enable MPU
|
||||
CONFIG_ARM_MPU=y
|
||||
|
||||
# Use pinctrl
|
||||
CONFIG_PINCTRL=y
|
||||
|
||||
# enable GPIO
|
||||
CONFIG_GPIO=y
|
||||
|
||||
CONFIG_USE_DT_CODE_PARTITION=y
|
||||
CONFIG_BUILD_OUTPUT_UF2=y
|
||||
9
app/module/boards/mechwild/pillbug/pre_dt_board.cmake
Normal file
9
app/module/boards/mechwild/pillbug/pre_dt_board.cmake
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Copyright (c) 2024 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")
|
||||
Reference in New Issue
Block a user