aboutsummaryrefslogtreecommitdiff
path: root/quantum/mcu_selection.mk
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/mcu_selection.mk')
-rw-r--r--quantum/mcu_selection.mk92
1 files changed, 91 insertions, 1 deletions
diff --git a/quantum/mcu_selection.mk b/quantum/mcu_selection.mk
index f7329fc4d..edf44f5dc 100644
--- a/quantum/mcu_selection.mk
+++ b/quantum/mcu_selection.mk
@@ -81,6 +81,33 @@ ifneq ($(findstring MK20DX256, $(MCU)),)
81 BOARD ?= PJRC_TEENSY_3_1 81 BOARD ?= PJRC_TEENSY_3_1
82endif 82endif
83 83
84ifneq ($(findstring MK66F18, $(MCU)),)
85 # Cortex version
86 MCU = cortex-m4
87
88 # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
89 ARMV = 7
90
91 ## chip/board settings
92 # - the next two should match the directories in
93 # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
94 MCU_FAMILY = KINETIS
95 MCU_SERIES = MK66F18
96
97 # Linker script to use
98 # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
99 # or <keyboard_dir>/ld/
100 MCU_LDSCRIPT ?= MK66FX1M0
101
102 # Startup code to use
103 # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
104 MCU_STARTUP ?= MK66F18
105
106 # Board: it should exist either in <chibios>/os/hal/boards/,
107 # <keyboard_dir>/boards/, or drivers/boards/
108 BOARD ?= PJRC_TEENSY_3_6
109endif
110
84ifneq ($(findstring STM32F042, $(MCU)),) 111ifneq ($(findstring STM32F042, $(MCU)),)
85 # Cortex version 112 # Cortex version
86 MCU = cortex-m0 113 MCU = cortex-m0
@@ -112,6 +139,9 @@ ifneq ($(findstring STM32F042, $(MCU)),)
112 # Options to pass to dfu-util when flashing 139 # Options to pass to dfu-util when flashing
113 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave 140 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
114 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11 141 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
142
143 # UF2 settings
144 UF2_FAMILY ?= STM32F0
115endif 145endif
116 146
117ifneq ($(findstring STM32F072, $(MCU)),) 147ifneq ($(findstring STM32F072, $(MCU)),)
@@ -145,6 +175,9 @@ ifneq ($(findstring STM32F072, $(MCU)),)
145 # Options to pass to dfu-util when flashing 175 # Options to pass to dfu-util when flashing
146 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave 176 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
147 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11 177 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
178
179 # UF2 settings
180 UF2_FAMILY ?= STM32F0
148endif 181endif
149 182
150ifneq ($(findstring STM32F103, $(MCU)),) 183ifneq ($(findstring STM32F103, $(MCU)),)
@@ -178,6 +211,9 @@ ifneq ($(findstring STM32F103, $(MCU)),)
178 # Options to pass to dfu-util when flashing 211 # Options to pass to dfu-util when flashing
179 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave 212 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
180 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11 213 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
214
215 # UF2 settings
216 UF2_FAMILY ?= STM32F1
181endif 217endif
182 218
183ifneq ($(findstring STM32F303, $(MCU)),) 219ifneq ($(findstring STM32F303, $(MCU)),)
@@ -211,6 +247,9 @@ ifneq ($(findstring STM32F303, $(MCU)),)
211 # Options to pass to dfu-util when flashing 247 # Options to pass to dfu-util when flashing
212 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave 248 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
213 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11 249 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
250
251 # UF2 settings
252 UF2_FAMILY ?= STM32F3
214endif 253endif
215 254
216ifneq ($(findstring STM32F401, $(MCU)),) 255ifneq ($(findstring STM32F401, $(MCU)),)
@@ -244,6 +283,9 @@ ifneq ($(findstring STM32F401, $(MCU)),)
244 # Options to pass to dfu-util when flashing 283 # Options to pass to dfu-util when flashing
245 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave 284 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
246 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11 285 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
286
287 # UF2 settings
288 UF2_FAMILY ?= STM32F4
247endif 289endif
248 290
249ifneq ($(findstring STM32F411, $(MCU)),) 291ifneq ($(findstring STM32F411, $(MCU)),)
@@ -262,7 +304,12 @@ ifneq ($(findstring STM32F411, $(MCU)),)
262 # Linker script to use 304 # Linker script to use
263 # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/ 305 # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
264 # or <keyboard_dir>/ld/ 306 # or <keyboard_dir>/ld/
265 MCU_LDSCRIPT ?= STM32F411xE 307 ifeq ($(strip $(BOOTLOADER)), tinyuf2)
308 MCU_LDSCRIPT ?= STM32F411xE_tinyuf2
309 FIRMWARE_FORMAT ?= uf2
310 else
311 MCU_LDSCRIPT ?= STM32F411xE
312 endif
266 313
267 # Startup code to use 314 # Startup code to use
268 # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/ 315 # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
@@ -277,6 +324,43 @@ ifneq ($(findstring STM32F411, $(MCU)),)
277 # Options to pass to dfu-util when flashing 324 # Options to pass to dfu-util when flashing
278 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave 325 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
279 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11 326 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
327
328 # UF2 settings
329 UF2_FAMILY ?= STM32F4
330endif
331
332ifneq ($(findstring STM32F446, $(MCU)),)
333 # Cortex version
334 MCU = cortex-m4
335
336 # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
337 ARMV = 7
338
339 ## chip/board settings
340 # - the next two should match the directories in
341 # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
342 MCU_FAMILY = STM32
343 MCU_SERIES = STM32F4xx
344
345 # Linker script to use
346 # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
347 # or <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
348 # or <keyboard_dir>/ld/
349 MCU_LDSCRIPT ?= STM32F446xE
350
351 # Startup code to use
352 # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
353 MCU_STARTUP ?= stm32f4xx
354
355 # Board: it should exist either in <chibios>/os/hal/boards/,
356 # <keyboard_dir>/boards/, or drivers/boards/
357 BOARD ?= GENERIC_STM32_F446XE
358
359 USE_FPU ?= yes
360
361 # Options to pass to dfu-util when flashing
362 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
363 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
280endif 364endif
281 365
282ifneq ($(findstring STM32G431, $(MCU)),) 366ifneq ($(findstring STM32G431, $(MCU)),)
@@ -310,6 +394,9 @@ ifneq ($(findstring STM32G431, $(MCU)),)
310 # Options to pass to dfu-util when flashing 394 # Options to pass to dfu-util when flashing
311 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave 395 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
312 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11 396 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
397
398 # UF2 settings
399 UF2_FAMILY ?= STM32G4
313endif 400endif
314 401
315ifneq ($(findstring STM32G474, $(MCU)),) 402ifneq ($(findstring STM32G474, $(MCU)),)
@@ -343,6 +430,9 @@ ifneq ($(findstring STM32G474, $(MCU)),)
343 # Options to pass to dfu-util when flashing 430 # Options to pass to dfu-util when flashing
344 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave 431 DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
345 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11 432 DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
433
434 # UF2 settings
435 UF2_FAMILY ?= STM32G4
346endif 436endif
347 437
348ifneq (,$(filter $(MCU),at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647 at90usb1286 at90usb1287)) 438ifneq (,$(filter $(MCU),at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647 at90usb1286 at90usb1287))