Skip to main content

Bootloader Integration Configuration

These are general settings that control the various bootloader integration features of ZMK.

See Configuration Overview for instructions on how to change these settings.

Kconfig

Definition file: zmk/app/src/boot/Kconfig

Double Tap To Bootloader

Some SoCs, like RP2040 or the various STM32 offerings, require holding a certain "boot button" down to enter the bootloader, on a hardware level. To make it easier to enter the bootloader on those platforms, ZMK integrates an optional feature to allow entering the bootloader by simply double tapping reset within the configured timeout period.

ConfigTypeDescriptionDefault
CONFIG_ZMK_DBL_TAP_BOOTLOADERboolEnable the double-tap to enter bootloader functionalityy if STM32 or RP2040/RP2350
CONFIG_ZMK_DBL_TAP_BOOTLOADER_TIMEOUT_MSintDuration (in ms) to wait for a second reset to enter the bootloader500

STM32 nBOOT_SEL Option Byte Setup

Some newer STM32 series SoCs, in particular stm32c0 and stm32g0, enable the nBOOT_SEL bit of the option bytes by default. This bit prevents entering the system ROM bootloader by holding the BOOT0 pin/button during a reset/startup.

To ensure the BOOT button on keyboard and controllers using these SoCs works as expected after being flashed with ZMK, we check the nBOOT_SEL bit on startup and clear it if it is set. Should you not want that functionality, for some reason, this can be disabled.

ConfigTypeDescriptionDefault
CONFIG_ZMK_BOOT_STM32_ENFORCE_NBOOT_SELboolEnsure the nBOOT_SEL bit is not sety if STM32CO or STM32G0

Bootmode Magic Value Mapper

Some target SoCs may use the bootmode magic value mapper for bootloader integration. When doing so, the following configurations are used:

ConfigTypeDescriptionDefault
CONFIG_ZMK_BOOTMODE_BOOTLOADER_MAGIC_VALUEhexThe magic value to place into retained memory when the bootloader boot mode is setnone
CONFIG_ZMK_BOOTMODE_MAGIC_VALUE_BOOTLOADER_TYPE_TINYUF2boolUsed to default the bootloader magic value for the tinyuf2 bootloaderfalse
CONFIG_ZMK_BOOTMODE_MAGIC_VALUE_BOOTLOADER_TYPE_ADAFRUIT_BOSSAboolUsed to default the bootloader magic value for the Adafruit BOSSA (SAMD21) bootloaderfalse
CONFIG_ZMK_BOOTMODE_MAGIC_VALUE_BOOTLOADER_TYPE_ADAFRUIT_NRF52boolUsed to default the bootloader magic value for the Adafruit nRF52 bootloaderfalse