From c74295de88e33322db8dcf861608c61db036b9ee Mon Sep 17 00:00:00 2001 From: fauxpark Date: Sun, 8 Dec 2019 18:32:43 +1100 Subject: [PATCH] Set proper AVR part for USBasp avrdude flashing (#7552) * Set proper AVR part for USBasp avrdude flashing * Remove `PROGRAM_CMD` stuff from rules.mk as they should not be needed anymore * Missed the Plaid readme * Remove PROGRAM_CMD from Mysterium --- keyboards/coseyfannitutti/discipad/rules.mk | 5 ----- keyboards/coseyfannitutti/discipline/readme.md | 2 +- keyboards/coseyfannitutti/discipline/rules.mk | 4 ---- keyboards/coseyfannitutti/mysterium/rules.mk | 4 ---- keyboards/gingham/readme.md | 7 ++++--- keyboards/gingham/rules.mk | 4 ---- keyboards/handwired/hnah40/readme.md | 6 +++++- keyboards/handwired/hnah40/rules.mk | 6 ------ keyboards/plaid/readme.md | 6 +++--- keyboards/plaid/rules.mk | 6 ------ quantum/mcu_selection.mk | 6 ++++++ tmk_core/avr.mk | 2 +- 12 files changed, 20 insertions(+), 38 deletions(-) diff --git a/keyboards/coseyfannitutti/discipad/rules.mk b/keyboards/coseyfannitutti/discipad/rules.mk index a9d06d608c4..52e06f6e762 100644 --- a/keyboards/coseyfannitutti/discipad/rules.mk +++ b/keyboards/coseyfannitutti/discipad/rules.mk @@ -11,14 +11,9 @@ MCU = atmega328p # ATmega328P USBasp BOOTLOADER = USBasp -# Flash program via avrdude, but default command is not suitable. -# You can use coseyfannitutti/discipad:default:program -PROGRAM_CMD = avrdude -c usbasp -p m328p -U flash:w:$(BUILD_DIR)/$(TARGET).hex - # disable debug code OPT_DEFS = -DDEBUG_LEVEL=0 - # Build Options # change yes to no to disable # diff --git a/keyboards/coseyfannitutti/discipline/readme.md b/keyboards/coseyfannitutti/discipline/readme.md index d850151d152..27a1790998d 100644 --- a/keyboards/coseyfannitutti/discipline/readme.md +++ b/keyboards/coseyfannitutti/discipline/readme.md @@ -12,7 +12,7 @@ Make example for this keyboard (after setting up your build environment): make coseyfannitutti/discipline:default -Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid)) +Flashing example for this keyboard: make coseyfannitutti/discipline:default:flash diff --git a/keyboards/coseyfannitutti/discipline/rules.mk b/keyboards/coseyfannitutti/discipline/rules.mk index 24b5969b74d..5666501ef5b 100644 --- a/keyboards/coseyfannitutti/discipline/rules.mk +++ b/keyboards/coseyfannitutti/discipline/rules.mk @@ -14,10 +14,6 @@ F_CPU = 16000000 # ATmega328P USBasp BOOTLOADER = USBasp -# Flash program via avrdude, but default command is not suitable. -# You can use plaid:default:program -PROGRAM_CMD = avrdude -c usbasp -p m32 -U flash:w:$(BUILD_DIR)/$(TARGET).hex - # disable debug code OPT_DEFS = -DDEBUG_LEVEL=0 diff --git a/keyboards/coseyfannitutti/mysterium/rules.mk b/keyboards/coseyfannitutti/mysterium/rules.mk index 51e1b8ae2fc..4147cfec965 100644 --- a/keyboards/coseyfannitutti/mysterium/rules.mk +++ b/keyboards/coseyfannitutti/mysterium/rules.mk @@ -14,10 +14,6 @@ F_USB = 16000000 # ATmega328P USBasp BOOTLOADER = USBasp -# Flash program via avrdude, but default command is not suitable. -# You can use coseyfannitutti/discipline:default:program -PROGRAM_CMD = avrdude -c usbasp -p m32 -U flash:w:$(BUILD_DIR)/$(TARGET).hex - # disable debug code OPT_DEFS = -DDEBUG_LEVEL=0 diff --git a/keyboards/gingham/readme.md b/keyboards/gingham/readme.md index 9893884e84e..d0c3e6fad79 100644 --- a/keyboards/gingham/readme.md +++ b/keyboards/gingham/readme.md @@ -9,11 +9,12 @@ Hardware Supported: ATMEGA328p with vusb [PCB](https://github.com/yiancar/gingha Hardware Availability: https://yiancar-designs.com/, https://novelkeys.xyz, https://mechboards.co.uk/ Make example for this keyboard (after setting up your build environment): + make gingham:default -Flash firmware: - // In bootloader mode - make gingham:default:program +Flashing example for this keyboard: + + make gingham:default:flash Bootloader: use usbasploader HSGW's my repository. diff --git a/keyboards/gingham/rules.mk b/keyboards/gingham/rules.mk index aa228c875bf..2ef090bd683 100644 --- a/keyboards/gingham/rules.mk +++ b/keyboards/gingham/rules.mk @@ -14,10 +14,6 @@ MCU = atmega328p # ATmega328P USBasp BOOTLOADER = USBasp -# Flash program via avrdude, but default command is not suitable. -# You can use plaid:default:program -PROGRAM_CMD = avrdude -c usbasp -p m328p -U flash:w:$(BUILD_DIR)/$(TARGET).hex - # disable debug code OPT_DEFS = -DDEBUG_LEVEL=0 diff --git a/keyboards/handwired/hnah40/readme.md b/keyboards/handwired/hnah40/readme.md index 20e2d712740..a15800daeee 100644 --- a/keyboards/handwired/hnah40/readme.md +++ b/keyboards/handwired/hnah40/readme.md @@ -10,7 +10,11 @@ Hardware Availability: https://github.com/vuhopkep/PCB/tree/master/Hnah40-Atmega Make example for this keyboard (after setting up your build environment): - make handwired/hnah40:default:program + make handwired/hnah40:default + +Flashing example for this keyboard: + + make handwired/hnah40:default:flash ## Bootloader use usbasploader from hsgw. diff --git a/keyboards/handwired/hnah40/rules.mk b/keyboards/handwired/hnah40/rules.mk index bbdf5176c44..a705bff6abf 100644 --- a/keyboards/handwired/hnah40/rules.mk +++ b/keyboards/handwired/hnah40/rules.mk @@ -11,15 +11,9 @@ MCU = atmega328p # ATmega328P USBasp BOOTLOADER = USBasp -# Flash program via avrdude, but default command is not suitable. -# You can use hnah40:default:program -PROGRAM_CMD = avrdude -c usbasp -p m328p -U flash:w:$(BUILD_DIR)/$(TARGET).hex - - # disable debug code OPT_DEFS = -DDEBUG_LEVEL=0 - # Build Options # change yes to no to disable # diff --git a/keyboards/plaid/readme.md b/keyboards/plaid/readme.md index dd49ecbdf53..a491d05d3bf 100644 --- a/keyboards/plaid/readme.md +++ b/keyboards/plaid/readme.md @@ -11,9 +11,9 @@ Hardware Availability: Group buy in r/mk Make example for this keyboard (after setting up your build environment): make plaid:default -Flash firmware: - // In bootloader mode - make plaid:default:program +Flashing example for this keyboard: + + make plaid:default:flash ## Bootloader use usbasploader in my repository. diff --git a/keyboards/plaid/rules.mk b/keyboards/plaid/rules.mk index 5ac35ee7f35..e020114b334 100644 --- a/keyboards/plaid/rules.mk +++ b/keyboards/plaid/rules.mk @@ -11,15 +11,9 @@ MCU = atmega328p # ATmega328P USBasp BOOTLOADER = USBasp -# Flash program via avrdude, but default command is not suitable. -# You can use plaid:default:program -PROGRAM_CMD = avrdude -c usbasp -p m328p -U flash:w:$(BUILD_DIR)/$(TARGET).hex - - # disable debug code OPT_DEFS = -DDEBUG_LEVEL=0 - # Build Options # change yes to no to disable # diff --git a/quantum/mcu_selection.mk b/quantum/mcu_selection.mk index f2c341e69b3..24b2b2abd91 100644 --- a/quantum/mcu_selection.mk +++ b/quantum/mcu_selection.mk @@ -75,6 +75,9 @@ ifneq (,$(filter $(MCU),atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 a endif ifneq (,$(filter $(MCU),atmega32a)) + # MCU name for avrdude + AVRDUDE_MCU = m32 + PROTOCOL = VUSB # Processor frequency. @@ -90,6 +93,9 @@ ifneq (,$(filter $(MCU),atmega32a)) endif ifneq (,$(filter $(MCU),atmega328p)) + # MCU name for avrdude + AVRDUDE_MCU = m328p + PROTOCOL = VUSB # Processor frequency. diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 8207394d74b..ecd2fd39a48 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -240,7 +240,7 @@ avrdude-split-right: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware $(call EXEC_AVRDUDE,eeprom-righthand.eep) define EXEC_USBASP - avrdude -p $(MCU) -c usbasp -U flash:w:$(BUILD_DIR)/$(TARGET).hex + avrdude -p $(AVRDUDE_MCU) -c usbasp -U flash:w:$(BUILD_DIR)/$(TARGET).hex endef usbasp: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware