summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2021-01-20 14:04:21 +1100
committerDrashna Jael're <drashna@live.com>2021-02-02 09:46:41 -0800
commitc04d37da3bafeb72131180f6876b1ef87f29476b (patch)
tree647ffd5acfbe46e3748af63322bb7a4cd63005ab
parent5aac30a85afece3b6b7aade97f2760c94bd1a0d2 (diff)
Add stm32-dfu and apm32-dfu to bootloader.mk (#11019)
* Add stm32-dfu and apm32-dfu to bootloader.mk * Update flashing docs * Update comment * Further wordsmithing
-rw-r--r--bootloader.mk41
1 files changed, 31 insertions, 10 deletions
diff --git a/bootloader.mk b/bootloader.mk
index 86c5d58f90..299639043e 100644
--- a/bootloader.mk
+++ b/bootloader.mk
@@ -20,14 +20,20 @@
# Sets the bootloader defined in the keyboard's/keymap's rules.mk
# Current options:
#
-# halfkay PJRC Teensy
-# caterina Pro Micro (Sparkfun/generic)
-# atmel-dfu Atmel factory DFU
-# lufa-dfu LUFA DFU
-# qmk-dfu QMK DFU (LUFA + blinkenlight)
-# bootloadHID HIDBootFlash compatible (ATmega32A)
-# USBasp USBaspLoader (ATmega328P)
-# kiibohd Input:Club Kiibohd bootloader (only used on their boards)
+
+# AVR:
+# halfkay PJRC Teensy
+# caterina Pro Micro (Sparkfun/generic)
+# atmel-dfu Atmel factory DFU
+# lufa-dfu LUFA DFU
+# qmk-dfu QMK DFU (LUFA + blinkenlight)
+# bootloadHID HIDBootFlash compatible (ATmega32A)
+# USBasp USBaspLoader (ATmega328P)
+# ARM:
+# kiibohd Input:Club Kiibohd bootloader (only used on their boards)
+# stm32duino STM32Duino (STM32F103x8)
+# stm32-dfu STM32 USB DFU in ROM
+# apm32-dfu APM32 USB DFU in ROM
#
# BOOTLOADER_SIZE can still be defined manually, but it's recommended
# you add any possible configuration to this list
@@ -94,6 +100,20 @@ ifdef BOOTLOADER_SIZE
OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE))
endif
+ifeq ($(strip $(BOOTLOADER)), stm32-dfu)
+ OPT_DEFS += -DBOOTLOADER_STM32_DFU
+
+ # Options to pass to dfu-util when flashing
+ DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
+ DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
+endif
+ifeq ($(strip $(BOOTLOADER)), apm32-dfu)
+ OPT_DEFS += -DBOOTLOADER_APM32_DFU
+
+ # Options to pass to dfu-util when flashing
+ DFU_ARGS ?= -d 314B:0106 -a 0 -s 0x08000000:leave
+ DFU_SUFFIX_ARGS ?= -v 314B -p 0106
+endif
ifeq ($(strip $(BOOTLOADER)), kiibohd)
OPT_DEFS += -DBOOTLOADER_KIIBOHD
ifeq ($(strip $(MCU_ORIG)), MK20DX128)
@@ -103,10 +123,10 @@ ifeq ($(strip $(BOOTLOADER)), kiibohd)
MCU_LDSCRIPT = MK20DX256BLDR8
endif
+ # Options to pass to dfu-util when flashing
DFU_ARGS = -d 1C11:B007
DFU_SUFFIX_ARGS = -v 1C11 -p B007
endif
-
ifeq ($(strip $(BOOTLOADER)), stm32duino)
OPT_DEFS += -DBOOTLOADER_STM32DUINO
MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
@@ -114,6 +134,7 @@ ifeq ($(strip $(BOOTLOADER)), stm32duino)
# STM32F103 does NOT have an USB bootloader in ROM (only serial), so setting anything here does not make much sense
STM32_BOOTLOADER_ADDRESS = 0x80000000
- DFU_ARGS = -d 1EAF:0003 -a2 -R
+ # Options to pass to dfu-util when flashing
+ DFU_ARGS = -d 1EAF:0003 -a 2 -R
DFU_SUFFIX_ARGS = -v 1EAF -p 0003
endif