aboutsummaryrefslogtreecommitdiff
path: root/docs/newbs_flashing.md
diff options
context:
space:
mode:
authorAkshay <[email protected]>2022-04-10 12:13:40 +0100
committerAkshay <[email protected]>2022-04-10 12:13:40 +0100
commitdc90387ce7d8ba7b607d9c48540bf6d8b560f14d (patch)
tree4ccb8fa5886b66fa9d480edef74236c27f035e16 /docs/newbs_flashing.md
Diffstat (limited to 'docs/newbs_flashing.md')
-rw-r--r--docs/newbs_flashing.md118
1 files changed, 118 insertions, 0 deletions
diff --git a/docs/newbs_flashing.md b/docs/newbs_flashing.md
new file mode 100644
index 000000000..6e90af9d1
--- /dev/null
+++ b/docs/newbs_flashing.md
@@ -0,0 +1,118 @@
1# Flashing Your Keyboard
2
3Now that you've built a custom firmware file you'll want to flash your keyboard.
4
5## Put Your Keyboard into DFU (Bootloader) Mode
6
7In 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.
8
9Different 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:
10
11* Hold down both shift keys and press `Pause`
12* Hold down both shift keys and press `B`
13* Unplug your keyboard, hold down the Spacebar and `B` at the same time, plug in your keyboard and wait a second before releasing the keys
14* Unplug your keyboard, hold down the top or bottom left key (usually Escape or Left Control) and plug in your keyboard
15* Press the physical `RESET` button, usually located on the underside of the PCB
16* Locate header pins on the PCB labeled `RESET` and `GND`, and short them together while plugging your PCB in
17
18If you've attempted all of the above to no avail, and the main chip on the board says `STM32` on it, this may be a bit more complicated. Generally your best bet is to ask on [Discord](https://discord.gg/Uq7gcHh) for assistance. It's likely some photos of the board will be asked for -- if you can get them ready beforehand it'll help move things along!
19
20Otherwise, you should see a message in yellow, similar to this in QMK Toolbox:
21
22```
23*** DFU device connected: Atmel Corp. ATmega32U4 (03EB:2FF4:0000)
24```
25
26and this bootloader device will also be present in Device Manager, System Information.app, or `lsusb`.
27
28## Flashing Your Keyboard with QMK Toolbox
29
30The simplest way to flash your keyboard will be with the [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases).
31
32However, the Toolbox is currently only available for Windows and macOS. If you're using Linux (or just wish to flash the firmware from the command line), skip to the [Flash your Keyboard from the Command Line](#flash-your-keyboard-from-the-command-line) section.
33
34### Load the File into QMK Toolbox
35
36Begin by opening the QMK Toolbox application. You'll want to locate the firmware file in Finder or Explorer. Your keyboard firmware may be in one of two formats- `.hex` or `.bin`. QMK tries to copy the appropriate one for your keyboard into the root `qmk_firmware` directory.
37
38If you are on Windows or macOS, there are commands you can use to easily open the current folder in Explorer or Finder.
39
40<!-- tabs:start -->
41
42#### ** Windows **
43
44```
45start .
46```
47
48#### ** macOS **
49
50```
51open .
52```
53
54<!-- tabs:end -->
55
56The firmware file always follows this naming format:
57
58```
59<keyboard_name>_<keymap_name>.{bin,hex}
60```
61
62For example, the `planck/rev5` with a `default` keymap will have this filename:
63
64```
65planck_rev5_default.hex
66```
67
68Once you have located your firmware file, drag it into the "Local file" box in QMK Toolbox, or click "Open" and navigate to where your firmware file is stored.
69
70### Flash Your Keyboard
71
72Click the `Flash` button in QMK Toolbox. You will see output similar to the following:
73
74```
75*** DFU device connected: Atmel Corp. ATmega32U4 (03EB:2FF4:0000)
76*** Attempting to flash, please don't remove device
77>>> dfu-programmer.exe atmega32u4 erase --force
78 Erasing flash... Success
79 Checking memory from 0x0 to 0x6FFF... Empty.
80>>> dfu-programmer.exe atmega32u4 flash "D:\Git\qmk_firmware\gh60_satan_default.hex"
81 Checking memory from 0x0 to 0x3F7F... Empty.
82 0% 100% Programming 0x3F80 bytes...
83 [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
84 0% 100% Reading 0x7000 bytes...
85 [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
86 Validating... Success
87 0x3F80 bytes written into 0x7000 bytes memory (56.70%).
88>>> dfu-programmer.exe atmega32u4 reset
89
90*** DFU device disconnected: Atmel Corp: ATmega32U4 (03EB:2FF4:0000)
91```
92
93## Flash your Keyboard from the Command Line
94
95This 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:
96
97 qmk flash
98
99If you did not configure your keyboard/keymap name in the CLI according to the [Configure your build environment](newbs_getting_started.md) section, or you have multiple keyboards, you can specify the keyboard and keymap:
100
101 qmk flash -kb <my_keyboard> -km <my_keymap>
102
103This will check the keyboard's configuration, and then attempt to flash it based on the specified bootloader. This means that you don't need to know which bootloader that your keyboard uses. Just run the command, and let the command do the heavy lifting.
104
105However, this does rely on the bootloader being set by the keyboard. If this information is not configured, or you're using a board that doesn't have a supported target to flash it, you will see this error:
106
107 WARNING: This board's bootloader is not specified or is not supported by the ":flash" target at this time.
108
109In this case, you'll have to fall back on specifying the bootloader. See the [Flashing Firmware](flashing.md) Guide for more details.
110
111## Test It Out!
112
113Congrats! Your custom firmware has been programmed to your keyboard and you're ready to test it out!
114
115With a little bit of luck everything will work perfectly, but if not there are steps that will help you figure out what's wrong.
116Testing your keyboard is usually pretty straightforward. Press every single key and make sure it sends the keys you expect. You can use [QMK Configurator](https://config.qmk.fm/#/test/)'s test mode to check your keyboard, even if it doesn't run QMK.
117
118Still not working? Browse the FAQ topics for more information, or [chat with us on Discord](https://discord.gg/Uq7gcHh).