Bläddra i källkod

🐛 Fix Longer3D STM32 boot, add Maple test (#22473)

Tanguy Pruvot 2 år sedan
förälder
incheckning
0e065579aa
Inget konto är kopplat till bidragsgivarens mejladress

+ 2
- 1
.github/workflows/test-builds.yml Visa fil

@@ -61,7 +61,7 @@ jobs:
61 61
         - STM32F103RC_fysetc
62 62
         - STM32F103RC_meeb
63 63
         - jgaurora_a5s_a1
64
-        - STM32F103VE_longer
64
+        - STM32F103VE_longer_maple
65 65
         #- mks_robin_maple
66 66
         - mks_robin_lite
67 67
         - mks_robin_pro
@@ -75,6 +75,7 @@ jobs:
75 75
         - STM32F103RE_btt
76 76
         - STM32F103RE_btt_USB
77 77
         - STM32F103RET6_creality
78
+        - STM32F103VE_longer
78 79
         - STM32F407VE_black
79 80
         - STM32F401VE_STEVAL
80 81
         - BIGTREE_BTT002

+ 8
- 1
Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h Visa fil

@@ -99,12 +99,19 @@
99 99
 // Avoid nozzle heat and fan start before serial init
100 100
 #define BOARD_OPENDRAIN_MOSFETS
101 101
 
102
-#define BOARD_PREINIT() { \
102
+#define BOARD_INIT_OD_PINS() { \
103 103
   OUT_WRITE_OD(HEATER_0_PIN, 0); \
104 104
   OUT_WRITE_OD(HEATER_BED_PIN, 0); \
105 105
   OUT_WRITE_OD(FAN_PIN, 0); \
106 106
 }
107 107
 
108
+#ifdef MAPLE_STM32F1
109
+  // Only Maple Framework allow that early
110
+  #define BOARD_PREINIT BOARD_INIT_OD_PINS
111
+#else
112
+  #define BOARD_INIT BOARD_INIT_OD_PINS
113
+#endif
114
+
108 115
 //
109 116
 // PWM for a servo probe
110 117
 // Other servo devices are not supported on this board!

+ 289
- 0
buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/PeripheralPins.c Visa fil

