> For the complete documentation index, see [llms.txt](https://guides-mechboards.gitbook.io/guides/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guides-mechboards.gitbook.io/guides/other-guides/zmk-bootloader-key-flashing-guide.md).

# ZMK - Bootloader Key Flashing Guide

This is intended to be a fairly generic guide, so will not cover hardware methods of entering bootloader which will be somewhat specific to each board.

{% hint style="info" %}
If the keyboard requires unlocking to use ZMK Studio ensure you've included the `&studio_unlock` in the keymap you're going to flash.
{% endhint %}

To make things easier we're going to bind the the bootloader key on the default layer, this ensures you can easily access it while we're performing the flashing procedure. We need to add the key to both sides as it's side dependant.&#x20;

For instance if the bootloader key is on the right half, it'll cause the right side to enter bootloader.

### Assigning Bootloader

Assign bootloader to any key of your choice on the default/base layer. In the example below we're going to assign left shift to bootloader.

{% stepper %}
{% step %}

### Select the key you want to assign.

<figure><img src="/files/Z4EuCKGaS6bdwoYrbaf5" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Assign the bootloader behavior

Go to the Behavior drop down and select bootloader.

<figure><img src="/files/zWn5BtNSL3Sj6EAgum01" alt=""><figcaption></figcaption></figure>

You'll see bootloader text on the key you just assigned when hovered over, otherwise it'll just look blank.

<figure><img src="/files/XShCWEM2F9OFrPtbPj1w" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Repeat procedures 1-2 for the other side

<figure><img src="/files/UqhFowkUsygeZ9k7GDeM" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Save the changes

The keys are now assigned and will work but will be lost on a power cycle, so we need to save our changes.

Save the changes by clicking the small floppy disk icon in the top right corner. It'll go grey when saved.

<figure><img src="/files/d6GKoH3SbB5CwOxfPjq4" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="info" %}
If your board requires using a studio unlock key, I would recommend binding it on the default layer as well for the moment. You can do this by selecting another key and choosing Studio Unlock in the behavior drop down and saving.
{% endhint %}

## Flashing the new firmware

We've added the bootloader key to both sides, so we're ready for flashing.

{% stepper %}
{% step %}

### Connect the USB cable to the right side&#x20;

{% endstep %}

{% step %}

### Press the bootloader key

{% hint style="info" %}
Ensure you press the bootloader key on the side connected to USB.
{% endhint %}
{% endstep %}

{% step %}

### A wild USB drive appears

A USB drive will appear, the exact name of this drive will defer depending on hardware but it should have the 3 files, `CURRENT.UF2`, `INDEX.HTML` and `INFO_UF2.TXT`.&#x20;

<figure><img src="/files/3Mk2liRDP3ZGgmnwjzMI" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Flashing new firmware

To flash new firmware, you need to copy the new firmwares .uf2 file into this drive. Ensure you select the correct firmware for the side you're flashing.

<figure><img src="/files/kHGyW3lqcBGEuGvDPAO9" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You'll notice at the end there's an error message, this is quite common and the exact message can sometimes vary a little. It's perfectly fine and the firmware has been successfully flashed. You can dismiss the message with either cancel, skip or closing it.
{% endhint %}
{% endstep %}

{% step %}

### Disconnect USB cable

The firmware has been flashed, it's safe to disconnect the USB cable.
{% endstep %}

{% step %}

### Repeat steps 1-5 for the left

{% endstep %}
{% endstepper %}

### Restoring our new keymap

The keymap may not have updated to the new firmware you've flashed, we need to restore it from flash.

{% stepper %}
{% step %}

### Open ZMK Studio

{% endstep %}

{% step %}

### Restore Stock Settings

You'll need to click the name in the middle at the top, this will drop down the menu allowing you to restore the keymap to defaults.

<figure><img src="/files/OlJmLF0pGIqjvzewuaJ4" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

If everything went well you should have a functioning keyboard.&#x20;

## Any Issues?

Please don't hesitate to get in contact - We'll be more than happy to help! -&#x20;

{% embed url="<https://www.mechboards.co.uk/support>" %}
