summaryrefslogtreecommitdiff
path: root/bootloader.mk
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader.mk')
-rw-r--r--bootloader.mk41
1 files changed, 30 insertions, 11 deletions
diff --git a/bootloader.mk b/bootloader.mk
index 5487f9ece6..8b4bc7a0fc 100644
--- a/bootloader.mk
+++ b/bootloader.mk
@@ -20,15 +20,19 @@
# 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)
-# stm32duino STM32Duino (STM32F103x8)
+# 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
@@ -95,6 +99,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)
@@ -104,10 +122,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
@@ -115,6 +133,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