@@ -0,0 +1,289 @@
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 STM32F103V(F-G)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
+  {NC,    NP,    0}
34
+};
35
+#endif
36
+
37
+//*** DAC ***
38
+
39
+#if defined(STM32F103xE) || defined(STM32F103xG)
40
+#ifdef HAL_DAC_MODULE_ENABLED
41
+WEAK const PinMap PinMap_DAC[] = {
42
+//{PA_4,  DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1
43
+//{PA_5,  DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2
44
+  {NC,    NP,    0}
45
+};
46
+#endif
47
+#endif
48
+
49
+//*** I2C ***
50
+
51
+#ifdef HAL_I2C_MODULE_ENABLED
52
+WEAK const PinMap PinMap_I2C_SDA[] = {
53
+  {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, AFIO_NONE)},
54
+  {NC,    NP,    0}
55
+};
56
+
57
+WEAK const PinMap PinMap_I2C_SCL[] = {
58
+  {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, AFIO_NONE)},
59
+  {NC,    NP,    0}
60
+};
61
+#endif
62
+
63
+//*** PWM ***
64
+
65
+#ifdef HAL_TIM_MODULE_ENABLED
66
+WEAK const PinMap PinMap_PWM[] = {
67
+#if 0
68
+  {PA_0,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM2_CH1
69
+  //{PA_0,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_2, 1, 0)}, // TIM2_CH1
70
+#if defined(STM32F103xE) || defined(STM32F103xG)
71
+  //{PA_0,  TIM5,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM5_CH1
72
+#endif
73
+  {PA_1,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 2, 0)}, // TIM2_CH2
74
+  //{PA_1,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_2, 2, 0)}, // TIM2_CH2
75
+#if defined(STM32F103xE) || defined(STM32F103xG)
76
+  //{PA_1,  TIM5,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 2, 0)}, // TIM5_CH2
77
+#endif
78
+  {PA_2,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 3, 0)}, // TIM2_CH3
79
+  //{PA_2,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_1, 3, 0)}, // TIM2_CH3
80
+#if defined(STM32F103xE) || defined(STM32F103xG)
81
+  //{PA_2,  TIM5,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 3, 0)}, // TIM5_CH3
82
+#endif
83
+#ifdef STM32F103xG
84
+  //{PA_2,  TIM9,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM9_CH1
85
+#endif
86
+  //{PA_3,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_1, 4, 0)}, // TIM2_CH4
87
+#if defined(STM32F103xE) || defined(STM32F103xG)
88
+  //{PA_3,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 4, 0)}, // TIM2_CH4
89
+  {PA_3,  TIM5,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 4, 0)}, // TIM5_CH4
90
+#else
91
+  {PA_3,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 4, 0)}, // TIM2_CH4
92
+#endif
93
+#if defined(STM32F103xG)
94
+  //{PA_3,  TIM9,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 2, 0)}, // TIM9_CH2
95
+#endif
96
+  {PA_6,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM3_CH1
97
+#if defined(STM32F103xG)
98
+  //{PA_6,  TIM13,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM13_CH1
99
+#endif
100
+  {PA_7,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_PARTIAL, 1, 1)}, // TIM1_CH1N
101
+  //{PA_7,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 2, 0)}, // TIM3_CH2
102
+  //{PA_7,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 1)}, // TIM8_CH1N
103
+#if defined(STM32F103xG)
104
+  //{PA_7,  TIM14,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM14_CH1
105
+#endif
106
+  {PA_8,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM1_CH1
107
+  //{PA_8,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_PARTIAL, 1, 0)}, // TIM1_CH1
108
+  {PA_9,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 2, 0)}, // TIM1_CH2
109
+  //{PA_9,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_PARTIAL, 2, 0)}, // TIM1_CH2
110
+  {PA_10, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 3, 0)}, // TIM1_CH3
111
+  //{PA_10, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_PARTIAL, 3, 0)}, // TIM1_CH3
112
+  {PA_11, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 4, 0)}, // TIM1_CH4
113
+  //{PA_11, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_PARTIAL, 4, 0)}, // TIM1_CH4
114
+  {PA_15, TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_1, 1, 0)}, // TIM2_CH1
115
+  //{PA_15, TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_ENABLE, 1, 0)}, // TIM2_CH1
116
+  //{PB_0,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_PARTIAL, 2, 1)}, // TIM1_CH2N
117
+  {PB_0,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 3, 0)}, // TIM3_CH3
118
+  //{PB_0,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM3_PARTIAL, 3, 0)}, // TIM3_CH3
119
+#if defined(STM32F103xE) || defined(STM32F103xG)
120
+  //{PB_0,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 2, 1)}, // TIM8_CH2N
121
+#endif
122
+  {PB_1,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_PARTIAL, 3, 1)}, // TIM1_CH3N
123
+  //{PB_1,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 4, 0)}, // TIM3_CH4
124
+  //{PB_1,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM3_PARTIAL, 4, 0)}, // TIM3_CH4
125
+#if defined(STM32F103xE) || defined(STM32F103xG)
126
+  //{PB_1,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 3, 1)}, // TIM8_CH3N
127
+#endif
128
+  {PB_3,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_1, 2, 0)}, // TIM2_CH2
129
+  //{PB_3,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_ENABLE, 2, 0)}, // TIM2_CH2
130
+  {PB_4,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM3_PARTIAL, 1, 0)}, // TIM3_CH1
131
+  {PB_5,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM3_PARTIAL, 2, 0)}, // TIM3_CH2
132
+  {PB_6,  TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM4_CH1
133
+  {PB_7,  TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 2, 0)}, // TIM4_CH2
134
+  {PB_8,  TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 3, 0)}, // TIM4_CH3
135
+#if defined(STM32F103xG)
136
+  //{PB_8,  TIM10,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM10_CH1
137
+#endif
138
+  {PB_9,  TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 4, 0)}, // TIM4_CH4
139
+#if defined(STM32F103xG)
140
+  //{PB_9,  TIM11,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM11_CH1
141
+#endif
142
+  {PB_10, TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_2, 3, 0)}, // TIM2_CH3
143
+  //{PB_10, TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_ENABLE, 3, 0)}, // TIM2_CH3
144
+  {PB_11, TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_2, 4, 0)}, // TIM2_CH4
145
+  //{PB_11, TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_ENABLE, 4, 0)}, // TIM2_CH4
146
+  {PB_13, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 1)}, // TIM1_CH1N
147
+  {PB_14, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 2, 1)}, // TIM1_CH2N
148
+#if defined(STM32F103xG)
149
+  //{PB_14, TIM12,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM12_CH1
150
+#endif
151
+  {PB_15, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 3, 1)}, // TIM1_CH3N
152
+#if defined(STM32F103xG)
153
+  //{PB_15, TIM12,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 2, 0)}, // TIM12_CH2
154
+#endif
155
+  {PC_6,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM3_ENABLE, 1, 0)}, // TIM3_CH1
156
+#if defined(STM32F103xE) || defined(STM32F103xG)
157
+  //{PC_6,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM8_CH1
158
+#endif
159
+  {PC_7,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM3_ENABLE, 2, 0)}, // TIM3_CH2
160
+#if defined(STM32F103xE) || defined(STM32F103xG)
161
+  //{PC_7,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 2, 0)}, // TIM8_CH2
162
+#endif
163
+  {PC_8,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM3_ENABLE, 3, 0)}, // TIM3_CH3
164
+  //{PC_8,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 3, 0)}, // TIM8_CH3
165
+  {PC_9,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM3_ENABLE, 4, 0)}, // TIM3_CH4
166
+#if defined(STM32F103xE) || defined(STM32F103xG)
167
+  //{PC_9,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 4, 0)}, // TIM8_CH4
168
+#endif
169
+  {PD_12, TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM4_ENABLE, 1, 0)}, // TIM4_CH1
170
+  {PD_13, TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM4_ENABLE, 2, 0)}, // TIM4_CH2
171
+  {PD_14, TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM4_ENABLE, 3, 0)}, // TIM4_CH3
172
+  {PD_15, TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM4_ENABLE, 4, 0)}, // TIM4_CH4
173
+#if defined(STM32F103xG)
174
+  {PE_5,  TIM9,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM9_ENABLE, 1, 0)}, // TIM9_CH1
175
+  {PE_6,  TIM9,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM9_ENABLE, 2, 0)}, // TIM9_CH2
176
+#endif
177
+  {PE_8,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_ENABLE, 1, 1)}, // TIM1_CH1N
178
+  {PE_9,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_ENABLE, 1, 0)}, // TIM1_CH1
179
+  {PE_10, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_ENABLE, 2, 1)}, // TIM1_CH2N
180
+  {PE_11, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_ENABLE, 2, 0)}, // TIM1_CH2
181
+  {PE_12, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_ENABLE, 3, 1)}, // TIM1_CH3N
182
+  {PE_13, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_ENABLE, 3, 0)}, // TIM1_CH3
183
+  {PE_14, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_ENABLE, 4, 0)}, // TIM1_CH4
184
+#endif // if 0
185
+  {NC,    NP,    0}
186
+};
187
+#endif
188
+
189
+//*** SERIAL ***
190
+
191
+#ifdef HAL_UART_MODULE_ENABLED
192
+WEAK const PinMap PinMap_UART_TX[] = {
193
+  {PA_2,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
194
+  {PA_9,  USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
195
+//{PB_10, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
196
+  {NC,    NP,    0}
197
+};
198
+
199
+WEAK const PinMap PinMap_UART_RX[] = {
200
+  {PA_3,  USART2,  STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLUP, AFIO_NONE)},
201
+  {PA_10, USART1,  STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLUP, AFIO_NONE)},
202
+//{PB_11, USART3,  STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLUP, AFIO_NONE)},
203
+  {NC,    NP,    0}
204
+};
205
+
206
+WEAK const PinMap PinMap_UART_RTS[] = {
207
+  {NC,    NP,    0}
208
+};
209
+
210
+WEAK const PinMap PinMap_UART_CTS[] = {
211
+  {NC,    NP,    0}
212
+};
213
+#endif
214
+
215
+//*** SPI ***
216
+
217
+WEAK const PinMap PinMap_SPI_MOSI[] = {
218
+  {PA_7,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
219
+//{PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
220
+  {NC,    NP,    0}
221
+};
222
+
223
+WEAK const PinMap PinMap_SPI_MISO[] = {
224
+  {PA_6,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
225
+//{PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
226
+  {NC,    NP,    0}
227
+};
228
+
229
+WEAK const PinMap PinMap_SPI_SCLK[] = {
230
+  {PA_5,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
231
+//{PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
232
+  {NC,    NP,    0}
233
+};
234
+
235
+WEAK const PinMap PinMap_SPI_SSEL[] = {
236
+//{PA_4,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
237
+//{PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
238
+  {NC,    NP,    0}
239
+};
240
+
241
+//*** No CAN ***
242
+
243
+#ifdef HAL_CAN_MODULE_ENABLED
244
+WEAK const PinMap PinMap_CAN_RD[] = {
245
+  {NC,    NP,    0}
246
+};
247
+
248
+WEAK const PinMap PinMap_CAN_TD[] = {
249
+  {NC,    NP,    0}
250
+};
251
+#endif
252
+
253
+//*** No ETHERNET ***
254
+
255
+//*** No QUADSPI ***
256
+
257
+//*** USB ***
258
+
259
+#ifdef HAL_PCD_MODULE_ENABLED
260
+WEAK const PinMap PinMap_USB[] = {
261
+  {PA_11, USB, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, AFIO_NONE)}, // USB_DM
262
+  {PA_12, USB, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, AFIO_NONE)}, // USB_DP
263
+  {NC,    NP,    0}
264
+};
265
+#endif
266
+
267
+//*** No USB_OTG_FS ***
268
+
269
+//*** No USB_OTG_HS ***
270
+
271
+//*** SD ***
272
+
273
+#if defined(STM32F103xE) || defined(STM32F103xG)
274
+#ifdef HAL_SD_MODULE_ENABLED
275
+WEAK const PinMap PinMap_SD[] = {
276
+//{PB_8,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)}, // SDIO_D4
277
+//{PB_9,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)}, // SDIO_D5
278
+//{PC_6,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)}, // SDIO_D6
279
+//{PC_7,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)}, // SDIO_D7
280
+  {PC_8,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)}, // SDIO_D0
281
+  {PC_9,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)}, // SDIO_D1
282
+  {PC_10, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)}, // SDIO_D2
283
+  {PC_11, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)}, // SDIO_D3
284
+  {PC_12, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, AFIO_NONE)}, // SDIO_CK
285
+  {PD_2,  SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, AFIO_NONE)}, // SDIO_CMD
286
+  {NC,    NP,    0}
287
+};
288
+#endif
289
+#endif

