Commit | Line | Data |
---|---|---|
3cf179be JH |
1 | ifneq ($(findstring STM32F303, $(MCU)),) |
2 | ## chip/board settings | |
3 | # - the next two should match the directories in | |
4 | # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) | |
5 | MCU_FAMILY ?= STM32 | |
6 | MCU_SERIES ?= STM32F3xx | |
7 | ||
8 | # Linker script to use | |
9 | # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/ | |
f98750de | 10 | # or <keyboard_dir>/ld/ |
3cf179be JH |
11 | MCU_LDSCRIPT ?= STM32F303xC |
12 | ||
13 | # Startup code to use | |
14 | # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/ | |
15 | MCU_STARTUP ?= stm32f3xx | |
16 | ||
f98750de | 17 | # Board: it should exist either in <chibios>/os/hal/boards/, |
18 | # <keyboard_dir>/boards/, or drivers/boards/ | |
3cf179be JH |
19 | BOARD ?= GENERIC_STM32_F303XC |
20 | ||
21 | # Cortex version | |
22 | MCU = cortex-m4 | |
23 | ||
24 | # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 | |
25 | ARMV ?= 7 | |
26 | ||
27 | USE_FPU = yes | |
28 | ||
29 | # Vector table for application | |
f98750de | 30 | # 0x00000000-0x00001000 area is occupied by bootloader.*/ |
3cf179be JH |
31 | # The CORTEX_VTOR... is needed only for MCHCK/Infinity KB |
32 | # OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 | |
33 | ||
34 | # Options to pass to dfu-util when flashing | |
35 | DFU_ARGS ?= -d 0483:df11 -a 0 -s 0x08000000:leave | |
41beecfc | 36 | DFU_SUFFIX_ARGS = -p DF11 -v 0483 |
3cf179be JH |
37 | endif |
38 | ||
98599173 | 39 | ifneq (,$(filter $(MCU),atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb1286)) |
3cf179be JH |
40 | # Processor frequency. |
41 | # This will define a symbol, F_CPU, in all source code files equal to the | |
42 | # processor frequency in Hz. You can then use this symbol in your source code to | |
43 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done | |
44 | # automatically to create a 32-bit value in your source code. | |
45 | # | |
46 | # This will be an integer division of F_USB below, as it is sourced by | |
47 | # F_USB after it has run through any CPU prescalers. Note that this value | |
48 | # does not *change* the processor frequency - it should merely be updated to | |
49 | # reflect the processor speed set externally so that the code can use accurate | |
50 | # software delays. | |
51 | F_CPU ?= 16000000 | |
52 | ||
53 | # LUFA specific | |
54 | # | |
55 | # Target architecture (see library "Board Types" documentation). | |
405dea01 | 56 | ARCH = AVR8 |
3cf179be JH |
57 | |
58 | # Input clock frequency. | |
59 | # This will define a symbol, F_USB, in all source code files equal to the | |
60 | # input clock frequency (before any prescaling is performed) in Hz. This value may | |
61 | # differ from F_CPU if prescaling is used on the latter, and is required as the | |
62 | # raw input clock is fed directly to the PLL sections of the AVR for high speed | |
63 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' | |
64 | # at the end, this will be done automatically to create a 32-bit value in your | |
65 | # source code. | |
66 | # | |
67 | # If no clock division is performed on the input clock inside the AVR (via the | |
68 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. | |
69 | F_USB ?= $(F_CPU) | |
405dea01 | 70 | |
71 | # Interrupt driven control endpoint task | |
72 | ifeq (,$(filter $(NO_INTERRUPT_CONTROL_ENDPOINT),yes)) | |
73 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | |
74 | endif | |
75 | endif | |
76 | ||
77 | ifneq (,$(filter $(MCU),atmega32a)) | |
78 | PROTOCOL = VUSB | |
79 | ||
80 | # Processor frequency. | |
81 | # This will define a symbol, F_CPU, in all source code files equal to the | |
82 | # processor frequency in Hz. You can then use this symbol in your source code to | |
83 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done | |
84 | # automatically to create a 32-bit value in your source code. | |
85 | F_CPU ?= 12000000 | |
86 | ||
87 | # unsupported features for now | |
88 | NO_UART ?= yes | |
89 | NO_SUSPEND_POWER_DOWN ?= yes | |
3cf179be | 90 | endif |
490a13a0 | 91 | |
92 | ifneq (,$(filter $(MCU),atmega328p)) | |
93 | PROTOCOL = VUSB | |
94 | ||
95 | # Processor frequency. | |
96 | # This will define a symbol, F_CPU, in all source code files equal to the | |
97 | # processor frequency in Hz. You can then use this symbol in your source code to | |
98 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done | |
99 | # automatically to create a 32-bit value in your source code. | |
100 | F_CPU ?= 16000000 | |
101 | ||
102 | # unsupported features for now | |
103 | NO_UART ?= yes | |
104 | NO_SUSPEND_POWER_DOWN ?= yes | |
105 | endif |