Browse Source

Fix Rumba32 variant for Marlin (#21497)

Victor Oliveira 3 years ago
parent
commit
121b606f9c
No account linked to committer's email address

+ 454
- 0
buildroot/share/PlatformIO/variants/MARLIN_F446VE/PeripheralPins.c View File

@@ -0,0 +1,454 @@
1
+/*
2
+ *******************************************************************************
3
+ * Copyright (c) 2020, STMicroelectronics
4
+ * All rights reserved.
5
+ *
6
+ * This software component is licensed by ST under BSD 3-Clause license,
7
+ * the "License"; You may not use this file except in compliance with the
8
+ * License. You may obtain a copy of the License at:
9
+ *                        opensource.org/licenses/BSD-3-Clause
10
+ *
11
+ *******************************************************************************
12
+ * Automatically generated from STM32F446V(C-E)Tx.xml
13
+ */
14
+#include "Arduino.h"
15
+#include "PeripheralPins.h"
16
+
17
+/* =====
18
+ * Note: Commented lines are alternative possibilities which are not used per default.
19
+ *       If you change them, you will have to know what you do
20
+ * =====
21
+ */
22
+
23
+//*** ADC ***
24
+
25
+#ifdef HAL_ADC_MODULE_ENABLED
26
+WEAK const PinMap PinMap_ADC[] = {
27
+  {PA_0,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0
28
+  //  {PA_0,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC2_IN0
29
+  //  {PA_0,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC3_IN0
30
+  {PA_1,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1
31
+  //  {PA_1,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC2_IN1
32
+  //  {PA_1,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_IN1
33
+  {PA_2,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2
34
+  //  {PA_2,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC2_IN2
35
+  //  {PA_2,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC3_IN2
36
+  {PA_3,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3
37
+  //  {PA_3,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_IN3
38
+  //  {PA_3,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC3_IN3
39
+  {PA_4,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4
40
+  //  {PA_4,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_IN4
41
+  {PA_5,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5
42
+  //  {PA_5,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_IN5
43
+  {PA_6,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6
44
+  //  {PA_6,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_IN6
45
+  {PA_7,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7
46
+  //  {PA_7,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_IN7
47
+  {PB_0,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8
48
+  //  {PB_0,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_IN8
49
+  {PB_1,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9
50
+  //  {PB_1,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_IN9
51
+  {PC_0,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10
52
+  //  {PC_0,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_IN10
53
+  //  {PC_0,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC3_IN10
54
+  {PC_1,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11
55
+  //  {PC_1,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_IN11
56
+  //  {PC_1,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC3_IN11
57
+  {PC_2,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12
58
+  //  {PC_2,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC2_IN12
59
+  //  {PC_2,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC3_IN12
60
+  {PC_3,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13
61
+  //  {PC_3,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC2_IN13
62
+  //  {PC_3,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC3_IN13
63
+  {PC_4,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14
64
+  //  {PC_4,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC2_IN14
65
+  {PC_5,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15
66
+  //  {PC_5,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC2_IN15
67
+  {NC,    NP,    0}
68
+};
69
+#endif
70
+
71
+//*** DAC ***
72
+
73
+#ifdef HAL_DAC_MODULE_ENABLED
74
+WEAK const PinMap PinMap_DAC[] = {
75
+  //  {PA_4,  DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1
76
+  //  {PA_5,  DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 - LD2
77
+  {NC,   NP,    0}
78
+};
79
+#endif
80
+
81
+//*** I2C ***
82
+
83
+#ifdef HAL_I2C_MODULE_ENABLED
84
+WEAK const PinMap PinMap_I2C_SDA[] = {
85
+  //  {PB_3,  I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
86
+  //  {PB_4,  I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
87
+  //  {PB_7,  I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
88
+  {PB_9,  I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
89
+  //  {PC_9,  I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
90
+  //  {PC_12, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
91
+  {NC,    NP,    0}
92
+};
93
+#endif
94
+
95
+#ifdef HAL_I2C_MODULE_ENABLED
96
+WEAK const PinMap PinMap_I2C_SCL[] = {
97
+  //  {PA_8,  I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
98
+  //  {PB_6,  I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
99
+  {PB_8,  I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
100
+  //  {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
101
+  {NC,    NP,    0}
102
+};
103
+#endif
104
+
105
+//*** PWM ***
106
+
107
+#ifdef HAL_TIM_MODULE_ENABLED
108
+WEAK const PinMap PinMap_PWM[] = {
109
+  //  {PA_0,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
110
+  {PA_0,  TIM5,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1
111
+  //  {PA_1,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
112
+  {PA_1,  TIM5,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2
113
+  //  {PA_2,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3
114
+  {PA_2,  TIM5,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3
115
+  //  {PA_2,  TIM9,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1
116
+  //  {PA_3,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4
117
+  {PA_3,  TIM5,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4
118
+  //  {PA_3,  TIM9,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2
119
+  //  {PA_5,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
120
+  //  {PA_5,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N
121
+  //  {PA_6,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
122
+  //  {PA_6,  TIM13,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1
123
+  //  {PA_7,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
124
+  //  {PA_7,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
125
+  //  {PA_7,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N
126
+  //  {PA_7,  TIM14,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1
127
+  {PA_8,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1
128
+  {PA_9,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2
129
+  {PA_10, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3
130
+  //  {PA_11, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4
131
+  {PA_15, TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
132
+  //  {PB_0,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
133
+  //  {PB_0,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3
134
+  //  {PB_0,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N
135
+  //  {PB_1,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
136
+  //  {PB_1,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4
137
+  //  {PB_1,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N
138
+  {PB_2,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4
139
+  {PB_3,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
140
+  //  {PB_4,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
141
+  //  {PB_5,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
142
+  //  {PB_6,  TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1
143
+  //  {PB_7,  TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2
144
+  //  {PB_8,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
145
+  //  {PB_8,  TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3
146
+  //  {PB_8,  TIM10,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1
147
+  //  {PB_9,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
148
+  //  {PB_9,  TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4
149
+  //  {PB_9,  TIM11,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1
150
+  {PB_10, TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3
151
+  //  {PB_13, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
152
+  //  {PB_14, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
153
+  //  {PB_14, TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N
154
+  {PB_14, TIM12,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 1, 0)}, // TIM12_CH1
155
+  //  {PB_15, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
156
+  //  {PB_15, TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N
157
+  {PB_15, TIM12,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 2, 0)}, // TIM12_CH2
158
+  {PC_6,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
159
+  //  {PC_6,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 0)}, // TIM8_CH1
160
+  {PC_7,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
161
+  //  {PC_7,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2
162
+  {PC_8,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3
163
+  //  {PC_8,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3
164
+  {PC_9,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4
165
+  //  {PC_9,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4
166
+  {PD_12, TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1
167
+  {PD_13, TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2
168
+  {PD_14, TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3
169
+  {PD_15, TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4
170
+  //  {PE_5,  TIM9,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1
171
+  //  {PE_6,  TIM9,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2
172
+  //  {PE_8,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
173
+  //  {PE_9,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1
174
+  //  {PE_10, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
175
+  //  {PE_11, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2
176
+  //  {PE_12, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
177
+  //  {PE_13, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3
178
+  {PE_14, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4
179
+  {NC,    NP,    0}
180
+};
181
+#endif
182
+
183
+//*** SERIAL ***
184
+
185
+#ifdef HAL_UART_MODULE_ENABLED
186
+WEAK const PinMap PinMap_UART_TX[] = {
187
+  //  {PA_0,  UART4,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
188
+  //  {PA_2,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
189
+  {PA_9,  USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
190
+  //  {PB_6,  USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
191
+  //  {PB_10, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
192
+  //  {PC_6,  USART6,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
193
+  //  {PC_10, UART4,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
194
+  //  {PC_10, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
195
+  //  {PC_12, UART5,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
196
+  //  {PD_5,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
197
+  //  {PD_8,  USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
198
+  {PE_8,  UART5,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
199
+  {NC,    NP,    0}
200
+};
201
+#endif
202
+
203
+#ifdef HAL_UART_MODULE_ENABLED
204
+WEAK const PinMap PinMap_UART_RX[] = {
205
+  //  {PA_1,  UART4,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
206
+  //  {PA_3,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
207
+  {PA_10, USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
208
+  //  {PB_7,  USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
209
+  //  {PC_5,  USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
210
+  //  {PC_7,  USART6,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
211
+  //  {PC_11, UART4,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
212
+  //  {PC_11, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
213
+  //  {PD_2,  UART5,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
214
+  //  {PD_6,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
215
+  //  {PD_9,  USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
216
+  {PE_7,  UART5,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
217
+  {NC,    NP,    0}
218
+};
219
+#endif
220
+
221
+#ifdef HAL_UART_MODULE_ENABLED
222
+WEAK const PinMap PinMap_UART_RTS[] = {
223
+  //  {PA_1,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
224
+  //  {PA_12, USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
225
+  //  {PA_15, UART4,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
226
+  //  {PB_14, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
227
+  //  {PC_8,  UART5,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART5)},
228
+  //  {PD_4,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
229
+  //  {PD_12, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
230
+  {NC,    NP,    0}
231
+};
232
+#endif
233
+
234
+#ifdef HAL_UART_MODULE_ENABLED
235
+WEAK const PinMap PinMap_UART_CTS[] = {
236
+  //  {PA_0,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
237
+  //  {PA_11, USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
238
+  //  {PB_0,  UART4,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
239
+  //  {PB_13, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
240
+  //  {PC_9,  UART5,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART5)},
241
+  //  {PD_3,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
242
+  //  {PD_11, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
243
+  {NC,    NP,    0}
244
+};
245
+#endif
246
+
247
+//*** SPI ***
248
+
249
+#ifdef HAL_SPI_MODULE_ENABLED
250
+WEAK const PinMap PinMap_SPI_MOSI[] = {
251
+  {PA_7,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
252
+  //  {PB_0,  SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI3)},
253
+  //  {PB_2,  SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI3)},
254
+  //  {PB_5,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
255
+  //  {PB_5,  SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
256
+  //  {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
257
+  //  {PC_1,  SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI2)},
258
+  //  {PC_1,  SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI3)},
259
+  //  {PC_3,  SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
260
+  //  {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
261
+  //  {PD_0,  SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
262
+  //  {PD_6,  SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI3)},
263
+  //  {PE_6,  SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
264
+  //  {PE_14, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
265
+  {NC,    NP,    0}
266
+};
267
+#endif
268
+
269
+#ifdef HAL_SPI_MODULE_ENABLED
270
+WEAK const PinMap PinMap_SPI_MISO[] = {
271
+  {PA_6,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
272
+  //  {PB_4,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
273
+  //  {PB_4,  SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
274
+  //  {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
275
+  //  {PC_2,  SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
276
+  //  {PC_11, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
277
+  //  {PD_0,  SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
278
+  //  {PE_5,  SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
279
+  //  {PE_13, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
280
+  {NC,    NP,    0}
281
+};
282
+#endif
283
+
284
+#ifdef HAL_SPI_MODULE_ENABLED
285
+WEAK const PinMap PinMap_SPI_SCLK[] = {
286
+  {PA_5,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
287
+  //  {PA_9,  SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
288
+  //  {PB_3,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
289
+  //  {PB_3,  SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
290
+  //  {PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
291
+  //  {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
292
+  //  {PC_7,  SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
293
+  //  {PC_10, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
294
+  //  {PD_3,  SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
295
+  //  {PE_2,  SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
296
+  //  {PE_12, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
297
+  {NC,    NP,    0}
298
+};
299
+#endif
300
+
301
+#ifdef HAL_SPI_MODULE_ENABLED
302
+WEAK const PinMap PinMap_SPI_SSEL[] = {
303
+  {PA_4,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
304
+  //  {PA_4,  SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
305
+  //  {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
306
+  //  {PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
307
+  //  {PB_4,  SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI2)},
308
+  //  {PB_9,  SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
309
+  //  {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
310
+  //  {PD_1,  SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI2)},
311
+  //  {PE_4,  SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
312
+  //  {PE_11, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
313
+  {NC,    NP,    0}
314
+};
315
+#endif
316
+
317
+//*** CAN ***
318
+
319
+#ifdef HAL_CAN_MODULE_ENABLED
320
+WEAK const PinMap PinMap_CAN_RD[] = {
321
+  //  {PA_11, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
322
+  //  {PB_5,  CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)},
323
+  //  {PB_8,  CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
324
+  //  {PB_12, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)},
325
+  //  {PD_0,  CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
326
+  {NC,    NP,    0}
327
+};
328
+#endif
329
+
330
+#ifdef HAL_CAN_MODULE_ENABLED
331
+WEAK const PinMap PinMap_CAN_TD[] = {
332
+  //  {PA_12, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
333
+  //  {PB_6,  CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)},
334
+  //  {PB_9,  CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
335
+  //  {PB_13, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)},
336
+  //  {PD_1,  CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
337
+  {NC,    NP,    0}
338
+};
339
+#endif
340
+
341
+//*** No ETHERNET ***
342
+
343
+//*** QUADSPI ***
344
+
345
+#ifdef HAL_QSPI_MODULE_ENABLED
346
+WEAK const PinMap PinMap_QUADSPI_DATA0[] = {
347
+  // {PC_9,  QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK1_IO0
348
+  // {PD_11, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK1_IO0
349
+  // {PE_7,  QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QSPI)}, // QUADSPI_BK2_IO0
350
+  {NC,    NP,    0}
351
+};
352
+#endif
353
+
354
+#ifdef HAL_QSPI_MODULE_ENABLED
355
+WEAK const PinMap PinMap_QUADSPI_DATA1[] = {
356
+  // {PC_10, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK1_IO1
357
+  // {PD_12, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK1_IO1
358
+  // {PE_8,  QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QSPI)}, // QUADSPI_BK2_IO1
359
+  {NC,    NP,    0}
360
+};
361
+#endif
362
+
363
+#ifdef HAL_QSPI_MODULE_ENABLED
364
+WEAK const PinMap PinMap_QUADSPI_DATA2[] = {
365
+  // {PE_2,  QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK1_IO2
366
+  // {PE_9,  QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QSPI)}, // QUADSPI_BK2_IO2
367
+  {NC,    NP,    0}
368
+};
369
+#endif
370
+
371
+#ifdef HAL_QSPI_MODULE_ENABLED
372
+WEAK const PinMap PinMap_QUADSPI_DATA3[] = {
373
+  {PA_1,  QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK1_IO3
374
+  // {PD_13, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK1_IO3
375
+  // {PE_10, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QSPI)}, // QUADSPI_BK2_IO3
376
+  {NC,    NP,    0}
377
+};
378
+#endif
379
+
380
+#ifdef HAL_QSPI_MODULE_ENABLED
381
+WEAK const PinMap PinMap_QUADSPI_SCLK[] = {
382
+  // {PB_2,  QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_CLK
383
+  // {PD_3,  QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_CLK
384
+  {NC,    NP,    0}
385
+};
386
+#endif
387
+
388
+#ifdef HAL_QSPI_MODULE_ENABLED
389
+WEAK const PinMap PinMap_QUADSPI_SSEL[] = {
390
+  // {PB_6,  QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QSPI)}, // QUADSPI_BK1_NCS
391
+  // {PC_11, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK2_NCS
392
+  {NC,    NP,    0}
393
+};
394
+#endif
395
+
396
+//*** USB ***
397
+
398
+#ifdef HAL_PCD_MODULE_ENABLED
399
+WEAK const PinMap PinMap_USB_OTG_FS[] = {
400
+  //  {PA_8,  USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF
401
+  //  {PA_9,  USB_OTG_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS
402
+  //  {PA_10, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID
403
+  {PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM
404
+  {PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP
405
+  {NC,    NP,    0}
406
+};
407
+#endif
408
+
409
+#ifdef HAL_PCD_MODULE_ENABLED
410
+WEAK const PinMap PinMap_USB_OTG_HS[] = {
411
+#ifdef USE_USB_HS_IN_FS
412
+  // {PA_4,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_SOF
413
+  // {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_ID
414
+  // {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_HS_VBUS
415
+  // {PB_14, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_DM
416
+  // {PB_15, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_DP
417
+#else
418
+  // {PA_3,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D0
419
+  // {PA_5,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_CK
420
+  // {PB_0,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D1
421
+  // {PB_1,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D2
422
+  // {PB_2,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D4
423
+  // {PB_5,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D7
424
+  // {PB_10, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D3
425
+  // {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D5
426
+  // {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D6
427
+  // {PC_0,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_STP
428
+  // {PC_2,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_DIR
429
+  // {PC_3,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_NXT
430
+#endif /* USE_USB_HS_IN_FS */
431
+  {NC,    NP,    0}
432
+};
433
+#endif
434
+
435
+//*** SD ***
436
+
437
+#ifdef HAL_SD_MODULE_ENABLED
438
+WEAK const PinMap PinMap_SD[] = {
439
+  // {PB_0,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D1
440
+  // {PB_1,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D2
441
+  // {PB_2,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO)}, // SDIO_CK
442
+  // {PB_8,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D4
443
+  // {PB_9,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D5
444
+  // {PC_6,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D6
445
+  // {PC_7,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D7
446
+  // {PC_8,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D0
447
+  // {PC_9,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D1
448
+  // {PC_10, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D2
449
+  // {PC_11, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D3
450
+  // {PC_12, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO)}, // SDIO_CK
451
+  // {PD_2,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO)}, // SDIO_CMD
452
+  {NC,    NP,    0}
453
+};
454
+#endif

+ 30
- 0
buildroot/share/PlatformIO/variants/MARLIN_F446VE/PinNamesVar.h View File

@@ -0,0 +1,30 @@
1
+/* SYS_WKUP */
2
+#ifdef PWR_WAKEUP_PIN1
3
+  SYS_WKUP1 = PA_0, /* SYS_WKUP0 */
4
+#endif
5
+#ifdef PWR_WAKEUP_PIN2
6
+  SYS_WKUP2 = NC,
7
+#endif
8
+#ifdef PWR_WAKEUP_PIN3
9
+  SYS_WKUP3 = NC,
10
+#endif
11
+#ifdef PWR_WAKEUP_PIN4
12
+  SYS_WKUP4 = NC,
13
+#endif
14
+#ifdef PWR_WAKEUP_PIN5
15
+  SYS_WKUP5 = NC,
16
+#endif
17
+#ifdef PWR_WAKEUP_PIN6
18
+  SYS_WKUP6 = NC,
19
+#endif
20
+#ifdef PWR_WAKEUP_PIN7
21
+  SYS_WKUP7 = NC,
22
+#endif
23
+#ifdef PWR_WAKEUP_PIN8
24
+  SYS_WKUP8 = NC,
25
+#endif
26
+/* USB */
27
+#ifdef USBCON
28
+  USB_OTG_FS_DM = PA_11,
29
+  USB_OTG_FS_DP = PA_12,
30
+#endif

+ 184
- 0
buildroot/share/PlatformIO/variants/MARLIN_F446VE/ldscript.ld View File

@@ -0,0 +1,184 @@
1
+/*
2
+*****************************************************************************
3
+**
4
+**  File        : lscript.ld
5
+**
6
+**  Abstract    : Linker script for STM32F446VE Device with
7
+**                512KByte FLASH, 128KByte RAM
8
+**
9
+**                Set heap size, stack size and stack location according
10
+**                to application requirements.
11
+**
12
+**                Set memory bank area and size if external memory is used.
13
+**
14
+**  Target      : STMicroelectronics STM32
15
+**
16
+**
17
+**  Distribution: The file is distributed as is, without any warranty
18
+**                of any kind.
19
+**
20
+*****************************************************************************
21
+** @attention
22
+**
23
+** <h2><center>&copy; COPYRIGHT(c) 2014 Ac6</center></h2>
24
+**
25
+** Redistribution and use in source and binary forms, with or without modification,
26
+** are permitted provided that the following conditions are met:
27
+**   1. Redistributions of source code must retain the above copyright notice,
28
+**      this list of conditions and the following disclaimer.
29
+**   2. Redistributions in binary form must reproduce the above copyright notice,
30
+**      this list of conditions and the following disclaimer in the documentation
31
+**      and/or other materials provided with the distribution.
32
+**   3. Neither the name of Ac6 nor the names of its contributors
33
+**      may be used to endorse or promote products derived from this software
34
+**      without specific prior written permission.
35
+**
36
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
37
+** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38
+** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39
+** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
40
+** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
41
+** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
42
+** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
43
+** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
44
+** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
45
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46
+**
47
+*****************************************************************************
48
+*/
49
+
50
+/* Entry Point */
51
+ENTRY(Reset_Handler)
52
+
53
+/* Highest address of the user mode stack */
54
+_estack = 0x20000000 + LD_MAX_DATA_SIZE;    /* end of RAM */
55
+/* Generate a link error if heap and stack don't fit into RAM */
56
+_Min_Heap_Size = 0x200;      /* required amount of heap  */
57
+_Min_Stack_Size = 0x400; /* required amount of stack */
58
+
59
+/* Specify the memory areas */
60
+MEMORY
61
+{
62
+RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
63
+FLASH (rx)      : ORIGIN = 0x08000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
64
+}
65
+
66
+/* Define output sections */
67
+SECTIONS
68
+{
69
+  /* The startup code goes first into FLASH */
70
+  .isr_vector :
71
+  {
72
+    . = ALIGN(4);
73
+    KEEP(*(.isr_vector)) /* Startup code */
74
+    . = ALIGN(4);
75
+  } >FLASH
76
+
77
+  /* The program code and other data goes into FLASH */
78
+  .text ALIGN(4):
79
+  {
80
+    . = ALIGN(4);
81
+    *(.text)           /* .text sections (code) */
82
+    *(.text*)          /* .text* sections (code) */
83
+    *(.glue_7)         /* glue arm to thumb code */
84
+    *(.glue_7t)        /* glue thumb to arm code */
85
+    *(.eh_frame)
86
+
87
+    KEEP (*(.init))
88
+    KEEP (*(.fini))
89
+
90
+    . = ALIGN(4);
91
+    _etext = .;        /* define a global symbols at end of code */
92
+  } >FLASH
93
+
94
+  /* Constant data goes into FLASH */
95
+  .rodata ALIGN(4):
96
+  {
97
+    . = ALIGN(4);
98
+    *(.rodata)         /* .rodata sections (constants, strings, etc.) */
99
+    *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
100
+    . = ALIGN(4);
101
+  } >FLASH
102
+
103
+  .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
104
+  .ARM : {
105
+    __exidx_start = .;
106
+    *(.ARM.exidx*)
107
+    __exidx_end = .;
108
+  } >FLASH
109
+
110
+  .preinit_array     :
111
+  {
112
+    PROVIDE_HIDDEN (__preinit_array_start = .);
113
+    KEEP (*(.preinit_array*))
114
+    PROVIDE_HIDDEN (__preinit_array_end = .);
115
+  } >FLASH
116
+  .init_array :
117
+  {
118
+    PROVIDE_HIDDEN (__init_array_start = .);
119
+    KEEP (*(SORT(.init_array.*)))
120
+    KEEP (*(.init_array*))
121
+    PROVIDE_HIDDEN (__init_array_end = .);
122
+  } >FLASH
123
+  .fini_array :
124
+  {
125
+    PROVIDE_HIDDEN (__fini_array_start = .);
126
+    KEEP (*(SORT(.fini_array.*)))
127
+    KEEP (*(.fini_array*))
128
+    PROVIDE_HIDDEN (__fini_array_end = .);
129
+  } >FLASH
130
+
131
+  /* used by the startup to initialize data */
132
+  _sidata = LOADADDR(.data);
133
+
134
+  /* Initialized data sections goes into RAM, load LMA copy after code */
135
+  .data :
136
+  {
137
+    . = ALIGN(4);
138
+    _sdata = .;        /* create a global symbol at data start */
139
+    *(.data)           /* .data sections */
140
+    *(.data*)          /* .data* sections */
141
+
142
+    . = ALIGN(4);
143
+    _edata = .;        /* define a global symbol at data end */
144
+  } >RAM AT> FLASH
145
+
146
+  /*_siccmram = LOADADDR(.ccmram);*/
147
+
148
+  /* Uninitialized data section */
149
+  . = ALIGN(4);
150
+  .bss :
151
+  {
152
+    /* This is used by the startup in order to initialize the .bss secion */
153
+    _sbss = .;         /* define a global symbol at bss start */
154
+    __bss_start__ = _sbss;
155
+    *(.bss)
156
+    *(.bss*)
157
+    *(COMMON)
158
+
159
+    . = ALIGN(4);
160
+    _ebss = .;         /* define a global symbol at bss end */
161
+    __bss_end__ = _ebss;
162
+  } >RAM
163
+
164
+  /* User_heap_stack section, used to check that there is enough RAM left */
165
+  ._user_heap_stack :
166
+  {
167
+    . = ALIGN(4);
168
+    PROVIDE ( end = . );
169
+    PROVIDE ( _end = . );
170
+    . = . + _Min_Heap_Size;
171
+    . = . + _Min_Stack_Size;
172
+    . = ALIGN(4);
173
+  } >RAM
174
+
175
+  /* Remove information from the standard libraries */
176
+  /DISCARD/ :
177
+  {
178
+    libc.a ( * )
179
+    libm.a ( * )
180
+    libgcc.a ( * )
181
+  }
182
+
183
+  .ARM.attributes 0 : { *(.ARM.attributes) }
184
+}

+ 212
- 0
buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.cpp View File

@@ -0,0 +1,212 @@
1
+/*
2
+  Copyright (c) 2011 Arduino.  All right reserved.
3
+
4
+  This library is free software; you can redistribute it and/or
5
+  modify it under the terms of the GNU Lesser General Public
6
+  License as published by the Free Software Foundation; either
7
+  version 2.1 of the License, or (at your option) any later version.
8
+
9
+  This library is distributed in the hope that it will be useful,
10
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+  See the GNU Lesser General Public License for more details.
13
+
14
+  You should have received a copy of the GNU Lesser General Public
15
+  License along with this library; if not, write to the Free Software
16
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
+*/
18
+
19
+#include "pins_arduino.h"
20
+
21
+#ifdef __cplusplus
22
+extern "C" {
23
+#endif
24
+
25
+// Pin number
26
+const PinName digitalPin[] = {
27
+  PA_0,  //D0   //A7
28
+  PA_1,  //D1   //A8
29
+  PA_2,  //D2   //A9
30
+  PA_3,  //D3   //A0
31
+  PA_4,  //D4   //A1
32
+  PA_5,  //D5   //A10
33
+  PA_6,  //D6   //A11
34
+  PA_7,  //D7   //A12
35
+  PA_8,  //D8
36
+  PA_9,  //D9
37
+  PA_10, //D10
38
+  PA_11, //D11
39
+  PA_12, //D12
40
+  PA_13, //D13
41
+  PA_14, //D14
42
+  PA_15, //D15
43
+  PB_0,  //D16  //A13
44
+  PB_1,  //D17  //A14
45
+  PB_2,  //D18
46
+  PB_3,  //D19
47
+  PB_4,  //D20
48
+  PB_5,  //D21
49
+  PB_6,  //D22
50
+  PB_7,  //D23
51
+  PB_8,  //D24
52
+  PB_9,  //D25
53
+  PB_10, //D26
54
+  PB_11, //D27
55
+  PB_12, //D28
56
+  PB_13, //D29
57
+  PB_14, //D30
58
+  PB_15, //D31
59
+  PC_0,  //D32  //A2
60
+  PC_1,  //D33  //A3
61
+  PC_2,  //D34  //A4
62
+  PC_3,  //D35  //A5
63
+  PC_4,  //D36  //A6
64
+  PC_5,  //D37  //A15
65
+  PC_6,  //D38
66
+  PC_7,  //D39
67
+  PC_8,  //D40
68
+  PC_9,  //D41
69
+  PC_10, //D42
70
+  PC_11, //D43
71
+  PC_12, //D44
72
+  PC_13, //D45
73
+  PC_14, //D46
74
+  PC_15, //D47
75
+  PD_0,  //D48
76
+  PD_1,  //D49
77
+  PD_2,  //D50
78
+  PD_3,  //D51
79
+  PD_4,  //D52
80
+  PD_5,  //D53
81
+  PD_6,  //D54
82
+  PD_7,  //D55
83
+  PD_8,  //D56
84
+  PD_9,  //D57
85
+  PD_10, //D58
86
+  PD_11, //D59
87
+  PD_12, //D60
88
+  PD_13, //D61
89
+  PD_14, //D62
90
+  PD_15, //D63
91
+  PE_0,  //D64
92
+  PE_1,  //D65
93
+  PE_2,  //D66
94
+  PE_3,  //D67
95
+  PE_4,  //D68
96
+  PE_5,  //D69
97
+  PE_6,  //D70
98
+  PE_7,  //D71
99
+  PE_8,  //D72
100
+  PE_9,  //D73
101
+  PE_10, //D74
102
+  PE_11, //D75
103
+  PE_12, //D76
104
+  PE_13, //D77
105
+  PE_14, //D78
106
+  PE_15  //D79
107
+};
108
+
109
+// Analog (Ax) pin number array
110
+const uint32_t analogInputPin[] = {
111
+  3,  //D3   //A0
112
+  4,  //D4   //A1
113
+  32, //D32  //A2
114
+  33, //D33  //A3
115
+  34, //D34  //A4
116
+  35, //D35  //A5
117
+  36, //D36  //A6
118
+  0,  //D0   //A7
119
+  1,  //D1   //A8
120
+  2,  //D2   //A9
121
+  5,  //D5   //A10
122
+  6,  //D6   //A11
123
+  7,  //D7   //A12
124
+  16, //D16  //A13
125
+  17, //D17  //A14
126
+  37  //D37  //A15
127
+};
128
+
129
+#ifdef __cplusplus
130
+}
131
+#endif
132
+
133
+// ----------------------------------------------------------------------------
134
+
135
+#ifdef __cplusplus
136
+extern "C" {
137
+#endif
138
+
139
+/**
140
+  * @brief  System Clock Configuration
141
+  *         The system Clock is configured as follow :
142
+  *            System Clock source            = PLL (HSE)
143
+  *            SYSCLK(Hz)                     = 168000000
144
+  *            HCLK(Hz)                       = 168000000
145
+  *            AHB Prescaler                  = 1
146
+  *            APB1 Prescaler                 = 4
147
+  *            APB2 Prescaler                 = 2
148
+  *            HSE Frequency(Hz)              = 8000000
149
+  *            PLL_M                          = 8
150
+  *            PLL_N                          = 336
151
+  *            PLL_P                          = 2
152
+  *            PLL_Q                          = 7
153
+  *            VDD(V)                         = 3.3
154
+  *            Main regulator output voltage  = Scale1 mode
155
+  *            Flash Latency(WS)              = 5
156
+  * @param  None
157
+  * @retval None
158
+  */
159
+WEAK void SystemClock_Config(void)
160
+{
161
+  RCC_ClkInitTypeDef RCC_ClkInitStruct;
162
+  RCC_OscInitTypeDef RCC_OscInitStruct;
163
+  RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
164
+
165
+
166
+  /* Enable Power Control clock */
167
+  __HAL_RCC_PWR_CLK_ENABLE();
168
+
169
+#ifdef HAL_PWR_MODULE_ENABLED
170
+  /* The voltage scaling allows optimizing the power consumption when the device is
171
+     clocked below the maximum system frequency, to update the voltage scaling value
172
+     regarding system frequency refer to product datasheet.  */
173
+  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
174
+#endif
175
+
176
+  /* Enable HSE Oscillator and activate PLL with HSE as source */
177
+  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
178
+  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
179
+  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
180
+  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
181
+  RCC_OscInitStruct.PLL.PLLM = 6;
182
+  RCC_OscInitStruct.PLL.PLLN = 180;
183
+  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
184
+  RCC_OscInitStruct.PLL.PLLQ = 7;
185
+  RCC_OscInitStruct.PLL.PLLR = 2;
186
+  HAL_RCC_OscConfig(&RCC_OscInitStruct);
187
+
188
+  HAL_PWREx_EnableOverDrive();
189
+
190
+  /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
191
+     clocks dividers */
192
+  RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK |
193
+                                 RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
194
+  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLRCLK;
195
+  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
196
+  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
197
+  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
198
+  HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5);
199
+
200
+  PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CLK48;
201
+  PeriphClkInitStruct.PLLSAI.PLLSAIM = 6;
202
+  PeriphClkInitStruct.PLLSAI.PLLSAIN = 96;
203
+  PeriphClkInitStruct.PLLSAI.PLLSAIQ = 2;
204
+  PeriphClkInitStruct.PLLSAI.PLLSAIP = RCC_PLLSAIP_DIV4;
205
+  PeriphClkInitStruct.PLLSAIDivQ = 1;
206
+  PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48CLKSOURCE_PLLSAIP;
207
+  HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
208
+}
209
+
210
+#ifdef __cplusplus
211
+}
212
+#endif

+ 186
- 0
buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.h View File

@@ -0,0 +1,186 @@
1
+/*
2
+  Copyright (c) 2011 Arduino.  All right reserved.
3
+
4
+  This library is free software; you can redistribute it and/or
5
+  modify it under the terms of the GNU Lesser General Public
6
+  License as published by the Free Software Foundation; either
7
+  version 2.1 of the License, or (at your option) any later version.
8
+
9
+  This library is distributed in the hope that it will be useful,
10
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+  See the GNU Lesser General Public License for more details.
13
+
14
+  You should have received a copy of the GNU Lesser General Public
15
+  License along with this library; if not, write to the Free Software
16
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
+*/
18
+
19
+#ifndef _VARIANT_ARDUINO_STM32_
20
+#define _VARIANT_ARDUINO_STM32_
21
+
22
+#ifdef __cplusplus
23
+extern "C" {
24
+#endif // __cplusplus
25
+
26
+/*----------------------------------------------------------------------------
27
+ *        Pins
28
+ *----------------------------------------------------------------------------*/
29
+
30
+#define PA0   PIN_A7  //D0
31
+#define PA1   PIN_A8  //D1
32
+#define PA2   PIN_A9  //D2
33
+#define PA3   PIN_A0  //D3
34
+#define PA4   PIN_A1  //D4
35
+#define PA5   PIN_A10 //D5
36
+#define PA6   PIN_A11 //D6
37
+#define PA7   PIN_A12 //D7
38
+#define PA8   8   //D8
39
+#define PA9   9   //D9
40
+#define PA10  10  //D10
41
+#define PA11  11  //D11
42
+#define PA12  12  //D12
43
+#define PA13  13  //D13
44
+#define PA14  14  //D14
45
+#define PA15  15  //D15
46
+#define PB0   PIN_A13 //D16
47
+#define PB1   PIN_A14 //D17
48
+#define PB2   18  //D18
49
+#define PB3   19  //D19
50
+#define PB4   20  //D20
51
+#define PB5   21  //D21
52
+#define PB6   22  //D22
53
+#define PB7   23  //D23
54
+#define PB8   24  //D24
55
+#define PB9   25  //D25
56
+#define PB10  26  //D26
57
+#define PB11  27  //D27
58
+#define PB12  28  //D28
59
+#define PB13  29  //D29
60
+#define PB14  30  //D30
61
+#define PB15  31  //D31
62
+#define PC0   PIN_A2  //D32
63
+#define PC1   PIN_A3  //D33
64
+#define PC2   PIN_A4  //D34
65
+#define PC3   PIN_A5  //D35
66
+#define PC4   PIN_A6  //D36
67
+#define PC5   PIN_A15 //D37
68
+#define PC6   38  //D38
69
+#define PC7   39  //D39
70
+#define PC8   40  //D40
71
+#define PC9   41  //D41
72
+#define PC10  42  //D42
73
+#define PC11  43  //D43
74
+#define PC12  44  //D44
75
+#define PC13  45  //D45
76
+#define PC14  46  //D46
77
+#define PC15  47  //D47
78
+#define PD0   48  //D48
79
+#define PD1   49  //D49
80
+#define PD2   50  //D50
81
+#define PD3   51  //D51
82
+#define PD4   52  //D52
83
+#define PD5   53  //D53
84
+#define PD6   54  //D54
85
+#define PD7   55  //D55
86
+#define PD8   56  //D56
87
+#define PD9   57  //D57
88
+#define PD10  58  //D58
89
+#define PD11  59  //D59
90
+#define PD12  60  //D60
91
+#define PD13  61  //D61
92
+#define PD14  62  //D62
93
+#define PD15  63  //D63
94
+#define PE0   64  //D64
95
+#define PE1   65  //D65
96
+#define PE2   66  //D66
97
+#define PE3   67  //D67
98
+#define PE4   68  //D68
99
+#define PE5   69  //D69
100
+#define PE6   70  //D70
101
+#define PE7   71  //D71
102
+#define PE8   72  //D72
103
+#define PE9   73  //D73
104
+#define PE10  74  //D74
105
+#define PE11  75  //D75
106
+#define PE12  76  //D76
107
+#define PE13  77  //D77
108
+#define PE14  78  //D78
109
+#define PE15  79  //D79
110
+
111
+// This must be a literal
112
+#define NUM_DIGITAL_PINS        80
113
+// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
114
+#define NUM_ANALOG_INPUTS       16
115
+
116
+// PWM resolution
117
+#define PWM_FREQUENCY           20000 // >= 20 Khz => inaudible noise for fans
118
+#define PWM_MAX_DUTY_CYCLE      255
119
+
120
+// On-board LED pin number
121
+#define LED_BUILTIN             PB14
122
+#define LED_HEARTBEAT           LED_BUILTIN
123
+
124
+// SPI Definitions
125
+#define PIN_SPI_SS              PA4
126
+#define PIN_SPI_MOSI            PA7
127
+#define PIN_SPI_MISO            PA6
128
+#define PIN_SPI_SCK             PA5
129
+
130
+// I2C Definitions
131
+#define PIN_WIRE_SDA            PB9
132
+#define PIN_WIRE_SCL            PB8
133
+
134
+// Timer Definitions
135
+// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
136
+#ifndef TIMER_TONE
137
+#define TIMER_TONE              TIM6
138
+#endif
139
+
140
+#ifndef TIMER_SERVO
141
+#define TIMER_SERVO             TIM7
142
+#endif
143
+
144
+#ifndef TIMER_SERIAL
145
+#define TIMER_SERIAL            TIM9
146
+#endif
147
+
148
+// UART Definitions
149
+#define SERIAL_UART_INSTANCE    1 // Connected to EXP3 header
150
+
151
+// Default pin used for 'Serial' instance (ex: ST-Link)
152
+// Mandatory for Firmata
153
+#define PIN_SERIAL_RX           PA10
154
+#define PIN_SERIAL_TX           PA9
155
+
156
+/* HAL configuration */
157
+#define HSE_VALUE               12000000U
158
+
159
+#ifdef __cplusplus
160
+} // extern "C"
161
+#endif
162
+/*----------------------------------------------------------------------------
163
+ *        Arduino objects - C++ only
164
+ *----------------------------------------------------------------------------*/
165
+
166
+#ifdef __cplusplus
167
+  // These serial port names are intended to allow libraries and architecture-neutral
168
+  // sketches to automatically default to the correct port name for a particular type
169
+  // of use.  For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
170
+  // the first hardware serial port whose RX/TX pins are not dedicated to another use.
171
+  //
172
+  // SERIAL_PORT_MONITOR        Port which normally prints to the Arduino Serial Monitor
173
+  //
174
+  // SERIAL_PORT_USBVIRTUAL     Port which is USB virtual serial
175
+  //
176
+  // SERIAL_PORT_LINUXBRIDGE    Port which connects to a Linux system via Bridge library
177
+  //
178
+  // SERIAL_PORT_HARDWARE       Hardware serial port, physical RX & TX pins.
179
+  //
180
+  // SERIAL_PORT_HARDWARE_OPEN  Hardware serial ports which are open for use.  Their RX & TX
181
+  //                            pins are NOT connected to anything by default.
182
+  #define SERIAL_PORT_MONITOR     Serial
183
+  #define SERIAL_PORT_HARDWARE_OPEN  Serial
184
+#endif
185
+
186
+#endif /* _VARIANT_ARDUINO_STM32_ */

+ 15
- 6
ini/stm32f4.ini View File

@@ -277,17 +277,26 @@ build_flags       = ${stm_flash_drive.build_flags}
277 277
 # RUMBA32
278 278
 #
279 279
 [env:rumba32]
280
-platform        = ${common_stm32.platform}
281
-extends         = common_stm32
282
-build_flags     = ${common_stm32.build_flags}
280
+platform             = ${common_stm32.platform}
281
+extends              = common_stm32
282
+build_flags          = ${common_stm32.build_flags}
283 283
   -Os
284 284
   -DHAL_PCD_MODULE_ENABLED
285 285
   -DDISABLE_GENERIC_SERIALUSB
286 286
   -DHAL_UART_MODULE_ENABLED
287 287
   -DTIMER_SERIAL=TIM9
288
-board           = rumba32_f446ve
289
-upload_protocol = dfu
290
-monitor_speed   = 500000
288
+board                = rumba32_f446ve
289
+upload_protocol      = dfu
290
+monitor_speed        = 500000
291
+board_build.core     = stm32
292
+board_build.variant  = MARLIN_F446VE
293
+board_build.ldscript = ldscript.ld
294
+board_build.offset   = 0x0000
295
+board_build.encrypt  = No
296
+board_build.firmware = firmware.bin
297
+extra_scripts        = ${common.extra_scripts}
298
+  pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
299
+  buildroot/share/PlatformIO/scripts/stm32_bootloader.py
291 300
 
292 301
 #
293 302
 # MKS Robin Pro V2

Loading…
Cancel
Save