+ 32
- 0
buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/PinNamesVar.h Visa fil

@@ -0,0 +1,32 @@
1
+/* SYS_WKUP */
2
+#if defined(PWR_WAKEUP_PIN1) && defined(HAL_PWR_MODULE_ENABLED) && !defined(HAL_PWR_MODULE_ONLY)
3
+  #error PA0 is used by thermal sensor, disable low power wake with -DHAL_PWR_MODULE_ONLY
4
+  SYS_WKUP1 = PA_0,
5
+#endif
6
+#ifdef PWR_WAKEUP_PIN2
7
+  SYS_WKUP2 = NC,
8
+#endif
9
+#ifdef PWR_WAKEUP_PIN3
10
+  SYS_WKUP3 = NC,
11
+#endif
12
+#ifdef PWR_WAKEUP_PIN4
13
+  SYS_WKUP4 = NC,
14
+#endif
15
+#ifdef PWR_WAKEUP_PIN5
16
+  SYS_WKUP5 = NC,
17
+#endif
18
+#ifdef PWR_WAKEUP_PIN6
19
+  SYS_WKUP6 = NC,
20
+#endif
21
+#ifdef PWR_WAKEUP_PIN7
22
+  SYS_WKUP7 = NC,
23
+#endif
24
+#ifdef PWR_WAKEUP_PIN8
25
+  SYS_WKUP8 = NC,
26
+#endif
27
+/* USB */
28
+#ifdef USBCON
29
+  #warning USB feature is not required with a CH340 chip
30
+  USB_DM = PA_11,
31
+  USB_DP = PA_12,
32
+#endif

+ 348
- 0
buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/hal_conf_custom.h Visa fil

