blob: 5d2833faf8221930d61d060f236b07323e74f56c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
# Kconfig settings for STM32 processors
if MACH_STM32
config STM32_SELECT
bool
default y
select HAVE_GPIO
select HAVE_GPIO_ADC
select HAVE_GPIO_I2C
select HAVE_GPIO_SPI
select HAVE_GPIO_BITBANGING
select HAVE_STRICT_TIMING
select HAVE_CHIPID
config BOARD_DIRECTORY
string
default "stm32"
choice
prompt "Processor model"
config MACH_STM32F103
bool "STM32F103"
select MACH_STM32F1
config MACH_STM32F405
bool "STM32F405"
select MACH_STM32F4
config MACH_STM32F407
bool "STM32F407"
select MACH_STM32F4
config MACH_STM32F446
bool "STM32F446"
select MACH_STM32F4
config MACH_STM32F042
bool "STM32F042"
select MACH_STM32F0
config MACH_STM32F070
bool "STM32F070"
select MACH_STM32F0
endchoice
config MACH_STM32F0
bool
config MACH_STM32F1
bool
config MACH_STM32F4
bool
config HAVE_STM32_USBFS
bool
default y if MACH_STM32F103 || MACH_STM32F0
default n
config HAVE_STM32_USBOTG
bool
default y if MACH_STM32F4
default n
config MCU
string
default "stm32f042x6" if MACH_STM32F042
default "stm32f070xb" if MACH_STM32F070
default "stm32f103xe" if MACH_STM32F103
default "stm32f405xx" if MACH_STM32F405
default "stm32f407xx" if MACH_STM32F407
default "stm32f446xx" if MACH_STM32F446
config CLOCK_FREQ
int
default 48000000 if MACH_STM32F0
default 64000000 if MACH_STM32F103 && STM32_CLOCK_REF_INTERNAL
default 72000000 if MACH_STM32F103
default 168000000 if MACH_STM32F405 || MACH_STM32F407
default 180000000 if MACH_STM32F446
config FLASH_SIZE
hex
default 0x8000 if MACH_STM32F042
default 0x20000 if MACH_STM32F070
default 0x10000 if MACH_STM32F103 # Flash size of stm32f103x8 (64KiB)
default 0x80000 if MACH_STM32F4
config RAM_START
hex
default 0x20000000
config RAM_SIZE
hex
default 0x1800 if MACH_STM32F042
default 0x4000 if MACH_STM32F070
default 0x5000 if MACH_STM32F103 # Ram size of stm32f103x8 (20KiB)
default 0x20000 if MACH_STM32F4
config STACK_SIZE
int
default 512
choice
prompt "Bootloader offset" if MACH_STM32F407 || MACH_STM32F405 || MACH_STM32F103 || MACH_STM32F070
config STM32_FLASH_START_800
bool "2KiB bootloader (HID Bootloader)" if MACH_STM32F103
config STM32_FLASH_START_2000
bool "8KiB bootloader (stm32duino)" if MACH_STM32F103 || MACH_STM32F070
config STM32_FLASH_START_4000
bool "16KiB bootloader (HID Bootloader)" if MACH_STM32F405 || MACH_STM32F407
config STM32_FLASH_START_7000
bool "28KiB bootloader" if MACH_STM32F103
config STM32_FLASH_START_8000
bool "32KiB bootloader (SKR-PRO)" if MACH_STM32F407
config STM32_FLASH_START_10000
bool "64KiB bootloader (Alfawise)" if MACH_STM32F103
config STM32_FLASH_START_0000
bool "No bootloader"
endchoice
config FLASH_START
hex
default 0x8000800 if STM32_FLASH_START_800
default 0x8002000 if STM32_FLASH_START_2000
default 0x8004000 if STM32_FLASH_START_4000
default 0x8007000 if STM32_FLASH_START_7000
default 0x8008000 if STM32_FLASH_START_8000
default 0x8010000 if STM32_FLASH_START_10000
default 0x8000000
config ARMCM_RAM_VECTORTABLE
bool
default y if MACH_STM32F0 && FLASH_START != 0x8000000
default n
choice
prompt "Clock Reference" if LOW_LEVEL_OPTIONS
config STM32_CLOCK_REF_8M
bool "8 MHz crystal"
config STM32_CLOCK_REF_12M
bool "12 MHz crystal"
config STM32_CLOCK_REF_16M
bool "16 MHz crystal"
config STM32_CLOCK_REF_INTERNAL
bool "Internal clock"
endchoice
config CLOCK_REF_FREQ
int
default 16000000 if STM32_CLOCK_REF_16M
default 12000000 if STM32_CLOCK_REF_12M
default 1 if STM32_CLOCK_REF_INTERNAL
default 8000000
config USBSERIAL
bool "Use USB for communication (instead of serial)"
depends on HAVE_STM32_USBFS || HAVE_STM32_USBOTG
default y
config CANSERIAL
bool "Use CAN for communication (instead of serial)"
depends on MACH_STM32F042 && !USBSERIAL
default n
config SERIAL_BAUD
int "CAN bus speed" if LOW_LEVEL_OPTIONS && CANSERIAL
default 500000 if CANSERIAL
config STM32F042_PIN_SWAP
bool "Use PA9/PA10 for USB or CAN" if MACH_STM32F042
depends on (USBSERIAL || CANSERIAL) && MACH_STM32F042
default y if (USBSERIAL || CANSERIAL)
default n
config SERIAL
depends on !USBSERIAL && !CANSERIAL
bool
default y
choice
depends on SERIAL
prompt "Serial Port" if LOW_LEVEL_OPTIONS
help
Select the serial device to use.
config STM32_SERIAL_USART1
bool "USART1"
config STM32_SERIAL_USART2
bool "USART2 (on PA3/PA2)"
config STM32_SERIAL_USART2_ALT
bool "USART2 (on PA15/PA14)" if MACH_STM32F0
config STM32_SERIAL_USART3
bool "USART3"
config STM32_SERIAL_USART3_ALT
bool "USART3 (on PD9/PD8)" if MACH_STM32F4
endchoice
config SERIAL_PORT
int
default 3 if STM32_SERIAL_USART3 || STM32_SERIAL_USART3_ALT
default 2 if STM32_SERIAL_USART2 || STM32_SERIAL_USART2_ALT
default 1
endif
|