Commit Graph

1555 Commits

Author SHA1 Message Date
Bartosz Nowak b025ba2b17
Merge 1e996322e4 into ac7f75b859 2026-02-03 03:43:31 +07:00
Willow Herring ab46f48dde
fix(keymap): Fix overflow in get/set bindings (#3205)
With the binding referenced to as uint8_t the keymap would be incorrect if more than 256 positions were in use, going to a uint16_t gives large enough headroom to not have to worry
2026-01-16 18:55:13 -05:00
Pete Johanson 24487bd974
feat(pointing): Release pressed keys on disconnect (#3204)
Match the behavior for key press release on split peripheral disconnect,
and track pressed input keys to release them as needed on disconnect.
2026-01-14 13:17:43 -05:00
Xudong Zheng 9fc10ddc22
refactor(ble): use Zephyr macros for advertising data (#3173) 2026-01-11 17:12:28 -07:00
Nicolas Munnich 19582174f3
chore: Add basic tests for Studio's layer manipulation (#3164)
chore: Add test behaviors for Studio testing

chore: Add basic tests for studio layer adjustment

chore: Fixes from code review
2026-01-07 19:01:05 -05:00
cormoran 70ab6b243a
fix(studio): avoid decoding buffer overflow (#3185)
This patch fixes studio rpc bug. Protobuf decoding buffer overflows when
multiple frames are in rx buffer.
2026-01-07 18:09:13 -05:00
Pete Johanson f85ec7e7a2
SoC: stm32c0 support (#3174)
deps: Use hal_stm32 with stm32c0 USB device fixes.

Pull in ZMK fork of hal_stm32 with USB device driver fixes for stm32c0.

feat: Add nBOOT_SEL bit setup for STM32 G0/C0 targets

Newer STM32 C0 and G0 series SoCs do not by default allow use of the
BOOT0 pin/button to enter the bootloader once something has been flash
to the device, which is a change from previous series, and usually not
what's wanted for keyboards running ZMK. To address this, add some
optional, but default initialization code to check the nBOOT_SEL bit and
override it if necessary to ensure BOOT pin/button functionality.

docs: Extract bootloader config into a dedicated page.

Pull the bootloader intergration options out of the system configuration
page into their own dedicated one.

Co-authored-by: Nicolas Munnich <98408764+nmunnich@users.noreply.github.com>

---------

Co-authored-by: Nicolas Munnich <98408764+nmunnich@users.noreply.github.com>
2026-01-07 18:05:13 -05:00
Solodros abce9deab7
fix(hid): initialize missing d_scroll_x field in mouse report (#3196)
The static mouse_report definition did not initialize the d_scroll_x
field. The zmk_hid_mouse_report_body structure contains five fields
(buttons, d_x, d_y, d_scroll_y, d_scroll_x), but d_scroll_x was left
uninitialized.

Initialize d_scroll_x to 0 to ensure all fields in the mouse report
are properly initialized and avoid potential undefined behavior.
2026-01-07 17:16:24 -05:00
Solodros 36dbf46764
fix(split): correct async UART RX buffer definition (#3193)
The RX buffer was previously defined as [RX_BUFFER_SIZE/2][2], which
created (RX_BUFFER_SIZE/2) small 2-byte buffers instead of the two
(RX_BUFFER_SIZE/2)-byte buffers required for DMA ping-pong operation.

Update the buffer definition to [2][RX_BUFFER_SIZE/2] and apply the
fix to both the central and peripheral wired split implementations.

This prevents potential DMA RX data corruption when using async UART.
2026-01-07 17:04:52 -05:00
snoyer 40e06f3c00
feat(shields): Add Studio support to boardsource3x4 (#3154)
* feat(shields): Add Studio support to boardsource3x4

* rename default transform

* add position maps
2025-12-28 08:32:42 +00:00
Alexander Krikun 308de56fb9
fix(core): support magic bootloader values for nRF52833 (#3163)
Enable ZMK_BOOTMODE_MAGIC_VALUE_BOOTLOADER_TYPE_ADAFRUIT_NRF52 for
nRF52833, add nrf52833_uf2_boot_mode.dtsi as a copy of the nRF52840 file
for easy inclusion.

Enable retention for all nrfmicro subvariants (as this is the only
in-tree board that uses the nRF52833).

This fixes &bootloader for nRF52833 boards post-4.1 upgrade.
2025-12-24 08:16:59 -07:00
hyx0329 118359c83e
fix(usb): Prevent unexpected USB disconnection caused by USB SOF (#3070)
ZMK doesn't use SOF. Disable this to prevent unexpected USB
disconnection. The disconnection is observed under 3 circumstances on a
Linux host:

1. Keyboard just performed a firmware upgrade and USB is kept connected.
2. Keyboard is woken from USB power source and USB is kept connected.
3. Keyboard is connected when host is booting, and when Linux is just
   initialized.

Disabling SOF processing will not affect boot protocol switching.

Tested on Makerdiary M60.
2025-12-18 00:52:27 -05:00
Joel Spadin 8987f3979d
fix: Fix redundant const warning (#3139)
Fixed a build warning about "const" being used twice.
2025-12-14 16:39:39 -05:00
Jakob Linke 958fa78806
fix(behaviors): correctly handle sensor rotation remainder (#3084)
The original condition was always true, this commit fixes the condition
to correctly handle the remainder for sensor rotation behaviors by using
abs().

Co-authored-by: schuay <schuay@users.noreply.github.com>
2025-12-10 03:49:34 -05:00
Nicolas Munnich 3c0f0af947
chore(tests): Write test builds to logfile (#3125)
* tempfile necessary because running build command makes directory pristine,
interfering with the build log being written.
* Should be automatically picked up by the artifacts in CI tests
2025-12-10 03:45:08 -05:00
Pete Johanson c06fa48ce5
feat!: Move to zephyr v4.1 (#3060)
refactor: Move to Zephyr v4.1.0

Move to Zephyr v4.1.0, with various build/compilation fixes needed for
basic use.

refactor(tests): Move to native_sim for tests.

feat(core): (Optionally) use Zephyr keyboard input devices

Add ability to assign a keyboard `input` device to a physical layout,
or use a chosen `zmk,matrix-input`.

fix(pointing): Refactor for changes to input API

Pass NULL user_data to input callbacks.

fix(tests): Fix BLE test to account for Zephyr changes

Handle additional read callback invocation once all matching
characteristic have been read.

fix(sensors): Initialize sensor data to 0 before fetching.

Be sure we don't get back any uninitialized data by initializing
the channel data to 0 before calling into the sensor API.

refactor(input): Adjust split input to input API changes.

Input callbacks now have a user_data parameter, adjust accordingly.

chore(bluetooth): Minor cleanup of split BT code after refactor

Small fixes and remove commented dead code left after the split
refactor.

refactor: Fix up BLE tests after Zephyr upgrade.

Minor changes to snapshots based on newer Zephyr version.

refactor(boards): Move to upstream xiao_ble board ID.

Move to official upstream board definition for the Seeed XIAO BLE.

refactor: Adjust metadata schema for HWMv2 board IDs w/ qualifiers

Adjust our ZMK metadata to allow for board IDs that include qualifiers
with slash delimeters.

refactor!(boards): Move nice!nano to HWMv2, and proper revisioning

Upgrade the nice!nano board to HWMv2, under the proper nicekeyboards
vendor directory, and with proper revisions. Includes a breaking change
to default the `2.0.0` version instead of the much older v1 (`1.0.0`).

fix: Disable Nordic dt-bindings header checks.

Disable the recently added Nordic dt-bindings header checks, which cause
issues for our HID related headers.

fix(studio): Correct `memset` usage.

Use the correct memset call to clear our RPC memory.

fix: Refactor for new Zephyr PM API

Adjustments to our PM code to match Zephyr PM APIs.

refactor(ble): Use correct BT opt for connectable.

Adjust for upstream Zephyr BT API changes for advertising options.

refactor(boards): Move MakerDiary M2 board to HWMv2.

Run the HWMv2 script to convert the MakerDiary M2 board.

fix(studio): Correct usage of thread analyzer API

Fix up the RPC code that invoke the thread analyzer API to account for
API changes.

chore: Remove nanopb module override.

Leverage nanopb version that's used by Zephyr.

feat(core): mapper for magic bootloader values.

To trigger bootloaders that use a magic value in RAM to trigger
bootloader mode, add a mapping retained memory driver that maps
write/read of boot mode values to a special magic value stored
in the actually backing RAM.

feat(behaviors): Add retention boot mode to reset.

Support new generic Zephyr retention boot mode API in the reset
behavior.

feat: Add double tap to enter bootloader functionality

Add ability to enter the bootloader if double tapping reset within the
specified window.

refactor(CI): Move to 4.1 container tags.

Move to the new 4.1 tagged container, to ensure updated SDK, Python
packages, etc.

refactor(boards): Move nRFMicro to HWMv2

Refactor nRFMicro to HWMv2, using proper SoC, revisions, and variants
(for flipped). Also move to devicetree setup of DCDC/HV DCDC.

refactor(boards): Move QMK Proton-C to HWMv2

Move Proton-C to HWMv2 for use with Zephyr 4.1.

chore(ci): Adjust core coverage for new board IDs.

Use correct board IDs, with qualifiers, for our core coverage testing.

refactor(boards): Move BDN9 to HWMv2

Move BDN9 to HWMv2, using the base `bdn9` ID, no longer including the
`_rev2` suffix in the ID.

refactor(boards): Move nice!60 to HWMv2

Migrate nice!60 to HWMv2.

refactor: Adjust how we're searching/loading keymap files

Use new post_boards_shields extension point for loading keymap files
from board/shield directories.

refactor(boards): Move planck rev6 to HWMv2.

Move Planck board definition to HWMv2, including versioning tweaks.

refactor(boards): Move OLKB Preonic to HWMv2

Move Preonic board definition to HWMv2 and remove `_rev3` variant
suffix in favor of board versioning with `3.0.0` as the default.

chore(deps): Pull in Zephyr optional group for nanopb.

Ensure we enable nanopb by adding +optional group filter.

fix(ci): Prevent slash characters in artifact names.

Move to HWMv2 means board IDs often include slashes, so replace those
with underscores when doing file uploads.

fix(usb): Adjust Kconfig settings for USB.

* Ensure USB isn't initialized automatically before we do, which can
  happen if USB CDC logging is used/enabled for a given board.
* Adjust USB HID to initialize the USB class/interface before we enable
  the USB device itself.

fix(display): Fix setting the small font for the mono theme.

Adjust for modified mono theme init function to pass the small font.

chore(ci): Fix changed board IDs for core coverage.

Adjust board IDs for our core coverage after move to HWMv2 and board
versioning consistently.

* planck_rev6 -> planck
* bdn9_rev2 -> bdn9

fix(underglow): Remove use of removed Kconfig WS2812 symbol

refactor(boards): Move PW CKP boards to HWMv2

Migrate the bt60, bt65, and bt75 to HWMv2.

refactor(boards): Move Puchi BLE to HWMv2

Migrate the Puchi BLE to HWMv2.

refactor(boards): Migrate Ferris rev02 to HWMv2.

Move Ferris rev02 to HMWv2, and remove the revision from the ID.

refactor(boards): Move Pillbug to HWMv2

Migrate the MechWild PillBug board to HWMv2.

refactor(boards): Migrate s40nc to HWMv2

Move the ShortyFortyNoCordy (s40nc) to HWMv2.

refactor(boards): Move bluemicro840 board to HWMv2.

Migrate bluemicro840 board to HWMv2, set up boot mode retention.

fix(boards): Retore bootloader support on XIAO BLE.

Set up necessary boot mode/retention to properly set GPREGRET to trigger
Adafruit bootloader to run on the XIAO BLE.

refactor(boards): Move Adv360 Pro to HWMv2.

Migrate Adv360 Pro left/right to HWMv2.

refactor(boards): Move Glove80 to HMWv2

Refactor the MoErgo Glove80 left/right to HWMv2.

refactor(boards): Move Mikoto to HMWv2.

Migrate Mikoto to HWMv2, with non-exact matching, tweaks to I2C
selection to imply it for the 7.2.0 revision for the fuel gauge.

refactor(boards): Move kbdfans Tofu65 2.0 to HMWv2

Move Tofu65 2.0 to HMWv2, with ID of just `tofu65`.

refactor(boards): Remove dz60rgb board

Remove dz60rgb, it's no longer readily available and we have other
current stm32 reference designs for testing.

refactor(boards): Move Corneish Zen to HMWv2

Move Corneish Zen to HMWv2, with IDs of
`corneish_zen_left`/`corneish_zen_right`.

refactor(boards): Migrate Corne-ish Zen status screen

* refactor(boards): Add boot mode to the nice!nano using common dtsi

* Add a new .dtsi for setting up nRF52 boot mode/retained memory
  settings
* Adjust XIAO BLE to use the new include file
* Add boot mode to to the nice!nano

refactor(boards): Add boot mode support to nice!60 board

Enable boot mode for nice!60 board.

refactor(boards): Adjust Zephyr board metadata file locations

Move the ZMK metadata files for upstream Zephyr boards to align with the
HWMv2 directory structure that uses the vendor ID for the parent
directory for a board directory.

fix: Don't enable ZMK Display by default for a few shields

By convention, avoid enabling ZMK Display by default on shields that may
be built with under-resourced controllers (e.g. nRF52833 based ones).

fix: Remove usage of renamed Kconfig from core coverage.

Avoid using WS2812_LED_STRIP, since that Kconfig was renamed/split into
SPI/GPIO/I2S symbols.

refactor(boards): Adjust XIAO RP2040 override names, bootloader support

Adjust the .conf/.overlay files to match the proper naming for the
XIAO rp2040 board. Also add the necessary Kconfig/DTS bits for
supporting bootloader using retained memory/boot mode retention.

fix(display): Adjust stack sizes for display usage.

Updated LVGL is bumping our stack size, so adjust the system work queue
and dedicated display queue stack sizes as needed to account for this.

feat(display): Add thread name to dedicated display queue.

When thread names are enabled, pass a name to the dedicated display
queue for better tracibility when using the thread analyzer.

docs(blog): Add Zephyr upgrade post

docs: Add bootloader integration page

Add a dedicated page to outline steps to set up bootloader integration
using the boot retention mechanism in newer Zephyr versions.

fix(display): port nice!view display code

* remove `lv_` prefix from old LVGL methods

doc: Update local setup docs to use `west packages pip`

Install Zephyr deps using the newer `west packages pip --install`.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>

refactor(split): Adjust BT split code for newer Zephyr APIs.

refactor(boards): Adjust upstream RP2040 boards for boot mode retention

Add necessary DTS/Kconfig settings to upstream RP2040 boards so they can
use the ZMK bootloader functionality using the boot mode retention
infrastructure.

docs: Update Zephyr docs links to 4.1.0 version.

Update all links to the Zephyr docs to the 4.1.0 versions to match our
Zephyr version in use.

docs: Add a note about using CMake v3 for maximum compatibility.

Some optional modules, like libmetal, which is used on nRF5340,
specifically require CMake v3, so add a note in the native toolchain
setup about this.

feat(pointing): Handle INPUT_BTN_TOUCH codes for mouse buttons

Translate INPUT_BTN_TOUCH input codes into button 0 press/release for
HID layer.

chore(pointing): Clean up some warning messages.

Properly check return code from queue-ing messages, and fix up some type
warnings in our logging calls.

* Fix input event codes line numbers

fix(studio): Properly serialize GATT RPC indications.

fix(core): Set a system work queue stack size of 2048 by default

We use a fair amount of stack even without BLE or RP2040, so default to
2048 by default everywhere, and constrained platforms can lowes this if
they really need.

refactor(core): Move away from deprecated DIS Kconfig symbols

Use the correct Device Information Service Kconfig symbols for our model
number and manufacturer.

refactor: Move upstream Zephyr board overrides to extensions dirs

Newer Zephyr supports "board extensions" to formally do what we've added
in ourselves via some hacks, so move all our board overlay/config file
overrides for upstream Zephyr boards into that correct structure.

fix(boards): Add xiao_ble sd_partition label for nosd snippet compat

Upstream xiao_ble uses different naming convention for the partition
labels, so add an additional label for the SD range, so the existing
nrf52840-nosd snippet will still work with the board.

fix(core): Don't force CBPRINTF_NANO, for proper formatting.

The nano CBPRINTF implementation lacks some padded formatting needed to
ensure consistent formatting of BLE addresses, which we use to store
keys as strings in a few places, so use the complete CBPRINTF by default
now.

fix(boards): Remove some references to old nice_nano_v2 board ID.

The nice!nano board definition now properly uses versioning, so avoid
referring to it with old `nice_nano_v2` board ID.

fix(boards): Remove nano overlays for old nice_nano_v2 board ID.

With board versioning in place, we can remove the unused
`nice_nano_v2.overlay` files from shields.

---------

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
Co-authored-by: Nicolas Munnich <munnich@lipn.univ-paris13.fr>
Co-authored-by: snoyer <noyer.stephane@gmail.com>
2025-12-09 19:43:22 -05:00
Genteure ece2ce11b8
fix(split): int to pointer cast in bas proxy (#3105)
Direct int to pointer cast causing build to fail in some build environments.
2025-12-07 02:38:05 -05:00
Willow Herring d32ffb0a33
fix(split): Properly return from command handler (#3120) 2025-12-06 23:09:31 -05:00
Cem Aksoylar 83eafcbf9b
refactor(Kconfig): Move BT_DEVICE_APPEARANCE to defaults (#3128) 2025-12-06 15:58:18 -07:00
Artem ad7fbfef92
feat(ble): Use appearance set in the BT_DEVICE_APPEARANCE config (#3115)
Properly use the BT_DEVICE_APPEARANCE Zephyr symbol to advertise
the correct appearance, allowing overrides, for e.g. mice.

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2025-12-04 13:53:47 -05:00
Bartosz Nowak 1e996322e4 feat: add alt 3key keymap 2025-12-03 00:48:29 +01:00
Bartosz Nowak c451cbc918 Update transform for 3key_2us layout and add key row comments in ergodash-layouts.dtsi 2025-12-03 00:48:29 +01:00
Bartosz Nowak 0ec15b5e3c Refactor ergodash layout keys for clarity and update transform for 3key_2us layout 2025-12-03 00:48:29 +01:00
Bartosz Nowak b3702ba6c2 Update transform for 3key_2us layout and fix typo in ergodash.dtsi 2025-12-03 00:48:28 +01:00
Bartosz Nowak b2af481b56 Add support for new 3key_2us transform in ergodash layout 2025-12-03 00:48:28 +01:00
Bartosz Nowak 86e92682b0 Update app/boards/shields/ergodash/ergodash_left.overlay
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-03 00:48:28 +01:00
Bartosz Nowak 0e86d0d90c Update app/boards/shields/ergodash/ergodash_right.overlay
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-03 00:48:28 +01:00
Bartosz Nowak fdf667edce Update app/boards/shields/ergodash/ergodash-layouts.dtsi
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-03 00:48:28 +01:00
Bartosz Nowak 8e7d8ddde8 Delete app/boards/shields/ergodash/ergodash_right.conf 2025-12-03 00:48:28 +01:00
Bartosz Nowak b149264a7c Delete app/boards/shields/ergodash/ergodash_left.conf 2025-12-03 00:48:28 +01:00
Bartosz Nowak ff0f6d452b Delete app/boards/shields/ergodash/ergodash.studio.json 2025-12-03 00:48:28 +01:00
Bartosz Nowak 730ddb8531 Update app/boards/shields/ergodash/ergodash.zmk.yml 2025-12-03 00:48:28 +01:00
Bartosz Nowak c4bec82d80 Modify ergodash keymap for button functionality 2025-12-03 00:48:28 +01:00
Bartosz Nowak 21f7decd38 Delete app/boards/shields/ergodash/ergodash.conf 2025-12-03 00:48:28 +01:00
Bartosz Nowak 4eece778fd Update app/boards/shields/ergodash/Kconfig.shield 2025-12-03 00:48:28 +01:00
Bartosz Nowak 9e17928b1b Delete app/boards/shields/ergodash/build.yaml 2025-12-03 00:48:28 +01:00
Bartosz Nowak 2da1f0c49c feat: add support for zmk studio 2025-12-03 00:48:28 +01:00
Nicolas Munnich 5138c6fb14
feat: Allow layer behaviors to "lock" layers on (#2717)
* refactor(core)!: Allow layer behaviors to "lock" layers on

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>

* docs: Added documentation note on locking layers

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>

---------

Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2025-11-14 23:13:35 +01:00
Willow Herring 7738924349
feat(split): Add HID indicators and physical layout set to Wired split (#3103) 2025-11-02 17:01:08 -07:00
Andrés Mejía 61de01abb0
feat(layouts): Add physical layout for Redox shield 2025-09-16 23:23:46 +02:00
Aurélien Vallée 197d104fc9
chore(shields): Add missing display-name for existing keymaps (#3048) 2025-09-10 15:48:33 -07:00
Nicolas Munnich 522971f41d
fix(ci): disable nrf5340dk from being built in our CI (#3066)
This build is currently broken, and will be fixed once we bump to 4.1.
2025-09-10 10:30:09 -07:00
Pete Johanson 0b5a103c18
fix(core): Generate correct keymap layer names for all builds (#3047)
Properly account for studio and non-studio builds for the generation of
the layer names stored within the keymap system.

Fixes #3045
2025-08-26 03:26:20 -06:00
Nicolas Munnich ccf20a1f5c
feat(boards/shields): Add settings for Rpi Pico and add tester_rpi_pico shield (#2900)
* feat(boards): Properly support settings for RPi Pico board.

* feat(shields): Add a tester_rpi_pico shield

---------

Co-authored-by: Peter Johanson <peter@peterjohanson.com>
2025-08-10 22:00:35 +01:00
Marius Petcu c7fae18ae1
feat(boards): add support for nrf52840dongle_nrf52840 (#3011)
This adds additional required configs for the Nordic NRF52840 Dongle (PCA10059),
which was already supported by Zephyr, but didn't have flash settings
and Bluetooth enabled.
2025-08-08 23:47:03 +01:00
Pete Johanson edf5c0814f
chore(main): release 0.3.0 (#2858) 2025-08-01 18:44:20 -04:00
Nicolas Munnich c86f0d6ff4
chore: Add some basic encoder tests (#2845)
Adds some encoder tests for rotating, and basic layers.
Mock Kscans don't seem to interact nicely, slightly on the hacky side.
However, better to have hacky tests than no tests.
2025-07-31 18:29:59 -04:00
Genteure af967667b0
fix(core): Correctly sync BAS battery level (#2977)
Fix BAS battery level showing 100% if controller boots up with 0% battery charge.

Closes zmkfirmware/zmk#2972
2025-07-31 17:51:21 -04:00
Pete Johanson 2ae5185419
fix(split): Compile and run properly in wired polling mode. (#3012)
Fixes for regressions from split refactors that broke polling mode
specifically.

Co-authored-by: honorless <86894501+lesshonor@users.noreply.github.com>
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
2025-07-31 17:09:25 -04:00
Pete Johanson 1530ae36c2
fix(split): Enable wired split by default if DTS is set (#3010)
Remove the previous condition on ZMK_SPLIT_WIRED that only enabled it if
!ZMK_BLE. We'll defer to the `depends on` to ensure the DTS exists to
use wired split to make that decision on enabling the feature.
2025-07-30 13:43:46 -04:00