aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/flashing.md30
-rw-r--r--docs/flashing_bootloadhid.md70
-rw-r--r--docs/getting_started_make_guide.md2
-rw-r--r--docs/newbs_flashing.md36
-rw-r--r--quantum/template/ps2avrgb/readme.md35
-rw-r--r--tmk_core/avr.mk15
6 files changed, 157 insertions, 31 deletions
diff --git a/docs/flashing.md b/docs/flashing.md
index d11dbdf15..b47a5ebf8 100644
--- a/docs/flashing.md
+++ b/docs/flashing.md
@@ -144,6 +144,36 @@ Flashing sequence:
1443. Flash a .hex file 1443. Flash a .hex file
1454. Reset the device into application mode (may be done automatically) 1454. Reset the device into application mode (may be done automatically)
146 146
147## BootloadHID
148
149BootloadHID is a USB bootloader for AVR microcontrollers. The uploader tool requires no kernel level driver on Windows and can therefore be run without installing any DLLs.
150
151To ensure compatibility with the bootloadHID bootloader, make sure this block is present your `rules.mk`:
152
153 # Bootloader
154 # This definition is optional, and if your keyboard supports multiple bootloaders of
155 # different sizes, comment this out, and the correct address will be loaded
156 # automatically (+60). See bootloader.mk for all options.
157 BOOTLOADER = bootloadHID
158
159Compatible flashers:
160
161* [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash) (recommended Windows GUI)
162* [bootloadhid Command Line](https://www.obdev.at/products/vusb/bootloadhid.html) / `:BootloadHID` in QMK (recommended command line)
163
164Flashing sequence:
165
1661. Enter the bootloader using any of the following methods:
167 * Tap the `RESET` keycode (may not work on all devices)
168 * Hold the salt key while plugging the keyboard in (usually documented within keyboard readme)
1692. Wait for the OS to detect the device
1703. Flash a .hex file
1714. Reset the device into application mode (may be done automatically)
172
173or:
174
175 make <keyboard>:<keymap>:bootloadHID
176
147## STM32 177## STM32
148 178
149All STM32 chips come preloaded with a factory bootloader that cannot be modified nor deleted. Some STM32 chips have bootloaders that do not come with USB programming (e.g. STM32F103) but the process is still the same. 179All STM32 chips come preloaded with a factory bootloader that cannot be modified nor deleted. Some STM32 chips have bootloaders that do not come with USB programming (e.g. STM32F103) but the process is still the same.
diff --git a/docs/flashing_bootloadhid.md b/docs/flashing_bootloadhid.md
new file mode 100644
index 000000000..c51d8ce4b
--- /dev/null
+++ b/docs/flashing_bootloadhid.md
@@ -0,0 +1,70 @@
1# BootloadHID Flashing Instructions and Bootloader Information
2
3ps2avr(GB) boards use an ATmega32A microcontroller and a different bootloader. It is not flashable using the regular QMK methods.
4
5General flashing sequence:
6
71. Enter the bootloader using any of the following methods:
8 * Tap the `RESET` keycode (may not work on all devices)
9 * Hold the salt key while plugging the keyboard in (usually documented within keyboard readme)
102. Wait for the OS to detect the device
113. Flash a .hex file
124. Reset the device into application mode (may be done automatically)
13
14## bootloadHID Flashing Target
15
16Using the QMK installation script, detailed [here](newbs_getting_started.md), the required bootloadHID tools should be automatically installed.
17
18To flash via the command line, use the target `:bootloadHID` by executing the following command:
19
20 make <keyboard>:<keymap>:bootloadHID
21
22## GUI Flashing
23
24### Windows
251. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash).
262. Place your keyboard into reset.
273. Ensure the configured VendorID is `16c0` and ProductID is `05df`
284. Press the `Find Device` button and ensure that your keyboard is found.
295. Press the `Open .hex File` button and locate the `.hex` file you created.
306. Press the `Flash Device` button and wait for the process to complete.
31
32## Command Line Flashing
33
341. Place your keyboard into reset.
352. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file.
36
37### Windows Manual Installation
38For MSYS2:
391. Download the BootloadHID firmware package from https://www.obdev.at/downloads/vusb/bootloadHID.2012-12-08.tar.gz.
402. Extract contents using a compatible tool, for example 7-Zip.
413. Add to the MSYS path by copying `commandline/bootloadHID.exe` from the extracted archive to your MSYS2 installation, typically `C:\msys64\usr\bin`.
42
43For native Windows flashing, the `bootloadHID.exe` can be used outside of the MSYS2 environment.
44
45### Linux Manual Installation
461. Install libusb development dependency:
47 ```bash
48 # This depends on OS - for Debian the following works
49 sudo apt-get install libusb-dev
50 ```
512. Download the BootloadHID firmware package:
52 ```
53 wget https://www.obdev.at/downloads/vusb/bootloadHID.2012-12-08.tar.gz -O - | tar -xz -C /tmp
54 ```
553. Build the bootloadHID executable:
56 ```
57 cd /tmp/bootloadHID.2012-12-08/commandline/
58 make
59 sudo cp bootloadHID /usr/local/bin
60 ```
61
62### MacOS Manual Installation
631. Install Homebrew by typing the following:
64 ```
65 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
66 ```
672. Install the following packages:
68 ```
69 brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
70 ```
diff --git a/docs/getting_started_make_guide.md b/docs/getting_started_make_guide.md
index 4fe3f184d..71e9d33f2 100644
--- a/docs/getting_started_make_guide.md
+++ b/docs/getting_started_make_guide.md
@@ -14,7 +14,7 @@ The full syntax of the `make` command is `<keyboard_folder>:<keymap>:<target>`,
14The `<target>` means the following 14The `<target>` means the following
15* If no target is given, then it's the same as `all` below 15* If no target is given, then it's the same as `all` below
16* `all` compiles as many keyboard/revision/keymap combinations as specified. For example, `make planck/rev4:default` will generate a single .hex, while `make planck/rev4:all` will generate a hex for every keymap available to the planck. 16* `all` compiles as many keyboard/revision/keymap combinations as specified. For example, `make planck/rev4:default` will generate a single .hex, while `make planck/rev4:all` will generate a hex for every keymap available to the planck.
17* `dfu`, `teensy`, `avrdude` or `dfu-util`, compile and upload the firmware to the keyboard. If the compilation fails, then nothing will be uploaded. The programmer to use depends on the keyboard. For most keyboards it's `dfu`, but for ChibiOS keyboards you should use `dfu-util`, and `teensy` for standard Teensys. To find out which command you should use for your keyboard, check the keyboard specific readme. 17* `dfu`, `teensy`, `avrdude`, `dfu-util` or `bootloadHID`, compile and upload the firmware to the keyboard. If the compilation fails, then nothing will be uploaded. The programmer to use depends on the keyboard. For most keyboards it's `dfu`, but for ChibiOS keyboards you should use `dfu-util`, and `teensy` for standard Teensys. To find out which command you should use for your keyboard, check the keyboard specific readme.
18 * **Note**: some operating systems need root access for these commands to work, so in that case you need to run for example `sudo make planck/rev4:default:dfu`. 18 * **Note**: some operating systems need root access for these commands to work, so in that case you need to run for example `sudo make planck/rev4:default:dfu`.
19* `clean`, cleans the build output folders to make sure that everything is built from scratch. Run this before normal compilation if you have some unexplainable problems. 19* `clean`, cleans the build output folders to make sure that everything is built from scratch. Run this before normal compilation if you have some unexplainable problems.
20 20
diff --git a/docs/newbs_flashing.md b/docs/newbs_flashing.md
index c8a30dba0..3bf582d7f 100644
--- a/docs/newbs_flashing.md
+++ b/docs/newbs_flashing.md
@@ -248,6 +248,42 @@ Programming.....................................................................
248Booting 248Booting
249``` 249```
250 250
251## BootloadHID
252
253For 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:
254
255 make <my_keyboard>:<my_keymap>:bootloaderHID
256
257For example, if your keymap is named "xyverz" and you're building a keymap for a jj40, you'll use this command:
258
259 make jj40:xyverz:bootloaderHID
260
261Once the firmware finishes compiling, it will output something like this:
262
263```
264Linking: .build/jj40_default.elf [OK]
265Creating load file for flashing: .build/jj40_default.hex [OK]
266Copying jj40_default.hex to qmk_firmware folder [OK]
267Checking file size of jj40_default.hex [OK]
268 * The firmware size is fine - 21920/28672 (6752 bytes free)
269```
270
271After 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.
272
273```
274Error opening HIDBoot device: The specified device was not found
275Trying again in 5s.
276```
277
278Once it does this, you'll want to reset the controller. It should then show output similar to this:
279
280```
281Page size = 128 (0x80)
282Device size = 32768 (0x8000); 30720 bytes remaining
283Uploading 22016 (0x5600) bytes starting at 0 (0x0)
2840x05580 ... 0x05600
285```
286
251## STM32 (ARM) 287## STM32 (ARM)
252 288
253For 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: 289For 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:
diff --git a/quantum/template/ps2avrgb/readme.md b/quantum/template/ps2avrgb/readme.md
index 1449b278c..9d3ca0006 100644
--- a/quantum/template/ps2avrgb/readme.md
+++ b/quantum/template/ps2avrgb/readme.md
@@ -12,35 +12,10 @@ Make example for this keyboard (after setting up your build environment):
12 12
13 make %KEYBOARD%:default 13 make %KEYBOARD%:default
14 14
15Flashing 15Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](flashing_bootloadhid.md))
16 16
17ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. 17 make %KEYBOARD%:default:flash
18 18
19**Reset Key:** Hold down the key located at `K00`, commonly programmed as `Esc` while plugging in the keyboard. 19**Reset Key**: Hold down the key located at *LOCATION*, commonly programmed as *KEY* while plugging in the keyboard.
20
21Windows:
221. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash).
232. Place your keyboard into reset.
243. Press the `Find Device` button and ensure that your keyboard is found.
254. Press the `Open .hex File` button and locate the `.hex` file you created.
265. Press the `Flash Device` button and wait for the process to complete.
27
28macOS:
291. Install homebrew by typing the following:
30 ```
31 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
32 ```
332. Install `crosspack-avr`.
34 ```
35 brew cask install crosspack-avr
36 ```
373. Install the following packages:
38 ```
39 brew install python3
40 pip3 install pyusb
41 brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
42 ```
434. Place your keyboard into reset.
445. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file.
45 20
46See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). 21See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk
index e5443418b..bdda14a07 100644
--- a/tmk_core/avr.mk
+++ b/tmk_core/avr.mk
@@ -246,6 +246,19 @@ endef
246usbasp: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware 246usbasp: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware
247 $(call EXEC_USBASP) 247 $(call EXEC_USBASP)
248 248
249BOOTLOADHID_PROGRAMMER ?= bootloadHID
250
251define EXEC_BOOTLOADHID
252 # bootloadHid executable has no cross platform detect methods
253 # so keep running bootloadHid if the output contains "The specified device was not found"
254 until $(BOOTLOADHID_PROGRAMMER) -r $(BUILD_DIR)/$(TARGET).hex 2>&1 | tee /dev/stderr | grep -v "device was not found"; do\
255 echo "Error: Bootloader not found. Trying again in 5s." ;\
256 sleep 5 ;\
257 done
258endef
259
260bootloadHID: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware
261 $(call EXEC_BOOTLOADHID)
249 262
250# Convert hex to bin. 263# Convert hex to bin.
251bin: $(BUILD_DIR)/$(TARGET).hex 264bin: $(BUILD_DIR)/$(TARGET).hex
@@ -331,6 +344,8 @@ else ifeq (dfu,$(findstring dfu,$(BOOTLOADER)))
331 $(call EXEC_DFU) 344 $(call EXEC_DFU)
332else ifeq ($(strip $(BOOTLOADER)), USBasp) 345else ifeq ($(strip $(BOOTLOADER)), USBasp)
333 $(call EXEC_USBASP) 346 $(call EXEC_USBASP)
347else ifeq ($(strip $(BOOTLOADER)), bootloadHID)
348 $(call EXEC_BOOTLOADHID)
334else 349else
335 $(PRINT_OK); $(SILENT) || printf "&(MSG_FLASH_BOOTLOADER)" 350 $(PRINT_OK); $(SILENT) || printf "&(MSG_FLASH_BOOTLOADER)"
336endif 351endif