Skip to content

Commit 4d3b61d

Browse files
committed
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`.
1 parent 930b5cc commit 4d3b61d

86 files changed

Lines changed: 539 additions & 200 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,14 @@ jobs:
161161
];
162162
const combinedUnique = [...new Map(combined.map(el => [JSON.stringify(el), el])).values()];
163163
164+
console.log(combinedUnique);
165+
164166
const perBoard = {};
167+
idx = 0;
165168
166169
for (const configuration of combinedUnique) {
170+
console.log(idx++);
171+
console.log(configuration);
167172
if (!perBoard[configuration.board])
168173
perBoard[configuration.board] = [];
169174

app/boards/adafruit/kb2040/adafruit_kb2040.zmk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
file_format: "1"
2-
id: adafruit_kb2040
2+
id: adafruit_kb2040//zmk
33
name: Adafruit KB2040
44
type: board
55
arch: arm

app/boards/extensions/boardsource_blok/boardsource_blok.overlay renamed to app/boards/adafruit/kb2040/adafruit_kb2040_zmk.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* SPDX-License-Identifier: MIT
55
*/
66

7+
#include <../boards/adafruit/kb2040/adafruit_kb2040.dts>
78
#include <arm/raspberrypi/rp2040-boot-mode-retention.dtsi>
89

910
&pro_micro_serial { status = "disabled"; };
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-License-Identifier: MIT
2+
3+
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=125000000
4+
5+
# Enable reset by default
6+
CONFIG_RESET=y
7+
8+
# Enable clock control by default
9+
CONFIG_CLOCK_CONTROL=y
10+
11+
# Code partition needed to target the correct flash range
12+
CONFIG_USE_DT_CODE_PARTITION=y
13+
14+
# Output UF2 by default, native bootloader supports it.
15+
CONFIG_BUILD_OUTPUT_UF2=y
16+
17+
# USB HID
18+
CONFIG_ZMK_USB=y
19+
20+
# Bootloader Support
21+
CONFIG_RETAINED_MEM=y
22+
CONFIG_RETENTION=y
23+
CONFIG_RETENTION_BOOT_MODE=y
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
board:
2+
extend: adafruit_kb2040
3+
variants:
4+
- name: zmk
5+
qualifier: rp2040

app/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.zmk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
file_format: "1"
2-
id: adafruit_qt_py_rp2040
2+
id: adafruit_qt_py_rp2040//zmk
33
name: Adafruit QT Py RP2040
44
type: board
55
arch: arm

app/boards/extensions/adafruit_qt_py_rp2040/adafruit_qt_py_rp2040.overlay renamed to app/boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040_zmk.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* SPDX-License-Identifier: MIT
55
*/
66

7+
#include <../boards/adafruit/qt_py_rp2040/adafruit_qt_py_rp2040.dts>
78
#include <arm/raspberrypi/rp2040-boot-mode-retention.dtsi>
89

910
&xiao_serial { status = "disabled"; };
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-License-Identifier: MIT
2+
3+
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=125000000
4+
5+
# Enable reset by default
6+
CONFIG_RESET=y
7+
8+
# Enable clock control by default
9+
CONFIG_CLOCK_CONTROL=y
10+
11+
# Code partition needed to target the correct flash range
12+
CONFIG_USE_DT_CODE_PARTITION=y
13+
14+
# Output UF2 by default, native bootloader supports it.
15+
CONFIG_BUILD_OUTPUT_UF2=y
16+
17+
# USB HID
18+
CONFIG_ZMK_USB=y
19+
20+
# Bootloader Support
21+
CONFIG_RETAINED_MEM=y
22+
CONFIG_RETENTION=y
23+
CONFIG_RETENTION_BOOT_MODE=y
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
board:
2+
extend: adafruit_qt_py_rp2040
3+
variants:
4+
- name: zmk
5+
qualifier: rp2040
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
board:
2+
extend: boardsource_blok
3+
variants:
4+
- name: zmk
5+
qualifier: rp2040

0 commit comments

Comments
 (0)