This adds an optional feature to trigger an action if a specific key is
held when the keyboard is powered on. It can be configured to jump to
the bootloader and/or clear settings.
This is inspired by QMK's "bootmagic lite" feature, and it is primarily
intended as a way to recover a keyboard which doesn't have a physical
reset button in case it is flashed with firmware that doesn't have a
&bootloader key in its keymap. It can also be used to clear BLE bonds on
the peripheral side of a split keyboard without needing to flash
special firmware.
Moved the logic to select the type of reboot from behavior_reset.c to a
new zmk_reset() function. This allows rebooting to bootloader from
other code, and it gives us a starting point for future work to support
other bootloaders aside from the Adafruit nrf52 bootloader.
* fix(docs): Improve link and code highlight contrast
Reset the theme's primary colors to the defaults, since the color of
links was a bit too low contrast in the dark theme. The default primary
color is a very similar but slightly lighter shade of blue.
The background color of highlighted lines in code blocks is also fairly
low contrast, but it needs to be in order to keep the text readable. To
add contrast here, we now add a colored block to the left side of a
highlighted line.
* fix(docs): Improve ZMK setup instructions
This makes several improvements to the instructions for installing and
using ZMK CLI:
- Windows Terminal is also named "Terminal", so reworded the terminal
instructions to not separate Windows from other OSes.
- Specified that Windows Terminal should always be used on Windows, as
on older installations of Windows, the default terminal when opening
PowerShell may be the legacy console host, which may not support some
of the VT sequences used by ZMK CLI.
- Switched from pipx to uv. This eliminates the need for instructions
on installing Python, as uv will automatically install a supported
version of Python if needed.
- Updated the instructions for running "zmk init", as ZMK CLI version
0.4.0 switched from immediately asking for a repo URL to prompting
the user to select between creating a new repo or cloning an existing
one first.
- Since for a new user, having a keymap compile successfully on the
first attempt after modifying it may be the exception rather than the
norm, added a note about error messages in GitHub actions with a link
to the troubleshooting page.
Also added instructions for updating ZMK CLI to the latest version on
the ZMK CLI page.
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
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>
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.
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.
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.
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.
Adds support for building the firmware in the config-repo locally via
[act](https://github.com/nektos/act).
Linux example command:
```shell
act --artifact-server-path $PWD/.artifacts
```
MacOS (M2) example command:
```shell
act --artifact-server-path $PWD/.artifacts \
--container-architecture \
linux/amd64 --container-daemon-socket -
This deletes the Bash and PowerShell setup scripts in favor of using
ZMK CLI. The old setup scripts are broken, since the config repo
template uses ZMK version 0.3, while the setup scripts use hardware
metadata from the main branch. ZMK CLI doesn't have this issue, because
it clones the version of ZMK listed in the config repo to get hardware
metadata.
Much of the "Installing ZMK" page has been rewritten to give
instructions for installing ZMK CLI and using it to create and modify
a config repo. The previously-hidden page on ZMK CLI has been added to
the sidebar and repurposed into general documentation for the tool.
Zephyr now has some modules that get placed under /optional/modules
instead of /modules. Added that to .gitignore so Git doesn't try to
treat those like Git modules.