@@ -0,0 +1,348 @@
1
+/**
2
+  ******************************************************************************
3
+  * @file    hal_conf_custom.h for Longer3D STM32F103VE board
4
+  * @brief   Overrides HAL default configuration file.
5
+  ******************************************************************************
6
+  */
7
+#pragma once
8
+
9
+#ifdef __cplusplus
10
+extern "C" {
11
+#endif
12
+
13
+/* Exported types ------------------------------------------------------------*/
14
+/* Exported constants --------------------------------------------------------*/
15
+
16
+/* ########################## Module Selection ############################## */
17
+/**
18
+  * @brief Include the default list of modules to be used in the HAL driver
19
+  *        and manage module deactivation
20
+  */
21
+#include "stm32yyxx_hal_conf.h"
22
+
23
+#ifdef HAL_PWR_MODULE_ENABLED
24
+  #undef HAL_PWR_MODULE_ENABLED // only way to disable it
25
+#endif
26
+
27
+#if defined(HAL_PWR_MODULE_ENABLED) && !defined(HAL_PWR_MODULE_ONLY)
28
+  #define HAL_PWR_MODULE_ONLY // disable low power & PA0 wakeup pin (its T°c pin)
29
+#endif
30
+
31
+#ifndef HAL_IWDG_MODULE_ENABLED
32
+  #define HAL_IWDG_MODULE_ENABLED // USE_WATCHDOG
33
+#endif
34
+
35
+#ifdef HAL_PCD_MODULE_ENABLED
36
+  #warning No direct STM32 USB pins on Longer3D board
37
+  #undef HAL_PCD_MODULE_ENABLED // USB Device
38
+#endif
39
+
40
+#ifdef HAL_HCD_MODULE_ENABLED
41
+  #warning No direct STM32 USB pins on Longer3D board
42
+  #undef HAL_HCD_MODULE_ENABLED // USB Host
43
+#endif
44
+
45
+#ifndef HAL_USART_MODULE_ENABLED
46
+  //#define HAL_USART_MODULE_ENABLED // Useless.... UART_MODULE do it
47
+#endif
48
+
49
+#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
50
+  #undef HAL_CAN_LEGACY_MODULE_ENABLED
51
+#endif
52
+
53
+#ifdef HAL_CAN_MODULE_ENABLED
54
+  #undef HAL_CAN_MODULE_ENABLED
55
+#endif
56
+
57
+#ifdef HAL_DAC_MODULE_ENABLED
58
+  #undef HAL_DAC_MODULE_ENABLED
59
+#endif
60
+
61
+#ifdef HAL_RTC_MODULE_ENABLED
62
+  #undef HAL_RTC_MODULE_ENABLED
63
+#endif
64
+
65
+#ifndef HAL_EXTI_MODULE_ENABLED
66
+  #define HAL_EXTI_MODULE_ENABLED // for ENDSTOP_INTERRUPTS_FEATURE
67
+#endif
68
+
69
+/**
70
+  * @brief List of modules in the framework (first ones enabled by default)
71
+  */
72
+//#define HAL_MODULE_ENABLED
73
+//#define HAL_ADC_MODULE_ENABLED
74
+//#define HAL_CORTEX_MODULE_ENABLED
75
+//#define HAL_DAC_MODULE_ENABLED
76
+//#define HAL_DMA_MODULE_ENABLED
77
+//#define HAL_FLASH_MODULE_ENABLED
78
+//#define HAL_GPIO_MODULE_ENABLED
79
+//#define HAL_I2C_MODULE_ENABLED
80
+//#define HAL_PCD_MODULE_ENABLED
81
+//#define HAL_PWR_MODULE_ENABLED
82
+//#define HAL_RCC_MODULE_ENABLED
83
+//#define HAL_RTC_MODULE_ENABLED
84
+//#define HAL_SD_MODULE_ENABLED
85
+//#define HAL_SPI_MODULE_ENABLED
86
+//#define HAL_SRAM_MODULE_ENABLED
87
+//#define HAL_TIM_MODULE_ENABLED
88
+//#define HAL_UART_MODULE_ENABLED
89
+
90
+//#define HAL_CAN_MODULE_ENABLED
91
+//#define HAL_CAN_LEGACY_MODULE_ENABLED
92
+//#define HAL_CEC_MODULE_ENABLED
93
+//#define HAL_CRC_MODULE_ENABLED
94
+//#define HAL_ETH_MODULE_ENABLED
95
+//#define HAL_EXTI_MODULE_ENABLED
96
+//#define HAL_HCD_MODULE_ENABLED
97
+//#define HAL_I2S_MODULE_ENABLED
98
+//#define HAL_IRDA_MODULE_ENABLED
99
+//#define HAL_IWDG_MODULE_ENABLED
100
+//#define HAL_NAND_MODULE_ENABLED
101
+//#define HAL_NOR_MODULE_ENABLED
102
+//#define HAL_PCCARD_MODULE_ENABLED
103
+//#define HAL_SMARTCARD_MODULE_ENABLED
104
+//#define HAL_USART_MODULE_ENABLED
105
+//#define HAL_WWDG_MODULE_ENABLED
106
+//#define HAL_MMC_MODULE_ENABLED
107
+
108
+/* ########################## Oscillator Values adaptation ####################*/
109
+/**
110
+  * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
111
+  *        This value is used by the RCC HAL module to compute the system frequency
112
+  *        (when HSE is used as system clock source, directly or through the PLL).
113
+  */
114
+#ifndef HSE_VALUE
115
+  #define HSE_VALUE            8000000U  // Value of the External oscillator in Hz (8 MHz)
116
+#endif
117
+
118
+#ifndef HSE_STARTUP_TIMEOUT
119
+  #define HSE_STARTUP_TIMEOUT  100U      // Time out for HSE start up, in ms
120
+#endif
121
+
122
+/**
123
+  * @brief Internal High Speed oscillator (HSI) value.
124
+  *        This value is used by the RCC HAL module to compute the system frequency
125
+  *        (when HSI is used as system clock source, directly or through the PLL).
126
+  */
127
+#ifndef HSI_VALUE
128
+  #define HSI_VALUE            8000000U  // Value of the Internal oscillator in Hz
129
+#endif
130
+
131
+/**
132
+  * @brief Internal Low Speed oscillator (LSI) value.
133
+  */
134
+#ifndef LSI_VALUE
135
+  #define LSI_VALUE            40000U    // LSI Typical Value in Hz
136
+#endif                                   /*!< Value of the Internal Low Speed oscillator in Hz
137
+                                              The real value may vary depending on the variations
138
+                                              in voltage and temperature. */
139
+/**
140
+  * @brief External Low Speed oscillator (LSE) value.
141
+  *        This value is used by the UART, RTC HAL module to compute the system frequency
142
+  */
143
+#ifndef LSE_VALUE
144
+  #define LSE_VALUE            32768U    // Value of the External Low Speed oscillator in Hz
145
+#endif
146
+
147
+#ifndef LSE_STARTUP_TIMEOUT
148
+  #define LSE_STARTUP_TIMEOUT  50U       // No 32.7KHz LSE on this board, reduced to avoid delays
149
+#endif
150
+
151
+/* Tip: To avoid modifying this file each time you need to use different HSE,
152
+   ===  you can define the HSE value in your toolchain compiler preprocessor. */
153
+
154
+/* ########################### System Configuration ######################### */
155
+/**
156
+  * @brief This is the HAL system configuration section
157
+  */
158
+#ifndef VDD_VALUE
159
+  #define VDD_VALUE            3300U     // Value of VDD in mv
160
+#endif
161
+#ifndef TICK_INT_PRIORITY
162
+  #define  TICK_INT_PRIORITY   0x00U     // tick interrupt priority
163
+#endif
164
+#ifndef USE_RTOS
165
+  #define  USE_RTOS            0U
166
+#endif
167
+#ifndef PREFETCH_ENABLE
168
+  #define  PREFETCH_ENABLE     1U
169
+#endif
170
+
171
+#define  USE_HAL_ADC_REGISTER_CALLBACKS         0U /* ADC register callback disabled       */
172
+#define  USE_HAL_CAN_REGISTER_CALLBACKS         0U /* CAN register callback disabled       */
173
+#define  USE_HAL_CEC_REGISTER_CALLBACKS         0U /* CEC register callback disabled       */
174
+#define  USE_HAL_DAC_REGISTER_CALLBACKS         0U /* DAC register callback disabled       */
175
+#define  USE_HAL_ETH_REGISTER_CALLBACKS         0U /* ETH register callback disabled       */
176
+#define  USE_HAL_HCD_REGISTER_CALLBACKS         0U /* HCD register callback disabled       */
177
+#define  USE_HAL_I2C_REGISTER_CALLBACKS         0U /* I2C register callback disabled       */
178
+#define  USE_HAL_I2S_REGISTER_CALLBACKS         0U /* I2S register callback disabled       */
179
+#define  USE_HAL_MMC_REGISTER_CALLBACKS         0U /* MMC register callback disabled       */
180
+#define  USE_HAL_NAND_REGISTER_CALLBACKS        0U /* NAND register callback disabled      */
181
+#define  USE_HAL_NOR_REGISTER_CALLBACKS         0U /* NOR register callback disabled       */
182
+#define  USE_HAL_PCCARD_REGISTER_CALLBACKS      0U /* PCCARD register callback disabled    */
183
+#define  USE_HAL_PCD_REGISTER_CALLBACKS         0U /* PCD register callback disabled       */
184
+#define  USE_HAL_RTC_REGISTER_CALLBACKS         0U /* RTC register callback disabled       */
185
+#define  USE_HAL_SD_REGISTER_CALLBACKS          0U /* SD register callback disabled        */
186
+#define  USE_HAL_SMARTCARD_REGISTER_CALLBACKS   0U /* SMARTCARD register callback disabled */
187
+#define  USE_HAL_IRDA_REGISTER_CALLBACKS        0U /* IRDA register callback disabled      */
188
+#define  USE_HAL_SRAM_REGISTER_CALLBACKS        0U /* SRAM register callback disabled      */
189
+#define  USE_HAL_SPI_REGISTER_CALLBACKS         0U /* SPI register callback disabled       */
190
+#define  USE_HAL_TIM_REGISTER_CALLBACKS         0U /* TIM register callback disabled       */
191
+#define  USE_HAL_UART_REGISTER_CALLBACKS        0U /* UART register callback disabled      */
192
+#define  USE_HAL_USART_REGISTER_CALLBACKS       0U /* USART register callback disabled     */
193
+#define  USE_HAL_WWDG_REGISTER_CALLBACKS        0U /* WWDG register callback disabled      */
194
+
195
+/* ################## SPI peripheral configuration ########################## */
196
+
197
+/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
198
+* Activated: CRC code is present inside driver
199
+* Deactivated: CRC code cleaned from driver
200
+*/
201
+#if !defined(USE_SPI_CRC)
202
+#define USE_SPI_CRC 0
203
+#endif
204
+
205
+/* Includes ------------------------------------------------------------------*/
206
+/**
207
+  * @brief Include module's header file
208
+  */
209
+
210
+#ifdef HAL_RCC_MODULE_ENABLED
211
+  #include "stm32f1xx_hal_rcc.h"
212
+#endif /* HAL_RCC_MODULE_ENABLED */
213
+
214
+#ifdef HAL_GPIO_MODULE_ENABLED
215
+  #include "stm32f1xx_hal_gpio.h"
216
+#endif /* HAL_GPIO_MODULE_ENABLED */
217
+
218
+#ifdef HAL_EXTI_MODULE_ENABLED
219
+  #include "stm32f1xx_hal_exti.h"
220
+#endif /* HAL_EXTI_MODULE_ENABLED */
221
+
222
+#ifdef HAL_DMA_MODULE_ENABLED
223
+  #include "stm32f1xx_hal_dma.h"
224
+#endif /* HAL_DMA_MODULE_ENABLED */
225
+
226
+#ifdef HAL_ETH_MODULE_ENABLED
227
+  #include "stm32f1xx_hal_eth.h"
228
+#endif /* HAL_ETH_MODULE_ENABLED */
229
+
230
+#ifdef HAL_CAN_MODULE_ENABLED
231
+  #include "stm32f1xx_hal_can.h"
232
+#endif /* HAL_CAN_MODULE_ENABLED */
233
+
234
+#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
235
+  #include "Legacy/stm32f1xx_hal_can_legacy.h"
236
+#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
237
+
238
+#ifdef HAL_CEC_MODULE_ENABLED
239
+  #include "stm32f1xx_hal_cec.h"
240
+#endif /* HAL_CEC_MODULE_ENABLED */
241
+
242
+#ifdef HAL_CORTEX_MODULE_ENABLED
243
+  #include "stm32f1xx_hal_cortex.h"
244
+#endif /* HAL_CORTEX_MODULE_ENABLED */
245
+
246
+#ifdef HAL_ADC_MODULE_ENABLED
247
+  #include "stm32f1xx_hal_adc.h"
248
+#endif /* HAL_ADC_MODULE_ENABLED */
249
+
250
+#ifdef HAL_CRC_MODULE_ENABLED
251
+  #include "stm32f1xx_hal_crc.h"
252
+#endif /* HAL_CRC_MODULE_ENABLED */
253
+
254
+#ifdef HAL_DAC_MODULE_ENABLED
255
+  #include "stm32f1xx_hal_dac.h"
256
+#endif /* HAL_DAC_MODULE_ENABLED */
257
+
258
+#ifdef HAL_FLASH_MODULE_ENABLED
259
+  #include "stm32f1xx_hal_flash.h"
260
+#endif /* HAL_FLASH_MODULE_ENABLED */
261
+
262
+#ifdef HAL_SRAM_MODULE_ENABLED
263
+  #include "stm32f1xx_hal_sram.h"
264
+#endif /* HAL_SRAM_MODULE_ENABLED */
265
+
266
+#ifdef HAL_NOR_MODULE_ENABLED
267
+  #include "stm32f1xx_hal_nor.h"
268
+#endif /* HAL_NOR_MODULE_ENABLED */
269
+
270
+#ifdef HAL_I2C_MODULE_ENABLED
271
+  #include "stm32f1xx_hal_i2c.h"
272
+#endif /* HAL_I2C_MODULE_ENABLED */
273
+
274
+#ifdef HAL_I2S_MODULE_ENABLED
275
+  #include "stm32f1xx_hal_i2s.h"
276
+#endif /* HAL_I2S_MODULE_ENABLED */
277
+
278
+#ifdef HAL_IWDG_MODULE_ENABLED
279
+  #include "stm32f1xx_hal_iwdg.h"
280
+#endif /* HAL_IWDG_MODULE_ENABLED */
281
+
282
+#ifdef HAL_PWR_MODULE_ENABLED
283
+  #include "stm32f1xx_hal_pwr.h"
284
+#endif /* HAL_PWR_MODULE_ENABLED */
285
+
286
+#ifdef HAL_RTC_MODULE_ENABLED
287
+  #include "stm32f1xx_hal_rtc.h"
288
+#endif /* HAL_RTC_MODULE_ENABLED */
289
+
290
+#ifdef HAL_PCCARD_MODULE_ENABLED
291
+  #include "stm32f1xx_hal_pccard.h"
292
+#endif /* HAL_PCCARD_MODULE_ENABLED */
293
+
294
+#ifdef HAL_SD_MODULE_ENABLED
295
+  #include "stm32f1xx_hal_sd.h"
296
+#endif /* HAL_SD_MODULE_ENABLED */
297
+
298
+#ifdef HAL_NAND_MODULE_ENABLED
299
+  #include "stm32f1xx_hal_nand.h"
300
+#endif /* HAL_NAND_MODULE_ENABLED */
301
+
302
+#ifdef HAL_SPI_MODULE_ENABLED
303
+  #include "stm32f1xx_hal_spi.h"
304
+#endif /* HAL_SPI_MODULE_ENABLED */
305
+
306
+#ifdef HAL_TIM_MODULE_ENABLED
307
+  #include "stm32f1xx_hal_tim.h"
308
+#endif /* HAL_TIM_MODULE_ENABLED */
309
+
310
+#ifdef HAL_UART_MODULE_ENABLED
311
+  #include "stm32f1xx_hal_uart.h"
312
+#endif /* HAL_UART_MODULE_ENABLED */
313
+
314
+#ifdef HAL_USART_MODULE_ENABLED
315
+  #include "stm32f1xx_hal_usart.h"
316
+#endif /* HAL_USART_MODULE_ENABLED */
317
+
318
+#ifdef HAL_IRDA_MODULE_ENABLED
319
+  #include "stm32f1xx_hal_irda.h"
320
+#endif /* HAL_IRDA_MODULE_ENABLED */
321
+
322
+#ifdef HAL_SMARTCARD_MODULE_ENABLED
323
+  #include "stm32f1xx_hal_smartcard.h"
324
+#endif /* HAL_SMARTCARD_MODULE_ENABLED */
325
+
326
+#ifdef HAL_WWDG_MODULE_ENABLED
327
+  #include "stm32f1xx_hal_wwdg.h"
328
+#endif /* HAL_WWDG_MODULE_ENABLED */
329
+
330
+#ifdef HAL_PCD_MODULE_ENABLED
331
+  #include "stm32f1xx_hal_pcd.h"
332
+#endif /* HAL_PCD_MODULE_ENABLED */
333
+
334
+#ifdef HAL_HCD_MODULE_ENABLED
335
+  #include "stm32f1xx_hal_hcd.h"
336
+#endif /* HAL_HCD_MODULE_ENABLED */
337
+
338
+#ifdef HAL_MMC_MODULE_ENABLED
339
+  #include "stm32f1xx_hal_mmc.h"
340
+#endif /* HAL_MMC_MODULE_ENABLED */
341
+
342
+
343
+#define assert_param(expr) ((void)0U)
344
+
345
+#ifdef __cplusplus
346
+}
347
+#endif
348
+

