aboutsummaryrefslogtreecommitdiff
path: root/docs/newbs_flashing.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/newbs_flashing.md')
-rw-r--r--docs/newbs_flashing.md105
1 files changed, 62 insertions, 43 deletions
diff --git a/docs/newbs_flashing.md b/docs/newbs_flashing.md
index 9c76f5592..428e698e2 100644
--- a/docs/newbs_flashing.md
+++ b/docs/newbs_flashing.md
@@ -86,7 +86,23 @@ Click the `Flash` button in QMK Toolbox. You will see output similar to the foll
86 86
87## Flash your Keyboard from the Command Line 87## Flash your Keyboard from the Command Line
88 88
89First thing you'll need to know is which bootloader that your keyboard uses. There are four main bootloaders that are used, usually. Pro-Micro and clones use CATERINA, and Teensy's use Halfkay, OLKB boards use QMK-DFU, and other atmega32u4 chips use DFU. 89This 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 build command:
90
91 make <my_keyboard>:<my_keymap>:flash
92
93For example, if your keymap is named "xyverz" and you're building a keymap for a rev5 planck, you'll use this command:
94
95 make planck/rev5:xyverz:flash
96
97This 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.
98
99However, 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:
100
101 WARNING: This board's bootloader is not specified or is not supported by the ":flash" target at this time.
102
103In this case, you'll have to fall back on specifying the bootloader.
104
105There are five main bootloaders that are used. Pro Micro and clones use Caterina, Teensys use HalfKay, OLKB's AVR boards use QMK-DFU, other ATmega32U4 boards use DFU, and most ARM boards use ARM DFU.
90 106
91You can find more information about the bootloaders in the [Flashing Instructions and Bootloader Information](flashing.md) page. 107You can find more information about the bootloaders in the [Flashing Instructions and Bootloader Information](flashing.md) page.
92 108
@@ -216,11 +232,14 @@ If you have any issues with this, you may need to this:
216 sudo make <my_keyboard>:<my_keymap>:avrdude 232 sudo make <my_keyboard>:<my_keymap>:avrdude
217 233
218 234
219Additionally, if you want to flash multiple boards, use the following command: 235#### Caterina commands
220 236
221 make <keyboard>:<keymap>:avrdude-loop 237There are a number of DFU commands that you can use to flash firmware to a DFU device:
222 238
223When you're done flashing boards, you'll need to hit Ctrl + C or whatever the correct keystroke is for your operating system to break the loop. 239* `:avrdude` - This is the normal option which waits until a Caterina device is available (by detecting a new COM port), and then flashes the firmware.
240* `:avrdude-loop` - This runs the same command as `:avrdude`, but after each device is flashed, it will attempt to flash again. This is useful for bulk flashing. _This requires you to manually escape the loop by hitting Control+C._
241* `:avrdude-split-left` - This flashes the normal firmware, just like the default option (`:avrdude`). However, this also flashes the "Left Side" EEPROM file for split keyboards. _This is ideal for Pro Micro based split keyboards._
242* `:avrdude-split-right` - This flashes the normal firmware, just like the default option (`:avrdude`). However, this also flashes the "Right Side" EEPROM file for split keyboards. _This is ideal for Pro Micro based split keyboards._
224 243
225 244
226### HalfKay 245### HalfKay
@@ -256,42 +275,6 @@ Programming.....................................................................
256Booting 275Booting
257``` 276```
258 277
259### BootloadHID
260
261For Bootmapper Client(BMC)/bootloadHID/ATmega32A based boards, when you're ready to compile and flash your firmware, open up your terminal window and run the build command:
262
263 make <my_keyboard>:<my_keymap>:bootloaderHID
264
265For example, if your keymap is named "xyverz" and you're building a keymap for a jj40, you'll use this command:
266
267 make jj40:xyverz:bootloaderHID
268
269Once the firmware finishes compiling, it will output something like this:
270
271```
272Linking: .build/jj40_default.elf [OK]
273Creating load file for flashing: .build/jj40_default.hex [OK]
274Copying jj40_default.hex to qmk_firmware folder [OK]
275Checking file size of jj40_default.hex [OK]
276 * The firmware size is fine - 21920/28672 (6752 bytes free)
277```
278
279After it gets to this point, the build script will look for the DFU bootloader every 5 seconds. It will repeat the following until the device is found or you cancel it.
280
281```
282Error opening HIDBoot device: The specified device was not found
283Trying again in 5s.
284```
285
286Once it does this, you'll want to reset the controller. It should then show output similar to this:
287
288```
289Page size = 128 (0x80)
290Device size = 32768 (0x8000); 30720 bytes remaining
291Uploading 22016 (0x5600) bytes starting at 0 (0x0)
2920x05580 ... 0x05600
293```
294
295### STM32 (ARM) 278### STM32 (ARM)
296 279
297For a majority of ARM boards (including the Proton C, Planck Rev 6, and Preonic Rev 3), when you're ready to compile and flash your firmware, open up your terminal window and run the build command: 280For a majority of ARM boards (including the Proton C, Planck Rev 6, and Preonic Rev 3), when you're ready to compile and flash your firmware, open up your terminal window and run the build command:
@@ -346,11 +329,47 @@ Transitioning to dfuMANIFEST state
346 329
347There are a number of DFU commands that you can use to flash firmware to a STM32 device: 330There are a number of DFU commands that you can use to flash firmware to a STM32 device:
348 331
349* `:dfu-util` - The default command for flashing to STM32 devices. 332* `:dfu-util` - The default command for flashing to STM32 devices, and will wait until an STM32 bootloader is present. .
350* `:dfu-util-wait` - This works like the default command, but it gives you a (configurable) 10 second timeout before it attempts to flash the firmware. You can use `TIME_DELAY=20` from the command line to change the timeout.
351 * Eg: `make <keyboard>:<keymap>:dfu-util TIME_DELAY=5`
352* `:dfu-util-split-left` - This flashes the normal firmware, just like the default option (`:dfu-util`). However, this also configures the "Left Side" EEPROM setting for split keyboards. 333* `:dfu-util-split-left` - This flashes the normal firmware, just like the default option (`:dfu-util`). However, this also configures the "Left Side" EEPROM setting for split keyboards.
353* `:dfu-util-split-right` - This flashes the normal firmware, just like the default option (`:dfu-util`). However, this also configures the "Right Side" EEPROM setting for split keyboards. 334* `:dfu-util-split-right` - This flashes the normal firmware, just like the default option (`:dfu-util`). However, this also configures the "Right Side" EEPROM setting for split keyboards.
335* `:st-link-cli` - This allows you to flash the firmware via ST-LINK's CLI utility, rather than dfu-util.
336
337
338### BootloadHID
339
340For Bootmapper Client(BMC)/bootloadHID/ATmega32A based boards, when you're ready to compile and flash your firmware, open up your terminal window and run the build command:
341
342 make <my_keyboard>:<my_keymap>:bootloaderHID
343
344For example, if your keymap is named "xyverz" and you're building a keymap for a jj40, you'll use this command:
345
346 make jj40:xyverz:bootloaderHID
347
348Once the firmware finishes compiling, it will output something like this:
349
350```
351Linking: .build/jj40_default.elf [OK]
352Creating load file for flashing: .build/jj40_default.hex [OK]
353Copying jj40_default.hex to qmk_firmware folder [OK]
354Checking file size of jj40_default.hex [OK]
355 * The firmware size is fine - 21920/28672 (6752 bytes free)
356```
357
358After it gets to this point, the build script will look for the DFU bootloader every 5 seconds. It will repeat the following until the device is found or you cancel it.
359
360```
361Error opening HIDBoot device: The specified device was not found
362Trying again in 5s.
363```
364
365Once it does this, you'll want to reset the controller. It should then show output similar to this:
366
367```
368Page size = 128 (0x80)
369Device size = 32768 (0x8000); 30720 bytes remaining
370Uploading 22016 (0x5600) bytes starting at 0 (0x0)
3710x05580 ... 0x05600
372```
354 373
355## Test It Out! 374## Test It Out!
356 375