Skip to content

Commit f736582

Browse files
authored
Merge pull request #3 from mctechnology17/blank-slate
feat: implement local docker build system and update ci config
2 parents 705a5a9 + 1bc9224 commit f736582

16 files changed

Lines changed: 617 additions & 56 deletions

.devcontainer/build.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
name: Build ZMK firmware for Blank Slate
2-
on: [workflow_dispatch]
1+
on: [push, pull_request, workflow_dispatch]
32

43
jobs:
54
build:
6-
uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main
5+
uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@v0.3.0

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
zmk
12
# West
23
.west/
34
zephyr/

Makefile

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# Schritte:
2+
# 1. make base
3+
# ========================================
4+
# FileName: Makefile
5+
# Date: 16.12.2025
6+
# Author: Marcos Chow Castro
7+
# Email: mctechnology170318@gmail.com
8+
# GitHub: https://github.com/mctechnology17
9+
# Brief: Makefile for ZMK firmware with Docker
10+
# Shields: lpgalaxy_blank_slate
11+
# Boards: nice_nano_v2 puchi_ble_v1 seeeduino_xiao_ble lpgalaxy_blank_slate
12+
# =========================================
13+
# ╔═╦═╦═╗
14+
# ╔════╗ ║║║║║╔╝
15+
# ║╔╗╔╗║ ║║║║║╚╗
16+
# ╚╝║║╚╝ ║╠═╩╩═╝
17+
# ║╠═╦═╣╚╦═╦╦═╦╗╔═╦═╦╦╗
18+
# ║║╩╣═╣║║║║║╬║╚╣╬║╬║║║
19+
# ╚╩═╩═╩╩╩╩═╩═╩═╩═╬╗╠╗║
20+
# ╚═╩═╝
21+
22+
### CONFIG ###
23+
zmk_studio= -S studio-rpc-usb-uart
24+
extra_modules_dir=${PWD}
25+
# add a submodule automatic :)
26+
# git submodule add https://github.com/petejohanson/blank-slate-zmk-module.git module/blank-slate-zmk-module
27+
extra_modules= -DZMK_EXTRA_MODULES="/boards"
28+
extra_snippet= /boards/snippets
29+
config=${PWD}/config
30+
nice_mount=/Volumes/NICENANO
31+
puchi_mount=/Volumes/NRF52BOOT
32+
xiao_mount=/Volumes/XIAO-SENSE
33+
zmk_image=zmkfirmware/zmk-dev-arm:3.5
34+
nice=nice_nano_v2
35+
puchi=puchi_ble_v1
36+
xiao=seeeduino_xiao_ble
37+
slate=lpgalaxy_blank_slate
38+
default=zmk-base
39+
docker_opts= \
40+
--interactive \
41+
--tty \
42+
--name zmk-$@ \
43+
--workdir /zmk \
44+
--volume "${config}:/zmk-config:Z" \
45+
--volume "${PWD}/zmk:/zmk:Z" \
46+
--volume "${extra_modules_dir}:/boards:Z" \
47+
${zmk_image}
48+
49+
### KEYBOARD NAME ###
50+
keyboard_name_slate= '-DCONFIG_ZMK_KEYBOARD_NAME="SLATE"'
51+
keyboard_name_felerius_blank_slate= '-DCONFIG_ZMK_KEYBOARD_NAME="F_SLATE"'
52+
53+
### WEST ###
54+
west_built_puchi= \
55+
west build /zmk/app \
56+
--pristine --board "${puchi}"
57+
58+
west_built_nice= \
59+
west build /zmk/app \
60+
--pristine --board "${nice}"
61+
62+
west_built_xiao= \
63+
west build /zmk/app \
64+
--pristine --board "${xiao}"
65+
66+
west_built_slate= \
67+
west build /zmk/app \
68+
--pristine --board "${slate}"
69+
70+
### SHIELDS ###
71+
shield_settings_reset= \
72+
-- -DSHIELD="settings_reset" -DZMK_CONFIG="/zmk-config"
73+
74+
### ARTIFACT ###
75+
artifact_name_slate=/zmk/build/zephyr/zmk.uf2 \
76+
firmware/blank-slate.uf2
77+
artifact_name_felerius_blank_slate=/zmk/build/zephyr/zmk.uf2 \
78+
firmware/felerius_blank_slate.uf2
79+
80+
clone_zmk:
81+
if [ ! -d zmk.git ]; then git clone https://github.com/zmkfirmware/zmk -b v0.3.0; fi
82+
83+
base: clone_zmk
84+
docker run ${docker_opts} sh -c '\
85+
west init -l /zmk/app/; \
86+
west update'
87+
88+
### BASE START
89+
extra_cmake_args_slate= -DCONFIG_ZMK_SLEEP=y \
90+
-DCONFIG_ZMK_IDLE_TIMEOUT=60000 \
91+
-DCONFIG_ZMK_IDLE_SLEEP_TIMEOUT=2200000
92+
93+
extra_cmake_args_felerius_blank_slate= -DCONFIG_ZMK_SLEEP=y \
94+
-DCONFIG_ZMK_IDLE_TIMEOUT=60000 \
95+
-DCONFIG_ZMK_IDLE_SLEEP_TIMEOUT=2200000 \
96+
-DZMK_KEYMAP=/zmk-config/felerius_blank_slate.keymap \
97+
-DEXTRA_CONF_FILE=/zmk-config/felerius_blank_slate.conf
98+
99+
only_slate:
100+
docker run --rm ${docker_opts} \
101+
${west_built_slate} \
102+
${zmk_studio} \
103+
${extra_modules} ${extra_cmake_args_slate} \
104+
${keyboard_name_slate}
105+
docker cp ${default}:${artifact_name_slate}
106+
107+
only_felerius_blank_slate:
108+
docker run --rm ${docker_opts} \
109+
${west_built_slate} \
110+
${zmk_studio} \
111+
${extra_modules} ${extra_cmake_args_felerius_blank_slate} \
112+
${keyboard_name_felerius_blank_slate}
113+
docker cp ${default}:${artifact_name_felerius_blank_slate}
114+
115+
my_slate: only_slate \
116+
only_felerius_blank_slate
117+
118+
### OPEN A SHELL WITHIN THE ZMK ENVIRONMENT ###
119+
shell:
120+
docker run --rm ${docker_opts} /bin/bash
121+
122+
### FLASH THE APPROPRIATE FIRMWARE TO THE BOOTLOADER ###
123+
flash_slate:
124+
@ printf "Waiting for ${slate} bootloader to appear at ${nice_mount}.."
125+
@ while [ ! -d ${nice_mount} ]; do sleep 1; printf "."; done; printf "\n"
126+
cp -av firmware/blank-slate.uf2 ${nice_mount}
127+
128+
### CLEAN ###
129+
clean_firmware:
130+
find firmware/*.uf2 -type f -delete
131+
132+
clean_zmk:
133+
if [ -d zmk ]; then rm -rfv zmk; fi
134+
135+
clean: clean_zmk
136+
docker ps -aq --filter name='^zmk' | xargs -r docker container rm
137+
docker volume list -q --filter name='zmk' | xargs -r docker volume rm
138+
139+
clean_all: clean clean_firmware
140+
@echo "cleaning all"
141+
142+
# vim: set ft=make fdm=marker:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-License-Identifier: MIT
2+
3+
config BOARD_ENABLE_DCDC
4+
bool "Enable DCDC mode"
5+
select SOC_DCDC_NRF52X
6+
default y
7+
depends on BOARD_LPGALAXY_BLANK_SLATE
8+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Blank Slate board configuration
2+
3+
# Copyright (c) 2021 Pete Johanson
4+
# SPDX-License-Identifier: MIT
5+
6+
config BOARD_LPGALAXY_BLANK_SLATE
7+
bool "LP Galaxy Blank Slate"
8+
depends on SOC_NRF52840_QIAA
9+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2020 Pete Johanson
2+
# SPDX-License-Identifier: MIT
3+
4+
if BOARD_LPGALAXY_BLANK_SLATE
5+
6+
config BOARD
7+
default "lpgalaxy_blank_slate"
8+
9+
config ZMK_KEYBOARD_NAME
10+
default "Blank Slate"
11+
12+
if USB
13+
14+
config USB_NRFX
15+
default y
16+
17+
config USB_DEVICE_STACK
18+
default y
19+
20+
endif # USB
21+
22+
config BT_CTLR
23+
default BT
24+
25+
config ZMK_BLE
26+
default y
27+
28+
config ZMK_USB
29+
default y
30+
31+
endif # BOARD_LPGALAXY_BLANK_SLATE
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-License-Identifier: MIT
2+
3+
board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset")
4+
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
5+
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
#include <layouts/common/ortho_4x12/all1u.dtsi>
3+
#include <layouts/common/ortho_4x12/1x2u.dtsi>
4+
#include <layouts/common/ortho_4x12/2x2u.dtsi>

0 commit comments

Comments
 (0)