+ 189
- 0
buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/ldscript.ld Visa fil

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

+ 249
- 0
buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.cpp Visa fil

@@ -0,0 +1,249 @@
1
+/*
2
+ *******************************************************************************
3
+ * Copyright (c) 2019, 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
+ */
13
+
14
+#include "pins_arduino.h"
15
+
16
+#ifdef __cplusplus
17
+extern "C" {
18
+#endif
19
+
20
+// Digital PinName array
21
+const PinName digitalPin[] = {
22
+  PA_0,  //D0
23
+  PA_1,  //D1
24
+  PA_2,  //D2
25
+  PA_3,  //D3
26
+  PA_4,  //D4
27
+  PA_5,  //D5
28
+  PA_6,  //D6
29
+  PA_7,  //D7
30
+  PA_8,  //D8
31
+  PA_9,  //D9
32
+  PA_10, //D10
33
+  PA_11, //D11
34
+  PA_12, //D12
35
+  PA_13, //D13
36
+  PA_14, //D14
37
+  PA_15, //D15
38
+
39
+  PB_0,  //D16
40
+  PB_1,  //D17
41
+  PB_2,  //D18
42
+  PB_3,  //D19
43
+  PB_4,  //D20
44
+  PB_5,  //D21
45
+  PB_6,  //D22
46
+  PB_7,  //D23
47
+  PB_8,  //D24
48
+  PB_9,  //D25
49
+  PB_10, //D26
50
+  PB_11, //D27
51
+  PB_12, //D28
52
+  PB_13, //D29
53
+  PB_14, //D30
54
+  PB_15, //D31
55
+
56
+  PC_0,  //D32
57
+  PC_1,  //D33
58
+  PC_2,  //D34
59
+  PC_3,  //D35
60
+  PC_4,  //D36
61
+  PC_5,  //D37
62
+  PC_6,  //D38
63
+  PC_7,  //D39
64
+  PC_8,  //D40
65
+  PC_9,  //D41
66
+  PC_10, //D42
67
+  PC_11, //D43
68
+  PC_12, //D44
69
+  PC_13, //D45
70
+  PC_14, //D46
71
+  PC_15, //D47
72
+
73
+  PD_0,  //D48
74
+  PD_1,  //D49
75
+  PD_2,  //D50
76
+  PD_3,  //D51
77
+  PD_4,  //D52
78
+  PD_5,  //D53
79
+  PD_6,  //D54
80
+  PD_7,  //D55
81
+  PD_8,  //D56
82
+  PD_9,  //D57
83
+  PD_10, //D58
84
+  PD_11, //D59
85
+  PD_12, //D60
86
+  PD_13, //D61
87
+  PD_14, //D62
88
+  PD_15, //D63
89
+
90
+  PE_0,  //D64
91
+  PE_1,  //D65
92
+  PE_2,  //D66
93
+  PE_3,  //D67
94
+  PE_4,  //D68
95
+  PE_5,  //D69
96
+  PE_6,  //D70
97
+  PE_7,  //D71
98
+  PE_8,  //D72
99
+  PE_9,  //D73
100
+  PE_10, //D74
101
+  PE_11, //D75
102
+  PE_12, //D76
103
+  PE_13, //D77
104
+  PE_14, //D78
105
+  PE_15, //D79
106
+};
107
+
108
+// Analog (Ax) pin number array
109
+const uint32_t analogInputPin[] = {
110
+  0,  // A0,  PA0
111
+  1,  // A1,  PA1
112
+  2,  // A2,  PA2
113
+  3,  // A3,  PA3
114
+  4,  // A4,  PA4
115
+  5,  // A5,  PA5
116
+  6,  // A6,  PA6
117
+  7,  // A7,  PA7
118
+  16, // A8,  PB0
119
+  17, // A9,  PB1
120
+  32, // A10, PC0
121
+  33, // A11, PC1
122
+  34, // A12, PC2
123
+  35, // A13, PC3
124
+  36, // A14, PC4
125
+  37, // A15, PC5
126
+};
127
+
128
+/******************************************************************************/
129
+/*            PLL (clocked by HSE) used as System clock source                */
130
+/******************************************************************************/
131
+static bool SetSysClock_PLL_HSE(bool bypass)
132
+{
133
+  RCC_OscInitTypeDef RCC_OscInitStruct = {};
134
+  RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
135
+  RCC_PeriphCLKInitTypeDef PeriphClkInit = {};
136
+  bool ret = false;
137
+
138
+  // Initializes the CPU, AHB and APB busses clocks
139
+  RCC_OscInitStruct.OscillatorType   = RCC_OSCILLATORTYPE_HSE;
140
+  if (bypass == false) {
141
+    RCC_OscInitStruct.HSEState       = RCC_HSE_ON;
142
+  } else {
143
+    RCC_OscInitStruct.HSEState       = RCC_HSE_BYPASS;
144
+  }
145
+  RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
146
+  RCC_OscInitStruct.HSIState       = RCC_HSI_ON;
147
+  RCC_OscInitStruct.PLL.PLLState   = RCC_PLL_ON;
148
+  RCC_OscInitStruct.PLL.PLLSource  = RCC_PLLSOURCE_HSE;
149
+  RCC_OscInitStruct.PLL.PLLMUL     = RCC_PLL_MUL9; // 8Mhz x 9 = 72MHz
150
+
151
+  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) == HAL_OK) {
152
+    // Initializes the CPU, AHB and APB busses clocks
153
+    RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
154
+                                  | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
155
+    RCC_ClkInitStruct.SYSCLKSource   = RCC_SYSCLKSOURCE_PLLCLK;
156
+    RCC_ClkInitStruct.AHBCLKDivider  = RCC_SYSCLK_DIV1;
157
+    RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
158
+    RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
159
+
160
+    if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) == HAL_OK) {
161
+      PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC | RCC_PERIPHCLK_USB;
162
+      PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV6;
163
+      PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_PLL_DIV1_5; // 72/1.5 = 48MHz
164
+      #ifndef USBCON
165
+        PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC;
166
+      #endif
167
+      if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) == HAL_OK) {
168
+        ret = true;
169
+      }
170
+    }
171
+  }
172
+  return ret;
173
+}
174
+
175
+/******************************************************************************/
176
+/*     PLL (clocked by HSI) used as System clock source (64MHz max)           */
177
+/******************************************************************************/
178
+bool SetSysClock_PLL_HSI(void)
179
+{
180
+  RCC_OscInitTypeDef RCC_OscInitStruct = {};
181
+  RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
182
+  RCC_PeriphCLKInitTypeDef PeriphClkInit = {};
183
+  bool ret = false;
184
+
185
+  // Initializes the CPU, AHB and APB busses clocks
186
+  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSE;
187
+  RCC_OscInitStruct.HSIState            = RCC_HSI_ON;
188
+  RCC_OscInitStruct.HSEState            = RCC_HSE_OFF;
189
+  RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
190
+  RCC_OscInitStruct.PLL.PLLState        = RCC_PLL_ON;
191
+  RCC_OscInitStruct.PLL.PLLSource       = RCC_PLLSOURCE_HSI_DIV2; // 4 MHz
192
+  RCC_OscInitStruct.PLL.PLLMUL          = RCC_PLL_MUL12; // 48 MHz
193
+  #ifndef USBCON
194
+    // When the HSI is used as a PLL clock input, the maximum
195
+    // system clock frequency that can be achieved is 64 MHz.
196
+    RCC_OscInitStruct.PLL.PLLMUL        = RCC_PLL_MUL16; // 64 MHz, stay close to 72 for delay()
197
+  #endif
198
+  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) == HAL_OK) {
199
+    // Initializes the CPU, AHB and APB busses clocks
200
+    RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
201
+                                  | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
202
+    RCC_ClkInitStruct.SYSCLKSource   = RCC_SYSCLKSOURCE_PLLCLK;
203
+    RCC_ClkInitStruct.AHBCLKDivider  = RCC_SYSCLK_DIV1;
204
+    RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
205
+    RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
206
+
207
+    // FLASH_LATENCY_1 may cause boot loops
208
+    if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) == HAL_OK) {
209
+      PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC | RCC_PERIPHCLK_USB;
210
+      PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV4;
211
+      PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_PLL;  // requires 48 MHz
212
+      #ifndef USBCON
213
+        PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC;// No USB, RTC nor I2S
214
+        PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV6;   // 2 4 6 8
215
+      #endif
216
+      if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) == HAL_OK) {
217
+        ret = true;
218
+      }
219
+    }
220
+  }
221
+  return ret;
222
+}
223
+
224
+void SystemClock_Config(void)
225
+{
226
+  /*
227
+   * If HSE_VALUE is not 8MHz and you want use it, then:
228
+   * - Redefine HSE_VALUE to the correct HSE_VALUE
229
+   * - Redefine SystemClock_Config() with the correct settings
230
+   */
231
+#if HSE_VALUE == 8000000U
232
+  // 1- Try to start with HSE and external 8MHz xtal
233
+  if (SetSysClock_PLL_HSE(false) == false) {
234
+    // 2- If fail try to start with HSE and external clock
235
+    if (SetSysClock_PLL_HSE(true) == false) {
236
+#endif
237
+      // 3- If fail start with HSI clock
238
+      if (SetSysClock_PLL_HSI() == false) {
239
+        Error_Handler();
240
+      }
241
+#if HSE_VALUE == 8000000U
242
+    }
243
+  }
244
+#endif
245
+}
246
+
247
+#ifdef __cplusplus
248
+}
249
+#endif

