aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--quantum/mcu_selection.mk114
1 files changed, 104 insertions, 10 deletions
diff --git a/quantum/mcu_selection.mk b/quantum/mcu_selection.mk
index 24b2b2abd..bddafa6a4 100644
--- a/quantum/mcu_selection.mk
+++ b/quantum/mcu_selection.mk
@@ -1,9 +1,15 @@
1ifneq ($(findstring STM32F303, $(MCU)),) 1ifneq ($(findstring STM32F303, $(MCU)),)
2 # Cortex version
3 MCU = cortex-m4
4
5 # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
6 ARMV = 7
7
2 ## chip/board settings 8 ## chip/board settings
3 # - the next two should match the directories in 9 # - the next two should match the directories in
4 # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) 10 # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
5 MCU_FAMILY ?= STM32 11 MCU_FAMILY = STM32
6 MCU_SERIES ?= STM32F3xx 12 MCU_SERIES = STM32F3xx
7 13
8 # Linker script to use 14 # Linker script to use
9 # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/ 15 # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
@@ -18,22 +24,110 @@ ifneq ($(findstring STM32F303, $(MCU)),)
18 # <keyboard_dir>/boards/, or drivers/boards/ 24 # <keyboard_dir>/boards/, or drivers/boards/
19 BOARD ?= GENERIC_STM32_F303XC 25 BOARD ?= GENERIC_STM32_F303XC
20 26
27 USE_FPU ?= yes
28
29 # Options to pass to dfu-util when flashing
30 DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave
31 DFU_SUFFIX_ARGS ?= -v 0483 -p df11
32endif
33
34ifneq ($(findstring STM32F072, $(MCU)),)
21 # Cortex version 35 # Cortex version
22 MCU = cortex-m4 36 MCU = cortex-m0
37
38 # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
39 ARMV = 6
40
41 ## chip/board settings
42 # - the next two should match the directories in
43 # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
44 MCU_FAMILY = STM32
45 MCU_SERIES = STM32F0xx
46
47 # Linker script to use
48 # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
49 # or <keyboard_dir>/ld/
50 MCU_LDSCRIPT ?= STM32F072xB
51
52 # Startup code to use
53 # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
54 MCU_STARTUP ?= stm32f0xx
55
56 # Board: it should exist either in <chibios>/os/hal/boards/,
57 # <keyboard_dir>/boards/, or drivers/boards/
58 BOARD ?= ST_STM32F072B_DISCOVERY
59
60 USE_FPU ?= no
61
62 # Options to pass to dfu-util when flashing
63 DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave
64 DFU_SUFFIX_ARGS ?= -v 0483 -p df11
65endif
66
67ifneq ($(findstring STM32F042, $(MCU)),)
68 # Cortex version
69 MCU = cortex-m0
70
71 # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
72 ARMV = 6
73
74 ## chip/board settings
75 # - the next two should match the directories in
76 # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
77 MCU_FAMILY = STM32
78 MCU_SERIES = STM32F0xx
79
80 # Linker script to use
81 # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
82 # or <keyboard_dir>/ld/
83 MCU_LDSCRIPT ?= STM32F042x6
84
85 # Startup code to use
86 # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
87 MCU_STARTUP ?= stm32f0xx
88
89 # Board: it should exist either in <chibios>/os/hal/boards/,
90 # <keyboard_dir>/boards/, or drivers/boards/
91 BOARD ?= GENERIC_STM32_F042X6
92
93 USE_FPU ?= no
94
95 # Options to pass to dfu-util when flashing
96 DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave
97 DFU_SUFFIX_ARGS ?= -v 0483 -p df11
98endif
99
100ifneq ($(findstring STM32F103, $(MCU)),)
101 # Cortex version
102 MCU = cortex-m3
23 103
24 # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 104 # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
25 ARMV ?= 7 105 ARMV = 7
26 106
27 USE_FPU = yes 107 ## chip/board settings
108 # - the next two should match the directories in
109 # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
110 MCU_FAMILY = STM32
111 MCU_SERIES = STM32F1xx
112
113 # Linker script to use
114 # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
115 # or <keyboard_dir>/ld/
116 MCU_LDSCRIPT ?= STM32F103x8
117
118 # Startup code to use
119 # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
120 MCU_STARTUP ?= stm32f1xx
121
122 # Board: it should exist either in <chibios>/os/hal/boards/,
123 # <keyboard_dir>/boards/, or drivers/boards/
124 BOARD ?= GENERIC_STM32_F103
28 125
29 # Vector table for application 126 USE_FPU ?= no
30 # 0x00000000-0x00001000 area is occupied by bootloader.*/
31 # The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
32 # OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000
33 127
34 # Options to pass to dfu-util when flashing 128 # Options to pass to dfu-util when flashing
35 DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave 129 DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave
36 DFU_SUFFIX_ARGS = -p DF11 -v 0483 130 DFU_SUFFIX_ARGS ?= -v 0483 -p df11
37endif 131endif
38 132
39ifneq (,$(filter $(MCU),atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb1286)) 133ifneq (,$(filter $(MCU),atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb1286))