Add 'bootloadHID' flash target (#5587)
* Add 'bootloadHID' flash target * Prep for flash target * Add :flash support * Align bootloader wait messages Co-Authored-By: Drashna Jaelre <drashna@live.com> * Update template to suggest use of :flash
This commit is contained in:
committed by
Florian Didron
parent
d4a6178b89
commit
4040654edf
@@ -12,33 +12,10 @@ Make example for this keyboard (after setting up your build environment):
|
|||||||
|
|
||||||
make %KEYBOARD%:default
|
make %KEYBOARD%:default
|
||||||
|
|
||||||
Flashing
|
Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](flashing_bootloadhid.md))
|
||||||
|
|
||||||
ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods.
|
make %KEYBOARD%:default:flash
|
||||||
|
|
||||||
Windows:
|
**Reset Key**: Hold down the key located at *LOCATION*, commonly programmed as *KEY* while plugging in the keyboard.
|
||||||
1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash).
|
|
||||||
2. Place your keyboard into reset.
|
|
||||||
3. Press the `Find Device` button and ensure that your keyboard is found.
|
|
||||||
4. Press the `Open .hex File` button and locate the `.hex` file you created.
|
|
||||||
5. Press the `Flash Device` button and wait for the process to complete.
|
|
||||||
|
|
||||||
macOS:
|
|
||||||
1. Install homebrew by typing the following:
|
|
||||||
```
|
|
||||||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
|
||||||
```
|
|
||||||
2. Install `crosspack-avr`.
|
|
||||||
```
|
|
||||||
brew cask install crosspack-avr
|
|
||||||
```
|
|
||||||
3. Install the following packages:
|
|
||||||
```
|
|
||||||
brew install python
|
|
||||||
brew install pyusb
|
|
||||||
brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
|
|
||||||
|
|
||||||
4. Place your keyboard into reset.
|
|
||||||
5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file.
|
|
||||||
|
|
||||||
See 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).
|
See 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).
|
||||||
|
|||||||
@@ -246,6 +246,19 @@ endef
|
|||||||
usbasp: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware
|
usbasp: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware
|
||||||
$(call EXEC_USBASP)
|
$(call EXEC_USBASP)
|
||||||
|
|
||||||
|
BOOTLOADHID_PROGRAMMER ?= bootloadHID
|
||||||
|
|
||||||
|
define EXEC_BOOTLOADHID
|
||||||
|
# bootloadHid executable has no cross platform detect methods
|
||||||
|
# so keep running bootloadHid if the output contains "The specified device was not found"
|
||||||
|
until $(BOOTLOADHID_PROGRAMMER) -r $(BUILD_DIR)/$(TARGET).hex 2>&1 | tee /dev/stderr | grep -v "device was not found"; do\
|
||||||
|
echo "Error: Bootloader not found. Trying again in 5s." ;\
|
||||||
|
sleep 5 ;\
|
||||||
|
done
|
||||||
|
endef
|
||||||
|
|
||||||
|
bootloadHID: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware
|
||||||
|
$(call EXEC_BOOTLOADHID)
|
||||||
|
|
||||||
# Convert hex to bin.
|
# Convert hex to bin.
|
||||||
bin: $(BUILD_DIR)/$(TARGET).hex
|
bin: $(BUILD_DIR)/$(TARGET).hex
|
||||||
@@ -331,6 +344,8 @@ else ifeq (dfu,$(findstring dfu,$(BOOTLOADER)))
|
|||||||
$(call EXEC_DFU)
|
$(call EXEC_DFU)
|
||||||
else ifeq ($(strip $(BOOTLOADER)), USBasp)
|
else ifeq ($(strip $(BOOTLOADER)), USBasp)
|
||||||
$(call EXEC_USBASP)
|
$(call EXEC_USBASP)
|
||||||
|
else ifeq ($(strip $(BOOTLOADER)), bootloadHID)
|
||||||
|
$(call EXEC_BOOTLOADHID)
|
||||||
else
|
else
|
||||||
$(PRINT_OK); $(SILENT) || printf "&(MSG_FLASH_BOOTLOADER)"
|
$(PRINT_OK); $(SILENT) || printf "&(MSG_FLASH_BOOTLOADER)"
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user