+ 175
- 0
buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h Visa fil

@@ -0,0 +1,175 @@
1
+#pragma once
2
+
3
+#ifdef __cplusplus
4
+extern "C" {
5
+#endif // __cplusplus
6
+
7
+// STM32F103VET6    | DIGITAL     | ANALOG        | USART      | TWI       | SPI                  | SPECIAL    |
8
+//------------------|-------------|---------------|------------|-----------|----------------------|------------|
9
+#define PA0  0   // |             | A0 Nozzle T°c |            |           |                      |            |
10
+#define PA1  1   // |             | A1 Bed T°c    |            |           |                      |            |
11
+#define PA2  2   // |             |               | USART2_TX  |           |                      |            |
12
+#define PA3  3   // |             | DAC_OUT1**    | USART2_RX  |           |                      |            |
13
+#define PA4  4   // |             | DAC_OUT2**    |            |           | SPI1_SS*(wired?)     |            |
14
+#define PA5  5   // | O           |               |            |           | SPI1_SCK  EEPROM     |            |
15
+#define PA6  6   // | I           |               |            |           | SPI1_MISO EEPROM     |            |
16
+#define PA7  7   // | O           |               |            |           | SPI1_MOSI EEPROM     |            |
17
+#define PA8  8   // | Od BED      |               |            |           |                      |            |
18
+#define PA9  9   // |             |               | USART1_TX  |           |                      |            |
19
+#define PA10 10  // |             |               | USART1_RX  |           |                      |            |
20
+#define PA11 11  // | I           |               |            |           |                      | USB_DM     |
21
+#define PA12 12  // | I           |               |            |           |                      | USB_DP     |
22
+#define PA13 13  // | I           |               |            |           |                      | SWD_SWDIO  |
23
+#define PA14 14  // | I           |               |            |           |                      | SWD_SWCLK  |
24
+#define PA15 15  // | Od FAN      |               |            |           |                      |            |
25
+//                  |-------------|---------------|------------|-----------|----------------------|------------|
26
+#define PB0  16  // |             |               |            |           |                      |            |
27
+#define PB1  17  // |             |               |            |           |                      |            |
28
+#define PB2  18  // | I+          |               |            |           |                      | BOOT1      |
29
+#define PB3  19  // | O  X_DIR    |               |            |           |                      |            |
30
+#define PB4  20  // | O  X_STEP   |               |            |           |                      |            |
31
+#define PB5  21  // | O  X_EN     |               |            |           |                      |            |
32
+#define PB6  22  // | O  Y_DIR    |               |            |           |                      |            |
33
+#define PB7  23  // | O  Y_STEP   |               |            |           |                      |            |
34
+#define PB8  24  // | O  Y_EN     |               |            |           |                      |            |
35
+#define PB9  25  // | O  Z_DIR    |               |            |           |                      |            |
36
+#define PB10 26  // | I+          |               | USART3_TX* | TWI2_SCL* |                      |            |
37
+#define PB11 27  // | I+          |               | USART3_RX* | TWI2_SDA* |                      |            |
38
+#define PB12 28  // | O  TFT      |               |            |           | SPI2_SS              | TOUCH_CS   |
39
+#define PB13 29  // | O  TFT      |               |            |           | SPI2_SCK             | TOUCH_SCK  |
40
+#define PB14 30  // | O  TFT      |               |            |           | SPI2_MISO (bad>MOSI) | TOUCH_MOSI |
41
+#define PB15 31  // | I  TFT      |               |            |           | SPI2_MOSI (bad>MISO) | TOUCH_MISO |
42
+//                  |-------------|---------------|------------|-----------|----------------------|------------|
43
+#define PC0  32  // | I  E_OUT    |               |            |           |                      |            |
44
+#define PC1  33  // | I+ X_MIN    |               |            |           |                      |            |
45
+#define PC2  34  // | O  LED      |               |            |           |                      |            |
46
+#define PC3  35  // | I+          |               |            |           |                      |            |
47
+#define PC4  36  // | O  TFT      |               |            |           |                      | TFT RESET  |
48
+#define PC5  37  // | O  CS1      |               |            |           | for SPI1 EEPROM CS   |            |
49
+#define PC6  38  // | I  TFT      |               |            |           |                      | TOUCH_INT  |
50
+#define PC7  39  // |             |               |            |           |                      |            |
51
+#define PC8  40  // | x  SDIO     |               |            |           |                      | SD_D0      |
52
+#define PC9  41  // | x  SDIO     |               |            |           |                      | SD_D1      |
53
+#define PC10 42  // | x  SDIO     |               |            |           |                      | SD_D2      |
54
+#define PC11 43  // | x  SDIO     |               |            |           |                      | SD_D3      |
55
+#define PC12 44  // | O  SDIO     |               |            |           |                      | SD_CLK     |
56
+#define PC13 45  // | I           |               |            |           |                      |            |
57
+#define PC14 46  // | I+ Y_MAX    |               |            |           |                      |            |
58
+#define PC15 47  // | I+ Y_MIN    |               |            |           |                      |            |
59
+//                  |-------------|---------------|------------|-----------|----------------------|------------|
60
+#define PD0  48  // | O  TFT      |               |            |           |                      | OSC_IN  D2 |
61
+#define PD1  49  // | O  TFT      |               |            |           |                      | OSC_OUT D3 |
62
+#define PD2  50  // | O  SDIO     |               |            |           |                      | SD_CMD     |
63
+#define PD3  51  // | Od NOZZLE   |               |            |           |                      |            |
64
+#define PD4  52  // | O  TFT      |               |            |           |                      | FSMC_NOE   |
65
+#define PD5  53  // | O  TFT      |               |            |           |                      | FSMC_NWE   |
66
+#define PD6  54  // | I  wired?*  |               |            |           |                      | FSMC_NWAIT*|
67
+#define PD7  55  // | O  TFT      |               |            |           |                      | FSMC_NE1/CS|
68
+#define PD8  56  // | O  TFT      |               |            |           |                      | FSMC_D13   |
69
+#define PD9  57  // | O  TFT      |               |            |           |                      | FSMC_D14   |
70
+#define PD10 58  // | O  TFT      |               |            |           |                      | FSMC_D15   |
71
+#define PD11 59  // | O  TFT      |               |            |           |                      | FSMC_A16   |
72
+#define PD12 60  // | O  TFT      |               |            |           |                      | TFT BL     |
73
+#define PD13 61  // | Od PWM*     |               |            |           |                      | SERVO0     |
74
+#define PD14 62  // | O  TFT      |               |            |           |                      | FSMC_D00   |
75
+#define PD15 63  // | O  TFT      |               |            |           |                      | FSMC_D01   |
76
+//                  |-------------|---------------|------------|-----------|----------------------|------------|
77
+#define PE0  64  // | O  Z_STEP   |               |            |           |                      |            |
78
+#define PE1  65  // | O  Z_EN     |               |            |           |                      |            |
79
+#define PE2  66  // | O  E0_DIR   |               |            |           |                      |            |
80
+#define PE3  67  // | O  E0_STEP  |               |            |           |                      |            |
81
+#define PE4  68  // | O  E0_EN    |               |            |           |                      |            |
82
+#define PE5  69  // | I+ Z_MAX    |               |            |           |                      |            |
83
+#define PE6  70  // | I+ Z_MIN    |               |            |           |                      |            |
84
+#define PE7  71  // | O  TFT      |               |            |           |                      | FSMC_D04   |
85
+#define PE8  72  // | O  TFT      |               |            |           |                      | FSMC_D05   |
86
+#define PE9  73  // | O  TFT      |               |            |           |                      | FSMC_D06   |
87
+#define PE10 74  // | O  TFT      |               |            |           |                      | FSMC_D07   |
88
+#define PE11 75  // | O  TFT      |               |            |           |                      | FSMC_D08   |
89
+#define PE12 76  // | O  TFT      |               |            |           |                      | FSMC_D09   |
90
+#define PE13 77  // | O  TFT      |               |            |           |                      | FSMC_D10   |
91
+#define PE14 78  // | O  TFT      |               |            |           |                      | FSMC_D11   |
92
+#define PE15 79  // | O  TFT      |               |            |           |                      | FSMC_D12   |
93
+//------------------|-------------|---------------|------------|-----------|----------------------|------------|
94
+
95
+// This must be a literal
96
+#define NUM_DIGITAL_PINS        80
97
+#define NUM_ANALOG_INPUTS       16 // 2 first are used, but cant be reduced to 2...
98
+
99
+// On-board LED pin number
100
+#ifndef LED_BUILTIN
101
+#define LED_BUILTIN             PC2
102
+#endif
103
+
104
+// On-board user button (not wired)
105
+#ifndef USER_BTN
106
+#define USER_BTN                PC13
107
+#endif
108
+
109
+// SPI Definition (SPI1 EEPROM)
110
+#define PIN_SPI_SS              PC5
111
+#define PIN_SPI_MOSI            PA7
112
+#define PIN_SPI_MISO            PA6
113
+#define PIN_SPI_SCK             PA5
114
+
115
+// I2C Definition (Unused)
116
+#define PIN_WIRE_SDA            PB11
117
+#define PIN_WIRE_SCL            PB10
118
+
119
+// Timer Definitions
120
+// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
121
+#ifndef TIMER_TONE
122
+  #define TIMER_TONE            TIM6
123
+#endif
124
+#ifndef TIMER_SERVO
125
+  #define TIMER_SERVO           TIM7
126
+#endif
127
+
128
+// UART Definitions
129
+// Define here Serial instance number to map on Serial generic name
130
+#define SERIAL_UART_INSTANCE    1
131
+
132
+// Default pin used for 'Serial' instance (linked to CH340 USB port)
133
+#define PIN_SERIAL_RX           PA10
134
+#define PIN_SERIAL_TX           PA9
135
+#define PIN_SERIAL1_RX          PA10
136
+#define PIN_SERIAL1_TX          PA9
137
+// Default pin used for 'Serial2' instance (connector exists but unsoldered)
138
+#define PIN_SERIAL2_RX          PA3
139
+#define PIN_SERIAL2_TX          PA2
140
+
141
+// Extra HAL modules
142
+#if defined(STM32F103xE)
143
+//#define HAL_DAC_MODULE_ENABLED (unused or maybe for the eeprom write?)
144
+#define HAL_SD_MODULE_ENABLED
145
+#define HAL_SRAM_MODULE_ENABLED
146
+#endif
147
+
148
+#ifdef __cplusplus
149
+} // extern "C"
150
+#endif
151
+/*----------------------------------------------------------------------------
152
+ *        Arduino objects - C++ only
153
+ *----------------------------------------------------------------------------*/
154
+
155
+#ifdef __cplusplus
156
+  // These serial port names are intended to allow libraries and architecture-neutral
157
+  // sketches to automatically default to the correct port name for a particular type
158
+  // of use.  For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
159
+  // the first hardware serial port whose RX/TX pins are not dedicated to another use.
160
+  //
161
+  // SERIAL_PORT_MONITOR        Port which normally prints to the Arduino Serial Monitor
162
+  //
163
+  // SERIAL_PORT_USBVIRTUAL     Port which is USB virtual serial
164
+  //
165
+  // SERIAL_PORT_LINUXBRIDGE    Port which connects to a Linux system via Bridge library
166
+  //
167
+  // SERIAL_PORT_HARDWARE       Hardware serial port, physical RX & TX pins.
168
+  //
169
+  // SERIAL_PORT_HARDWARE_OPEN  Hardware serial ports which are open for use.  Their RX & TX
170
+  //                            pins are NOT connected to anything by default.
171
+  #define SERIAL_PORT_MONITOR       Serial1
172
+  #define SERIAL_PORT_HARDWARE      Serial1
173
+  #define SERIAL_PORT_HARDWARE_OPEN Serial2
174
+#endif
175
+

