qmk_firmware/assets/flashing.md.tM_8Yx0K.js

16 lines
37 KiB
JavaScript
Raw Normal View History

import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.B9AX-CPi.js";
const __pageData = JSON.parse('{"title":"Flashing Instructions and Bootloader Information","description":"","frontmatter":{},"headers":[],"relativePath":"flashing.md","filePath":"flashing.md"}');
const _sfc_main = { name: "flashing.md" };
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="flashing-instructions-and-bootloader-information" tabindex="-1">Flashing Instructions and Bootloader Information <a class="header-anchor" href="#flashing-instructions-and-bootloader-information" aria-label="Permalink to &quot;Flashing Instructions and Bootloader Information&quot;"></a></h1><p>There are quite a few different types of bootloaders that keyboards use, and almost all of them use their own flashing method and tools. Luckily, projects like the <a href="https://github.com/qmk/qmk_toolbox/releases" target="_blank" rel="noreferrer">QMK Toolbox</a> aim to support as many of them as possible, but this article will describe the different types of bootloaders, and available methods for flashing them.</p><p>For AVR-based keyboards, QMK will automatically calculate if your <code>.hex</code> file is the right size to be flashed to the device based on the <code>BOOTLOADER</code> value set in <code>rules.mk</code>, and output the total size in bytes (along with the max).</p><p>You will also be able to use the CLI to flash your keyboard, by running:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>$ qmk flash -kb &lt;keyboard&gt; -km &lt;keymap&gt;</span></span></code></pre></div><p>See the <a href="./cli_commands#qmk-flash"><code>qmk flash</code></a> documentation for more information.</p><h2 id="atmel-dfu" tabindex="-1">Atmel DFU <a class="header-anchor" href="#atmel-dfu" aria-label="Permalink to &quot;Atmel DFU&quot;"></a></h2><p>Atmel&#39;s DFU bootloader comes on all USB AVRs by default (except for 16/32U4RC), and is used by many keyboards that have their own ICs on their PCBs (older OLKB boards, Clueboards). Some keyboards may also use LUFA&#39;s DFU bootloader, or QMK&#39;s fork of it (newer OLKB boards), that adds in additional features specific to that hardware.</p><p>To ensure compatibility with the DFU bootloader, make sure this block is present in your <code>rules.mk</code> (optionally with <code>lufa-dfu</code> or <code>qmk-dfu</code> instead):</p><div class="language-make vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">make</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Bootloader selection</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">BOOTLOADER = atmel-dfu</span></span></code></pre></div><p>Compatible flashers:</p><ul><li><a href="https://github.com/qmk/qmk_toolbox/releases" target="_blank" rel="noreferrer">QMK Toolbox</a> (recommended GUI)</li><li><a href="https://github.com/dfu-programmer/dfu-programmer" target="_blank" rel="noreferrer">dfu-programmer</a> / <code>:dfu</code> target in QMK (recommended command line)<div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>dfu-programmer &lt;mcu&gt; erase --force</span></span>\n<span class="line"><span>dfu-programmer &lt;mcu&gt; flash --force &lt;filename&gt;</span></span>\n<span class="line"><span>dfu-programmer &lt;mcu&gt; reset</span></span></code></pre></div></li></ul><p>Flashing sequence:</p><ol><li>Enter the bootloader using any of the following methods: <ul><li>Press the <code>QK_BOOT</code> keycode</li><li>Press the <code>RESET</code> button on the PCB if available</li><li>Short RST to GND quickly</li></ul></li><li>Wait for the OS to detect the device</li><li>Erase the flash memory (will be done automatically if using the Toolbox or CLI/<code>make</code> command)</li><li>Flash a .hex file</li><li>Reset the device into application mode (will be done automatically as above)</li></ol><h3 id="qmk-dfu" tabindex="-1">QMK DFU <a class="header-anchor" href="#qmk-dfu" aria-label="Permalink
const _hoisted_144 = [
_hoisted_1
];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", null, _hoisted_144);
}
const flashing = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
__pageData,
flashing as default
};