qmk_firmware/assets/newbs_flashing.md.u-7lrNOy.js

64 lines
14 KiB
JavaScript
Raw Normal View History

import { _ as _export_sfc, D as resolveComponent, c as createElementBlock, I as createVNode, w as withCtx, a8 as createStaticVNode, o as openBlock, l as createBaseVNode } from "./chunks/framework.DyMmIvSC.js";
const __pageData = JSON.parse('{"title":"Flashing Your Keyboard","description":"","frontmatter":{},"headers":[],"relativePath":"newbs_flashing.md","filePath":"newbs_flashing.md"}');
const _sfc_main = { name: "newbs_flashing.md" };
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="flashing-your-keyboard" tabindex="-1">Flashing Your Keyboard <a class="header-anchor" href="#flashing-your-keyboard" aria-label="Permalink to &quot;Flashing Your Keyboard&quot;"></a></h1><p>Now that you&#39;ve built a custom firmware file you&#39;ll want to flash your keyboard.</p><h2 id="put-your-keyboard-into-dfu-bootloader-mode" tabindex="-1">Put Your Keyboard into DFU (Bootloader) Mode <a class="header-anchor" href="#put-your-keyboard-into-dfu-bootloader-mode" aria-label="Permalink to &quot;Put Your Keyboard into DFU (Bootloader) Mode&quot;"></a></h2><p>In order to flash your custom firmware you must first put your keyboard into a special flashing mode. While it is in this mode you will not be able to type or otherwise use your keyboard. It is very important that you do not unplug the keyboard or otherwise interrupt the flashing process while the firmware is being written.</p><p>Different keyboards have different ways to enter this special mode. If your PCB currently runs QMK, TMK, or PS2AVRGB (Bootmapper Client) and you have not been given specific instructions, try the following, in order:</p><ul><li>Hold down both shift keys and press <code>Pause</code></li><li>Hold down both shift keys and press <code>B</code></li><li>Unplug your keyboard, hold down the Spacebar and <code>B</code> at the same time, plug in your keyboard and wait a second before releasing the keys</li><li>Unplug your keyboard, hold down the top or bottom left key (usually Escape or Left Control) and plug in your keyboard</li><li>Press the physical <code>RESET</code> button, usually located on the underside of the PCB</li><li>Locate header pins on the PCB labeled <code>RESET</code> and <code>GND</code>, and short them together while plugging your PCB in</li></ul><p>If you&#39;ve attempted all of the above to no avail, and the main chip on the board says <code>STM32</code> or <code>RP2-B1</code> on it, this may be a bit more complicated. Generally your best bet is to ask on <a href="https://discord.gg/qmk" target="_blank" rel="noreferrer">Discord</a> for assistance. It&#39;s likely some photos of the board will be asked for -- if you can get them ready beforehand it&#39;ll help move things along!</p><p>Otherwise, you should see a message in yellow, similar to this in QMK Toolbox:</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>*** DFU device connected: Atmel Corp. ATmega32U4 (03EB:2FF4:0000)</span></span></code></pre></div><p>and this bootloader device will also be present in Device Manager, System Information.app, or <code>lsusb</code>.</p><h2 id="flashing-your-keyboard-with-qmk-toolbox" tabindex="-1">Flashing Your Keyboard with QMK Toolbox <a class="header-anchor" href="#flashing-your-keyboard-with-qmk-toolbox" aria-label="Permalink to &quot;Flashing Your Keyboard with QMK Toolbox&quot;"></a></h2><p>The simplest way to flash your keyboard will be with the <a href="https://github.com/qmk/qmk_toolbox/releases" target="_blank" rel="noreferrer">QMK Toolbox</a>.</p><p>However, the Toolbox is currently only available for Windows and macOS. If you&#39;re using Linux (or just wish to flash the firmware from the command line), skip to the <a href="#flash-your-keyboard-from-the-command-line">Flash your Keyboard from the Command Line</a> section.</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>QMK Toolbox is not necessary for flashing <a href="./flashing#raspberry-pi-rp2040-uf2">RP2040 devices</a>.</p></div><h3 id="load-the-file-into-qmk-toolbox" tabindex="-1">Load the File into QMK Toolbox <a class="header-anchor" href="#load-the-file-into-qmk-toolbox" aria-label="Permalink to &quot;Load the File into QMK Toolbox&quot;"></a></h3><p>Begin by opening the QMK Toolbox application. You&#39;ll want to locate the firmware file in Finder or Explorer. Your keyboard firmware may be in one of two formats- <
const _hoisted_18 = /* @__PURE__ */ createBaseVNode("div", { class: "language- vp-adaptive-theme" }, [
/* @__PURE__ */ createBaseVNode("button", {
title: "Copy Code",
class: "copy"
}),
/* @__PURE__ */ createBaseVNode("span", { class: "lang" }),
/* @__PURE__ */ createBaseVNode("pre", { class: "shiki shiki-themes github-light github-dark vp-code" }, [
/* @__PURE__ */ createBaseVNode("code", null, [
/* @__PURE__ */ createBaseVNode("span", { class: "line" }, [
/* @__PURE__ */ createBaseVNode("span", null, "start .")
])
])
])
], -1);
const _hoisted_19 = /* @__PURE__ */ createBaseVNode("div", { class: "language- vp-adaptive-theme" }, [
/* @__PURE__ */ createBaseVNode("button", {
title: "Copy Code",
class: "copy"
}),
/* @__PURE__ */ createBaseVNode("span", { class: "lang" }),
/* @__PURE__ */ createBaseVNode("pre", { class: "shiki shiki-themes github-light github-dark vp-code" }, [
/* @__PURE__ */ createBaseVNode("code", null, [
/* @__PURE__ */ createBaseVNode("span", { class: "line" }, [
/* @__PURE__ */ createBaseVNode("span", null, "open .")
])
])
])
], -1);
const _hoisted_20 = /* @__PURE__ */ createStaticVNode('<p>The firmware file always follows this naming format:</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>&lt;keyboard_name&gt;_&lt;keymap_name&gt;.{bin,hex}</span></span></code></pre></div><p>For example, the <code>planck/rev5</code> with a <code>default</code> keymap will have this filename:</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>planck_rev5_default.hex</span></span></code></pre></div><p>Once you have located your firmware file, drag it into the &quot;Local file&quot; box in QMK Toolbox, or click &quot;Open&quot; and navigate to where your firmware file is stored.</p><h3 id="flash-your-keyboard" tabindex="-1">Flash Your Keyboard <a class="header-anchor" href="#flash-your-keyboard" aria-label="Permalink to &quot;Flash Your Keyboard&quot;"></a></h3><p>Click the <code>Flash</code> button in QMK Toolbox. You will see output similar to the following:</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>*** DFU device connected: Atmel Corp. ATmega32U4 (03EB:2FF4:0000)</span></span>\n<span class="line"><span>*** Attempting to flash, please don&#39;t remove device</span></span>\n<span class="line"><span>&gt;&gt;&gt; dfu-programmer.exe atmega32u4 erase --force</span></span>\n<span class="line"><span> Erasing flash... Success</span></span>\n<span class="line"><span> Checking memory from 0x0 to 0x6FFF... Empty.</span></span>\n<span class="line"><span>&gt;&gt;&gt; dfu-programmer.exe atmega32u4 flash &quot;D:\\Git\\qmk_firmware\\gh60_satan_default.hex&quot;</span></span>\n<span class="line"><span> Checking memory from 0x0 to 0x3F7F... Empty.</span></span>\n<span class="line"><span> 0% 100% Programming 0x3F80 bytes...</span></span>\n<span class="line"><span> [&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;] Success</span></span>\n<span class="line"><span> 0% 100% Reading 0x7000 bytes...</span></span>\n<span class="line"><span> [&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;] Success</span></span>\n<span class="line"><span> Validating... Success</span></span>\n<span class="line"><span> 0x3F80 bytes written into 0x7000 bytes memory (56.70%).</span></span>\n<span class="line"><span>&gt;&gt;&gt; dfu-programmer.exe atmega32u4 reset</span></span>\n<span class="line"><span> </span></span>\n<span class="line"><span>*** DFU device disconnected: Atmel Corp: ATmega32U4 (03EB:2FF4:0000)</span></span></code></pre></div><h2 id="flash-your-keyboard-from-the-command-line" tabindex="-1">Flash your Keyboard from the Command Line <a class="header-anchor" href="#flash-your-keyboard-from-the-command-line" aria-label="Permalink to &quot;Flash your Keyboard from the Command Line&quot;"></a></h2><p>This has been made pretty simple compared to what it used to be. When you are ready to compile and flash your firmware, open up your terminal window and run the flash command:</p><div class="language-sh vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">qmk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> flash</span></span></code></pre></div><p>If you did not configure your keyboard/keymap name in the CLI according to the <a href="./newbs_getting_started">
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_PluginTabsTab = resolveComponent("PluginTabsTab");
const _component_PluginTabs = resolveComponent("PluginTabs");
return openBlock(), createElementBlock("div", null, [
_hoisted_1,
createVNode(_component_PluginTabs, null, {
default: withCtx(() => [
createVNode(_component_PluginTabsTab, { label: "Windows" }, {
default: withCtx(() => [
_hoisted_18
]),
_: 1
}),
createVNode(_component_PluginTabsTab, { label: "macOS" }, {
default: withCtx(() => [
_hoisted_19
]),
_: 1
})
]),
_: 1
}),
_hoisted_20
]);
}
const newbs_flashing = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
__pageData,
newbs_flashing as default
};