+ 7
- 7
ini/stm32f1.ini Visa fil

@@ -330,19 +330,19 @@ upload_protocol = serial
330 330
 #
331 331
 [env:STM32F103VE_longer]
332 332
 platform                    = ${common_stm32.platform}
333
+lib_deps                    = ${common.lib_deps}
334
+  https://github.com/tpruvot/STM32_Servo_OpenDrain/archive/2.0.zip
333 335
 extends                     = stm32_variant
334 336
 board                       = genericSTM32F103VE
335
-board_build.variant         = MARLIN_F103Vx
337
+board_build.variant         = MARLIN_F103VE_LONGER
336 338
 board_build.rename          = project.bin
337 339
 board_build.offset          = 0x10000
338 340
 board_upload.offset_address = 0x08010000
339
-build_flags                 = ${stm32_variant.build_flags}
340
-                              -DMCU_STM32F103VE -DU20 -DTS_V12 -DLED_BUILTIN=PC2 -UPIN_WIRE_SDA
341
-                              -UPIN_WIRE_SCL -DPIN_WIRE_SDA=PB11 -DPIN_WIRE_SCL=PB10
342
-                              -DHAL_DAC_MODULE_DISABLED -DHAL_I2S_MODULE_DISABLED
343
-build_unflags               = ${stm32_variant.build_unflags}
344
-                              -DUSBCON -DUSBD_USE_CDC -DHAL_PCD_MODULE_ENABLED
341
+build_flags                 = ${stm32_variant.build_flags} -DMCU_STM32F103VE -DU20 -DTS_V12
342
+build_unflags               = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -DHAL_PCD_MODULE_ENABLED
345 343
 extra_scripts               = ${stm32_variant.extra_scripts}
344
+monitor_speed               = 250000
345
+debug_tool                  = stlink
346 346
 
347 347
 #
348 348
 # TRIGORILLA PRO (STM32F103ZET6)

Laddar…
Avbryt
Spara