Ver código fonte

BigTree SKR Pro V1.1 board support (#14523)

Msq001 5 anos atrás
pai
commit
439e28783b

+ 1
- 1
Marlin/src/HAL/HAL_STM32/HAL.h Ver arquivo

@@ -132,7 +132,7 @@
132 132
 // Types
133 133
 // --------------------------------------------------------------------------
134 134
 
135
-typedef int8_t pin_t;
135
+typedef int16_t pin_t;
136 136
 
137 137
 #define HAL_SERVO_LIB libServo
138 138
 

+ 1
- 0
Marlin/src/core/boards.h Ver arquivo

@@ -270,6 +270,7 @@
270 270
 #define BOARD_BLACK_STM32F407VE       4106  // BLACK_STM32F407VE
271 271
 #define BOARD_BLACK_STM32F407ZE       4107  // BLACK_STM32F407ZE
272 272
 #define BOARD_STEVAL                  4108  // STEVAL-3DP001V1 3D PRINTER BOARD
273
+#define BOARD_BIGTREE_SKR_PRO_V1_1    4109  // BigTreeTech SKR Pro v1.1 (STM32F407ZG)
273 274
 
274 275
 //
275 276
 // ARM Cortex M7

+ 2
- 0
Marlin/src/pins/pins.h Ver arquivo

@@ -467,6 +467,8 @@
467 467
   #include "pins_BLACK_STM32F407VE.h" // STM32F4                                    env:black_stm32f407ve
468 468
 #elif MB(STEVAL)
469 469
   #include "pins_STEVAL.h"            // STM32F4                                    env:STM32F4
470
+#elif MB(BIGTREE_SKR_PRO_V1_1)
471
+  #include "pins_BIGTREE_SKR_PRO_V1.1.h" // STM32F4                                 env:BIGTREE_SKR_PRO
470 472
 
471 473
 //
472 474
 // ARM Cortex M7

+ 234
- 0
Marlin/src/pins/pins_BIGTREE_SKR_PRO_V1.1.h Ver arquivo

@@ -0,0 +1,234 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#ifndef TARGET_STM32F4
25
+  #error "Oops! Select an STM32F4 board in 'Tools > Board.'"
26
+#endif
27
+
28
+#if HOTENDS > 3 || E_STEPPERS > 3
29
+  #error "BIGTREE SKR Pro V1.1 supports up to 3 hotends / E-steppers."
30
+#endif
31
+
32
+#define BOARD_NAME "BIGTREE SKR Pro V1.1"
33
+
34
+#define EEPROM_EMULATED_WITH_SRAM
35
+
36
+//
37
+// Servos
38
+//
39
+#define SERVO0_PIN         PA1
40
+
41
+//
42
+// Limit Switches
43
+//
44
+#define X_MIN_PIN          PB10
45
+#define X_MAX_PIN          PE15
46
+#define Y_MIN_PIN          PE12
47
+#define Y_MAX_PIN          PE10
48
+#define Z_MIN_PIN          PG8
49
+#define Z_MAX_PIN          PG5
50
+
51
+//
52
+// Z Probe must be this pins
53
+//
54
+#ifndef Z_MIN_PROBE_PIN
55
+  #define Z_MIN_PROBE_PIN  PA2
56
+#endif
57
+
58
+//
59
+// Steppers
60
+//
61
+#define X_STEP_PIN         PE9
62
+#define X_DIR_PIN          PF1
63
+#define X_ENABLE_PIN       PF2
64
+#ifndef X_CS_PIN
65
+  #define X_CS_PIN         PA15
66
+#endif
67
+
68
+#define Y_STEP_PIN         PE11
69
+#define Y_DIR_PIN          PE8
70
+#define Y_ENABLE_PIN       PD7
71
+ #ifndef Y_CS_PIN
72
+  #define Y_CS_PIN         PB8
73
+#endif
74
+
75
+#define Z_STEP_PIN         PE13
76
+#define Z_DIR_PIN          PC2
77
+#define Z_ENABLE_PIN       PC0
78
+#ifndef Z_CS_PIN
79
+  #define Z_CS_PIN         PB9
80
+#endif
81
+
82
+#define E0_STEP_PIN        PE14
83
+#define E0_DIR_PIN         PA0
84
+#define E0_ENABLE_PIN      PC3
85
+#ifndef E0_CS_PIN
86
+  #define E0_CS_PIN        PB3
87
+#endif
88
+
89
+#define E1_STEP_PIN        PD15
90
+#define E1_DIR_PIN         PE7
91
+#define E1_ENABLE_PIN      PA3
92
+#ifndef E1_CS_PIN
93
+  #define E1_CS_PIN        PG15
94
+#endif
95
+
96
+#define E2_STEP_PIN        PD13
97
+#define E2_DIR_PIN         PG9
98
+#define E2_ENABLE_PIN      PF0
99
+#ifndef E2_CS_PIN
100
+  #define E2_CS_PIN        PG12
101
+#endif
102
+
103
+//
104
+// Software SPI pins for TMC2130 stepper drivers
105
+//
106
+#if ENABLED(TMC_USE_SW_SPI)
107
+  #define TMC_SW_MOSI      PC12
108
+  #define TMC_SW_MISO      PC11
109
+  #define TMC_SW_SCK       PC10
110
+#endif
111
+
112
+#if HAS_DRIVER(TMC2208)
113
+  /**
114
+   * TMC2208 stepper drivers
115
+   *
116
+   * Hardware serial communication ports.
117
+   * If undefined software serial is used according to the pins below
118
+   */
119
+  //#define X_HARDWARE_SERIAL  Serial
120
+  //#define X2_HARDWARE_SERIAL Serial1
121
+  //#define Y_HARDWARE_SERIAL  Serial1
122
+  //#define Y2_HARDWARE_SERIAL Serial1
123
+  //#define Z_HARDWARE_SERIAL  Serial1
124
+  //#define Z2_HARDWARE_SERIAL Serial1
125
+  //#define E0_HARDWARE_SERIAL Serial1
126
+  //#define E1_HARDWARE_SERIAL Serial1
127
+  //#define E2_HARDWARE_SERIAL Serial1
128
+  //#define E3_HARDWARE_SERIAL Serial1
129
+  //#define E4_HARDWARE_SERIAL Serial1
130
+
131
+  //
132
+  // Software serial
133
+  //   
134
+  #define X_SERIAL_TX_PIN  PC13
135
+  #define X_SERIAL_RX_PIN  PE4
136
+
137
+  #define Y_SERIAL_TX_PIN  PE3
138
+  #define Y_SERIAL_RX_PIN  PE2
139
+
140
+  #define Z_SERIAL_TX_PIN  PE0
141
+  #define Z_SERIAL_RX_PIN  PE1
142
+
143
+  #define E0_SERIAL_TX_PIN PD4
144
+  #define E0_SERIAL_RX_PIN PD2
145
+
146
+  #define E1_SERIAL_TX_PIN PD0
147
+  #define E1_SERIAL_RX_PIN PD1
148
+
149
+  #define Z2_SERIAL_TX_PIN PD6
150
+  #define Z2_SERIAL_RX_PIN PD5
151
+#endif
152
+
153
+//
154
+// Temperature Sensors
155
+//
156
+#define TEMP_0_PIN         PF3  // T0
157
+#define TEMP_1_PIN         PF4  // T1
158
+#define TEMP_2_PIN         PF5  // T2
159
+#define TEMP_BED_PIN       PF6  // TB
160
+
161
+//
162
+// Heaters / Fans
163
+//
164
+#define HEATER_0_PIN       PB1  // Heater0
165
+#define HEATER_1_PIN       PD14 // Heater1
166
+#define HEATER_2_PIN       PB0  // Heater1
167
+#define HEATER_BED_PIN     PD12 // Hotbed
168
+#define FAN_PIN            PC8  // Fan0
169
+#define FAN1_PIN           PE5  // Fan1
170
+#define FAN2_PIN           PE6  // Fan2
171
+
172
+//
173
+// Misc. Functions
174
+//
175
+#define SDSS               PB12
176
+
177
+/*
178
+|               _____                                             _____
179
+|           NC | · · | GND                                    5V | · · | GND
180
+|        RESET | · · | PF12(SD_DETECT)             (LCD_D7)  PG7 | · · | PG6  (LCD_D6)
181
+|   (MOSI)PB15 | · · | PF11(BTN_EN2)               (LCD_D5)  PG3 | · · | PG2  (LCD_D4)
182
+|  (SD_SS)PB12 | · · | PG10(BTN_EN1)               (LCD_RS) PD10 | · · | PD11 (LCD_EN)
183
+|    (SCK)PB13 | · · | PB14(MISO)                 (BTN_ENC)  PA8 | · · | PG4  (BEEPER)
184
+|                ̄ ̄                                                ̄ ̄
185
+|               EXP2                                              EXP1
186
+*/
187
+#if HAS_SPI_LCD
188
+  #define BEEPER_PIN       PG4
189
+  #define BTN_ENC          PA8
190
+
191
+  #if ENABLED(CR10_STOCKDISPLAY)
192
+    #define LCD_PINS_RS    PG6
193
+
194
+    #define BTN_EN1        PD11
195
+    #define BTN_EN2        PG2
196
+
197
+    #define LCD_PINS_ENABLE PG7
198
+    #define LCD_PINS_D4    PG3
199
+
200
+  #else
201
+
202
+    #define LCD_PINS_RS    PD10
203
+
204
+    #define BTN_EN1        PG10
205
+    #define BTN_EN2        PF11
206
+    #define SD_DETECT_PIN  PF12
207
+
208
+    #define LCD_SDSS       PB12
209
+
210
+    #define LCD_PINS_ENABLE PD11
211
+    #define LCD_PINS_D4    PG2
212
+
213
+    #if ENABLED(ULTIPANEL)
214
+      #define LCD_PINS_D5  PG3
215
+      #define LCD_PINS_D6  PG6
216
+      #define LCD_PINS_D7  PG7
217
+    #endif
218
+
219
+  #endif
220
+
221
+  // Alter timing for graphical display
222
+  #if HAS_GRAPHICAL_DISPLAY
223
+    #ifndef ST7920_DELAY_1
224
+      #define ST7920_DELAY_1 DELAY_NS(96)
225
+    #endif
226
+    #ifndef ST7920_DELAY_2
227
+      #define ST7920_DELAY_2 DELAY_NS(48)
228
+    #endif
229
+    #ifndef ST7920_DELAY_3
230
+      #define ST7920_DELAY_3 DELAY_NS(600)
231
+    #endif
232
+  #endif
233
+
234
+#endif // HAS_SPI_LCD

+ 66
- 0
buildroot/share/PlatformIO/boards/BigTree_SKR_Pro.json Ver arquivo

@@ -0,0 +1,66 @@
1
+{
2
+  "build": {
3
+    "core": "stm32",
4
+    "cpu": "cortex-m4",
5
+    "extra_flags": "-DSTM32F407xx",
6
+    "f_cpu": "168000000L",
7
+    "hwids": [
8
+      [
9
+        "0x1EAF",
10
+        "0x0003"
11
+      ],
12
+      [
13
+        "0x0483",
14
+        "0x3748"
15
+      ]
16
+    ],
17
+    "ldscript": "stm32f407xg.ld",
18
+    "mcu": "stm32f407zgt6",
19
+    "variant": "BIGTREE_GENERIC_STM32F407_5X"
20
+  },
21
+  "debug": {
22
+    "jlink_device": "STM32F407ZG",
23
+    "openocd_target": "stm32f4x",
24
+    "svd_path": "STM32F40x.svd",
25
+    "tools": {
26
+      "stlink": {
27
+        "server": {
28
+          "arguments": [
29
+            "-f",
30
+            "scripts/interface/stlink.cfg",
31
+            "-c",
32
+            "transport select hla_swd",
33
+            "-f",
34
+            "scripts/target/stm32f4x.cfg",
35
+            "-c",
36
+            "reset_config none"
37
+          ],
38
+          "executable": "bin/openocd",
39
+          "package": "tool-openocd"
40
+        }
41
+      }
42
+    }
43
+  },
44
+  "frameworks": [
45
+    "arduino",
46
+    "stm32cube"
47
+  ],
48
+  "name": "STM32F407ZG (192k RAM. 1024k Flash)",
49
+  "upload": {
50
+    "disable_flushing": false,
51
+    "maximum_ram_size": 196608,
52
+    "maximum_size": 1048576,
53
+    "protocol": "stlink",
54
+    "protocols": [
55
+      "stlink",
56
+      "dfu",
57
+      "jlink",
58
+	  "cmsis-dap"
59
+    ],
60
+    "require_upload_port": true,
61
+    "use_1200bps_touch": false,
62
+    "wait_for_upload_port": false
63
+  },
64
+  "url": "http://www.st.com/en/microcontrollers/stm32f407zg.html",
65
+  "vendor": "Generic"
66
+}

+ 29
- 0
buildroot/share/PlatformIO/scripts/generic_create_variant.py Ver arquivo

@@ -0,0 +1,29 @@
1
+import os,shutil
2
+from SCons.Script import DefaultEnvironment
3
+from platformio import util
4
+
5
+env = DefaultEnvironment()
6
+platform = env.PioPlatform()
7
+board = env.BoardConfig()
8
+
9
+FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoststm32")
10
+CMSIS_DIR = os.path.join(FRAMEWORK_DIR, "CMSIS", "CMSIS")
11
+assert os.path.isdir(FRAMEWORK_DIR)
12
+assert os.path.isdir(CMSIS_DIR)
13
+assert os.path.isdir("buildroot/share/PlatformIO/variants")
14
+
15
+mcu_type = board.get("build.mcu")[:-2]
16
+variant = board.get("build.variant")
17
+series = mcu_type[:7].upper() + "xx"
18
+variant_dir = os.path.join(FRAMEWORK_DIR, "variants", variant)
19
+
20
+source_dir = os.path.join("buildroot/share/PlatformIO/variants", variant)
21
+assert os.path.isdir(source_dir)
22
+
23
+if not os.path.isdir(variant_dir):
24
+    os.mkdir(variant_dir)
25
+
26
+for file_name in os.listdir(source_dir):
27
+    full_file_name = os.path.join(source_dir, file_name)
28
+    if os.path.isfile(full_file_name):
29
+        shutil.copy(full_file_name, variant_dir)

+ 437
- 0
buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/PeripheralPins.c Ver arquivo

@@ -0,0 +1,437 @@
1
+/*
2
+ *******************************************************************************
3
+ * Copyright (c) 2019, STMicroelectronics
4
+ * All rights reserved.
5
+ *
6
+ * Redistribution and use in source and binary forms, with or without
7
+ * modification, are permitted provided that the following conditions are met:
8
+ *
9
+ * 1. Redistributions of source code must retain the above copyright notice,
10
+ *    this list of conditions and the following disclaimer.
11
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ *    this list of conditions and the following disclaimer in the documentation
13
+ *    and/or other materials provided with the distribution.
14
+ * 3. Neither the name of STMicroelectronics nor the names of its contributors
15
+ *    may be used to endorse or promote products derived from this software
16
+ *    without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ *******************************************************************************
29
+ * Automatically generated from STM32F407Z(E-G)Tx.xml
30
+ */
31
+#include "Arduino.h"
32
+#include "PeripheralPins.h"
33
+
34
+/* =====
35
+ * Note: Commented lines are alternative possibilities which are not used by default.
36
+ *       If you change them, you should know what you're doing first.
37
+ * =====
38
+ */
39
+
40
+//*** ADC ***
41
+
42
+#ifdef HAL_ADC_MODULE_ENABLED
43
+const PinMap PinMap_ADC[] = {
44
+  {PA_0,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0
45
+  //{PA_0,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC2_IN0
46
+  //{PA_0,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC3_IN0
47
+  {PA_1,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1
48
+  //{PA_1,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC2_IN1
49
+  //{PA_1,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_IN1
50
+  {PA_2,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2
51
+  //{PA_2,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC2_IN2
52
+  //{PA_2,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC3_IN2
53
+  {PA_3,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3
54
+  //{PA_3,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_IN3
55
+  //{PA_3,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC3_IN3
56
+  {PA_4,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4
57
+  //{PA_4,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_IN4
58
+  {PA_5,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5
59
+  //{PA_5,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_IN5
60
+  {PA_6,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6
61
+  //{PA_6,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_IN6
62
+  {PA_7,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7
63
+  //{PA_7,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_IN7
64
+  {PB_0,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8
65
+  //{PB_0,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_IN8
66
+  {PB_1,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9
67
+  //{PB_1,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_IN9
68
+  {PC_0,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10
69
+  //{PC_0,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_IN10
70
+  //{PC_0,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC3_IN10
71
+  {PC_1,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11
72
+  //{PC_1,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_IN11
73
+  //{PC_1,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC3_IN11
74
+  {PC_2,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12
75
+  //{PC_2,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC2_IN12
76
+  //{PC_2,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC3_IN12
77
+  {PC_3,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13
78
+  //{PC_3,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC2_IN13
79
+  //{PC_3,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC3_IN13
80
+  {PC_4,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14
81
+  //{PC_4,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC2_IN14
82
+  {PC_5,  ADC1,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15
83
+  //{PC_5,  ADC2,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC2_IN15
84
+
85
+  #if STM32F4X_PIN_NUM >= 144  //144 pins mcu, 114 gpio, 24 ADC
86
+    {PF_3,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC3_IN9
87
+    {PF_4,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC3_IN14
88
+    {PF_5,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC3_IN15
89
+    {PF_6,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC3_IN4
90
+    {PF_7,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC3_IN5
91
+    {PF_8,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC3_IN6
92
+    {PF_9,  ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC3_IN7
93
+    {PF_10, ADC3,  STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC3_IN8
94
+  #endif
95
+  {NC,    NP,    0}
96
+};
97
+#endif
98
+
99
+//*** DAC ***
100
+
101
+#ifdef HAL_DAC_MODULE_ENABLED
102
+const PinMap PinMap_DAC[] = {
103
+  {PA_4,  DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1
104
+  {PA_5,  DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2
105
+  {NC,    NP,    0}
106
+};
107
+#endif
108
+
109
+//*** I2C ***
110
+
111
+#ifdef HAL_I2C_MODULE_ENABLED
112
+const PinMap PinMap_I2C_SDA[] = {
113
+  {PB_7,  I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
114
+  {PB_9,  I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
115
+  {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
116
+  {PC_9,  I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
117
+  #if STM32F4X_PIN_NUM >= 144  //144 pins mcu, 114 gpio
118
+    {PF_0,  I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
119
+  #endif
120
+  {NC,    NP,    0}
121
+};
122
+#endif
123
+
124
+#ifdef HAL_I2C_MODULE_ENABLED
125
+const PinMap PinMap_I2C_SCL[] = {
126
+  {PA_8,  I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
127
+  {PB_6,  I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
128
+  {PB_8,  I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
129
+  {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
130
+  #if STM32F4X_PIN_NUM >= 144  //144 pins mcu, 114 gpio
131
+    {PF_1,  I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
132
+  #endif
133
+  {NC,    NP,    0}
134
+};
135
+#endif
136
+
137
+//*** PWM ***
138
+
139
+#ifdef HAL_TIM_MODULE_ENABLED
140
+const PinMap PinMap_PWM[] = {
141
+  {PA_0,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
142
+  //{PA_0,  TIM5,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1
143
+  {PA_1,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
144
+  //{PA_1,  TIM5,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2
145
+  {PA_2,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3
146
+  //{PA_2,  TIM5,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3
147
+  //{PA_2,  TIM9,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1
148
+  {PA_3,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4
149
+  //{PA_3,  TIM5,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4
150
+  //{PA_3,  TIM9,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2
151
+  {PA_5,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
152
+  //{PA_5,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N
153
+  {PA_6,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
154
+  //{PA_6,  TIM13,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1
155
+  //{PA_7,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
156
+  {PA_7,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
157
+  //{PA_7,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N
158
+  //{PA_7,  TIM14,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1
159
+  {PA_8,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1
160
+  {PA_9,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2
161
+  {PA_10, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3
162
+  {PA_11, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4
163
+  //{PA_15, TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
164
+  //{PB_0,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
165
+  {PB_0,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3
166
+  //{PB_0,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N
167
+  //{PB_1,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
168
+  {PB_1,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4
169
+  //{PB_1,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N
170
+  //{PB_3,  TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
171
+  {PB_4,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
172
+  {PB_5,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
173
+  //{PB_6,  TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1
174
+  //{PB_7,  TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2
175
+  //{PB_8,  TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3
176
+  {PB_8,  TIM10,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1
177
+  //{PB_9,  TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4
178
+  {PB_9,  TIM11,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1
179
+  {PB_10, TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3
180
+  {PB_11, TIM2,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4
181
+  {PB_13, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
182
+  {PB_14, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
183
+  {PB_14, TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N
184
+  {PB_14, TIM12,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 1, 0)}, // TIM12_CH1
185
+  {PB_15, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
186
+  {PB_15, TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N
187
+  {PB_15, TIM12,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 2, 0)}, // TIM12_CH2
188
+  {PC_6,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
189
+  {PC_6,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 0)}, // TIM8_CH1
190
+  {PC_7,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
191
+  {PC_7,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2
192
+  {PC_8,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3
193
+  {PC_8,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3
194
+  //{PC_9,  TIM3,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4
195
+  //{PC_9,  TIM8,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4
196
+  {PD_12, TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1
197
+  {PD_13, TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2
198
+  {PD_14, TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3
199
+  {PD_15, TIM4,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4
200
+  {PE_5,  TIM9,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1
201
+  {PE_6,  TIM9,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2
202
+  {PE_8,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
203
+  {PE_9,  TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1
204
+  {PE_10, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
205
+  {PE_11, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2
206
+  {PE_12, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
207
+  {PE_13, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3
208
+  {PE_14, TIM1,   STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4
209
+  #if STM32F4X_PIN_NUM >= 144  //144 pins mcu, 114 gpio
210
+    {PF_6,  TIM10,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1
211
+    {PF_7,  TIM11,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1
212
+    {PF_8,  TIM13,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1
213
+    {PF_9,  TIM14,  STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1
214
+  #endif
215
+  {NC,    NP,    0}
216
+};
217
+#endif
218
+
219
+//*** SERIAL ***
220
+
221
+#ifdef HAL_UART_MODULE_ENABLED
222
+const PinMap PinMap_UART_TX[] = {
223
+  {PA_0,  UART4,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
224
+  {PA_2,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
225
+  {PA_9,  USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
226
+  {PB_6,  USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
227
+  {PB_10, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
228
+  {PC_6,  USART6,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
229
+  {PC_10, UART4,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
230
+  {PC_10, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
231
+  {PC_12, UART5,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
232
+  {PD_5,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
233
+  {PD_8,  USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
234
+  #if STM32F4X_PIN_NUM >= 144  //144 pins mcu, 114 gpio
235
+    {PG_14, USART6,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
236
+  #endif
237
+  {NC,    NP,    0}
238
+};
239
+#endif
240
+
241
+#ifdef HAL_UART_MODULE_ENABLED
242
+const PinMap PinMap_UART_RX[] = {
243
+  {PA_1,  UART4,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
244
+  {PA_3,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
245
+  {PA_10, USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
246
+  {PB_7,  USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
247
+  {PB_11, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
248
+  {PC_7,  USART6,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
249
+  {PC_11, UART4,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
250
+  {PC_11, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
251
+  {PD_2,  UART5,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
252
+  {PD_6,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
253
+  {PD_9,  USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
254
+  #if STM32F4X_PIN_NUM >= 144  //144 pins mcu, 114 gpio
255
+    {PG_9,  USART6,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
256
+  #endif
257
+  {NC,    NP,    0}
258
+};
259
+#endif
260
+
261
+#ifdef HAL_UART_MODULE_ENABLED
262
+const PinMap PinMap_UART_RTS[] = {
263
+  {PA_1,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
264
+  {PA_12, USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
265
+  {PB_14, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
266
+  {PD_4,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
267
+  {PD_12, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
268
+  #if STM32F4X_PIN_NUM >= 144  //144 pins mcu, 114 gpio
269
+    {PG_8,  USART6,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
270
+    {PG_12, USART6,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
271
+  #endif
272
+  {NC,    NP,    0}
273
+};
274
+#endif
275
+
276
+#ifdef HAL_UART_MODULE_ENABLED
277
+const PinMap PinMap_UART_CTS[] = {
278
+  {PA_0,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
279
+  {PA_11, USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
280
+  {PB_13, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
281
+  {PD_3,  USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
282
+  {PD_11, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
283
+  #if STM32F4X_PIN_NUM >= 144  //144 pins mcu, 114 gpio
284
+    {PG_13, USART6,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
285
+    {PG_15, USART6,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
286
+  #endif
287
+  {NC,    NP,    0}
288
+};
289
+#endif
290
+
291
+//*** SPI ***
292
+
293
+#ifdef HAL_SPI_MODULE_ENABLED
294
+const PinMap PinMap_SPI_MOSI[] = {
295
+  {PA_7,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
296
+  {PB_5,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
297
+  {PB_5,  SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
298
+  {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
299
+  {PC_3,  SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
300
+  {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
301
+  {NC,    NP,    0}
302
+};
303
+#endif
304
+
305
+#ifdef HAL_SPI_MODULE_ENABLED
306
+const PinMap PinMap_SPI_MISO[] = {
307
+  {PA_6,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
308
+  {PB_4,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
309
+  {PB_4,  SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
310
+  {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
311
+  {PC_2,  SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
312
+  {PC_11, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
313
+  {NC,    NP,    0}
314
+};
315
+#endif
316
+
317
+#ifdef HAL_SPI_MODULE_ENABLED
318
+const PinMap PinMap_SPI_SCLK[] = {
319
+  {PA_5,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
320
+  {PB_3,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
321
+  {PB_3,  SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
322
+  {PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
323
+  {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
324
+  {PC_10, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
325
+  {NC,    NP,    0}
326
+};
327
+#endif
328
+
329
+#ifdef HAL_SPI_MODULE_ENABLED
330
+const PinMap PinMap_SPI_SSEL[] = {
331
+  {PA_4,  SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
332
+  {PA_4,  SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
333
+  {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
334
+  {PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
335
+  {PB_9,  SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
336
+  {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
337
+  {NC,    NP,    0}
338
+};
339
+#endif
340
+
341
+//*** CAN ***
342
+
343
+#ifdef HAL_CAN_MODULE_ENABLED
344
+const PinMap PinMap_CAN_RD[] = {
345
+  {PA_11, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
346
+  {PB_5,  CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)},
347
+  {PB_8,  CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
348
+  {PB_12, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)},
349
+  {PD_0,  CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
350
+  {NC,    NP,    0}
351
+};
352
+#endif
353
+
354
+#ifdef HAL_CAN_MODULE_ENABLED
355
+const PinMap PinMap_CAN_TD[] = {
356
+  {PA_12, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
357
+  {PB_6,  CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)},
358
+  {PB_9,  CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
359
+  {PB_13, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)},
360
+  {PD_1,  CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
361
+  {NC,    NP,    0}
362
+};
363
+#endif
364
+
365
+//*** ETHERNET ***
366
+
367
+#ifdef HAL_ETH_MODULE_ENABLED
368
+const PinMap PinMap_Ethernet[] = {
369
+  {PA_0,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_CRS
370
+  {PA_1,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_REF_CLK|ETH_RX_CLK
371
+  {PA_2,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_MDIO
372
+  {PA_3,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_COL
373
+  {PA_7,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_CRS_DV|ETH_RX_DV
374
+  {PB_0,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD2
375
+  {PB_1,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD3
376
+  {PB_5,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_PPS_OUT
377
+  {PB_8,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD3
378
+  {PB_10, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RX_ER
379
+  {PB_11, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_EN
380
+  {PB_12, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD0
381
+  {PB_13, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD1
382
+  {PC_1,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_MDC
383
+  {PC_2,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD2
384
+  {PC_3,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_CLK
385
+  {PC_4,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD0
386
+  {PC_5,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD1
387
+  {PE_2,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD3
388
+  #if STM32F4X_PIN_NUM >= 144  //144 pins mcu, 114 gpio
389
+    {PG_8,  ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_PPS_OUT
390
+    {PG_11, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_EN
391
+    {PG_13, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD0
392
+    {PG_14, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD1
393
+  #endif
394
+  {NC,    NP,    0}
395
+};
396
+#endif
397
+
398
+//*** No QUADSPI ***
399
+
400
+//*** USB ***
401
+
402
+#ifdef HAL_PCD_MODULE_ENABLED
403
+const PinMap PinMap_USB_OTG_FS[] = {
404
+  //{PA_8,  USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF
405
+  //{PA_9,  USB_OTG_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS
406
+  //{PA_10, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID
407
+  {PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM
408
+  {PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP
409
+  {NC,    NP,    0}
410
+};
411
+#endif
412
+
413
+#ifdef HAL_PCD_MODULE_ENABLED
414
+const PinMap PinMap_USB_OTG_HS[] = {
415
+  #ifdef USE_USB_HS_IN_FS
416
+    {PA_4,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_SOF
417
+    {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_ID
418
+    {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_HS_VBUS
419
+    {PB_14, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_DM
420
+    {PB_15, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OTG_HS_FS)}, // USB_OTG_HS_DP
421
+  #else
422
+    {PA_3,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D0
423
+    {PA_5,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_CK
424
+    {PB_0,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D1
425
+    {PB_1,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D2
426
+    {PB_5,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D7
427
+    {PB_10, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D3
428
+    {PB_11, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D4
429
+    {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D5
430
+    {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_D6
431
+    {PC_0,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_STP
432
+    {PC_2,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_DIR
433
+    {PC_3,  USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_HS)}, // USB_OTG_HS_ULPI_NXT
434
+  #endif /* USE_USB_HS_IN_FS */
435
+  {NC,    NP,    0}
436
+};
437
+#endif

+ 50
- 0
buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/PinNamesVar.h Ver arquivo

@@ -0,0 +1,50 @@
1
+/* SYS_WKUP */
2
+#ifdef PWR_WAKEUP_PIN1
3
+  SYS_WKUP1 = PA_0,
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_SOF = PA_8,
29
+  USB_OTG_FS_VBUS = PA_9,
30
+  USB_OTG_FS_ID = PA_10,
31
+  USB_OTG_FS_DM = PA_11,
32
+  USB_OTG_FS_DP = PA_12,
33
+  USB_OTG_HS_ULPI_D0 = PA_3,
34
+  USB_OTG_HS_SOF = PA_4,
35
+  USB_OTG_HS_ULPI_CK = PA_5,
36
+  USB_OTG_HS_ULPI_D1 = PB_0,
37
+  USB_OTG_HS_ULPI_D2 = PB_1,
38
+  USB_OTG_HS_ULPI_D7 = PB_5,
39
+  USB_OTG_HS_ULPI_D3 = PB_10,
40
+  USB_OTG_HS_ULPI_D4 = PB_11,
41
+  USB_OTG_HS_ID = PB_12,
42
+  USB_OTG_HS_ULPI_D5 = PB_12,
43
+  USB_OTG_HS_ULPI_D6 = PB_13,
44
+  USB_OTG_HS_VBUS = PB_13,
45
+  USB_OTG_HS_DM = PB_14,
46
+  USB_OTG_HS_DP = PB_15,
47
+  USB_OTG_HS_ULPI_STP = PC_0,
48
+  USB_OTG_HS_ULPI_DIR = PC_2,
49
+  USB_OTG_HS_ULPI_NXT = PC_3,
50
+#endif

+ 208
- 0
buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/ldscript.ld Ver arquivo

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

+ 481
- 0
buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/stm32f4xx_hal_conf.h Ver arquivo

@@ -0,0 +1,481 @@
1
+/**
2
+  ******************************************************************************
3
+  * @file    stm32f4xx_hal_conf.h
4
+  * @brief   HAL configuration file.
5
+  ******************************************************************************
6
+  * @attention
7
+  *
8
+  * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
9
+  * All rights reserved.</center></h2>
10
+  *
11
+  * This software component is licensed by ST under BSD 3-Clause license,
12
+  * the "License"; You may not use this file except in compliance with the
13
+  * License. You may obtain a copy of the License at:
14
+  *                        opensource.org/licenses/BSD-3-Clause
15
+  *
16
+  ******************************************************************************
17
+  */
18
+
19
+/* Define to prevent recursive inclusion -------------------------------------*/
20
+#ifndef __STM32F4xx_HAL_CONF_H
21
+#define __STM32F4xx_HAL_CONF_H
22
+
23
+#ifdef __cplusplus
24
+extern "C" {
25
+#endif
26
+
27
+/* Exported types ------------------------------------------------------------*/
28
+/* Exported constants --------------------------------------------------------*/
29
+
30
+/* ########################## Module Selection ############################## */
31
+/**
32
+  * @brief This is the list of modules to be used in the HAL driver
33
+  */
34
+#define HAL_MODULE_ENABLED
35
+#define HAL_ADC_MODULE_ENABLED
36
+/* #define HAL_CAN_MODULE_ENABLED   */
37
+/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
38
+#define HAL_CRC_MODULE_ENABLED
39
+/* #define HAL_CEC_MODULE_ENABLED   */
40
+/* #define HAL_CRYP_MODULE_ENABLED   */
41
+#define HAL_DAC_MODULE_ENABLED
42
+/* #define HAL_DCMI_MODULE_ENABLED   */
43
+#define HAL_DMA_MODULE_ENABLED
44
+/* #define HAL_DMA2D_MODULE_ENABLED   */
45
+/* #define HAL_ETH_MODULE_ENABLED   */
46
+#define HAL_FLASH_MODULE_ENABLED
47
+/* #define HAL_NAND_MODULE_ENABLED   */
48
+/* #define HAL_NOR_MODULE_ENABLED   */
49
+/* #define HAL_PCCARD_MODULE_ENABLED   */
50
+/* #define HAL_SRAM_MODULE_ENABLED   */
51
+/* #define HAL_SDRAM_MODULE_ENABLED   */
52
+/* #define HAL_HASH_MODULE_ENABLED   */
53
+#define HAL_GPIO_MODULE_ENABLED
54
+/* #define HAL_EXTI_MODULE_ENABLED   */
55
+#define HAL_I2C_MODULE_ENABLED
56
+/* #define HAL_SMBUS_MODULE_ENABLED   */
57
+/* #define HAL_I2S_MODULE_ENABLED   */
58
+/* #define HAL_IWDG_MODULE_ENABLED   */
59
+/* #define HAL_LTDC_MODULE_ENABLED   */
60
+/* #define HAL_DSI_MODULE_ENABLED   */
61
+#define HAL_PWR_MODULE_ENABLED
62
+/* #define HAL_QSPI_MODULE_ENABLED   */
63
+#define HAL_RCC_MODULE_ENABLED
64
+/* #define HAL_RNG_MODULE_ENABLED   */
65
+#define HAL_RTC_MODULE_ENABLED
66
+/* #define HAL_SAI_MODULE_ENABLED   */
67
+#define HAL_SD_MODULE_ENABLED
68
+#define HAL_SPI_MODULE_ENABLED
69
+#define HAL_TIM_MODULE_ENABLED
70
+/* #define HAL_UART_MODULE_ENABLED   */
71
+/* #define HAL_USART_MODULE_ENABLED   */
72
+/* #define HAL_IRDA_MODULE_ENABLED   */
73
+/* #define HAL_SMARTCARD_MODULE_ENABLED   */
74
+/* #define HAL_WWDG_MODULE_ENABLED   */
75
+#define HAL_CORTEX_MODULE_ENABLED
76
+#define HAL_PCD_MODULE_ENABLED
77
+/* #define HAL_HCD_MODULE_ENABLED   */
78
+/* #define HAL_FMPI2C_MODULE_ENABLED   */
79
+/* #define HAL_SPDIFRX_MODULE_ENABLED   */
80
+/* #define HAL_DFSDM_MODULE_ENABLED   */
81
+/* #define HAL_LPTIM_MODULE_ENABLED   */
82
+/* #define HAL_MMC_MODULE_ENABLED   */
83
+
84
+/* ########################## HSE/HSI Values adaptation ##################### */
85
+/**
86
+  * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
87
+  *        This value is used by the RCC HAL module to compute the system frequency
88
+  *        (when HSE is used as system clock source, directly or through the PLL).
89
+  */
90
+#if !defined  (HSE_VALUE)
91
+#define HSE_VALUE    ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */
92
+#endif /* HSE_VALUE */
93
+
94
+#if !defined  (HSE_STARTUP_TIMEOUT)
95
+#define HSE_STARTUP_TIMEOUT    ((uint32_t)100U)   /*!< Time out for HSE start up, in ms */
96
+#endif /* HSE_STARTUP_TIMEOUT */
97
+
98
+/**
99
+  * @brief Internal High Speed oscillator (HSI) value.
100
+  *        This value is used by the RCC HAL module to compute the system frequency
101
+  *        (when HSI is used as system clock source, directly or through the PLL).
102
+  */
103
+#if !defined  (HSI_VALUE)
104
+#define HSI_VALUE    ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
105
+#endif /* HSI_VALUE */
106
+
107
+/**
108
+  * @brief Internal Low Speed oscillator (LSI) value.
109
+  */
110
+#if !defined  (LSI_VALUE)
111
+#define LSI_VALUE  ((uint32_t)32000U)       /*!< LSI Typical Value in Hz*/
112
+#endif /* LSI_VALUE */                      /*!< Value of the Internal Low Speed oscillator in Hz
113
+The real value may vary depending on the variations
114
+in voltage and temperature.*/
115
+/**
116
+  * @brief External Low Speed oscillator (LSE) value.
117
+  */
118
+#if !defined  (LSE_VALUE)
119
+#define LSE_VALUE  ((uint32_t)32768U)    /*!< Value of the External Low Speed oscillator in Hz */
120
+#endif /* LSE_VALUE */
121
+
122
+#if !defined  (LSE_STARTUP_TIMEOUT)
123
+#define LSE_STARTUP_TIMEOUT    ((uint32_t)5000U)   /*!< Time out for LSE start up, in ms */
124
+#endif /* LSE_STARTUP_TIMEOUT */
125
+
126
+/**
127
+  * @brief External clock source for I2S peripheral
128
+  *        This value is used by the I2S HAL module to compute the I2S clock source
129
+  *        frequency, this source is inserted directly through I2S_CKIN pad.
130
+  */
131
+#if !defined  (EXTERNAL_CLOCK_VALUE)
132
+#define EXTERNAL_CLOCK_VALUE    ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/
133
+#endif /* EXTERNAL_CLOCK_VALUE */
134
+
135
+/* Tip: To avoid modifying this file each time you need to use different HSE,
136
+   ===  you can define the HSE value in your toolchain compiler preprocessor. */
137
+
138
+/* ########################### System Configuration ######################### */
139
+/**
140
+  * @brief This is the HAL system configuration section
141
+  */
142
+#define  VDD_VALUE          ((uint32_t)3300U) /*!< Value of VDD in mv */
143
+#define  TICK_INT_PRIORITY            ((uint32_t)0U)   /*!< tick interrupt priority */
144
+#define  USE_RTOS                     0U
145
+#define  PREFETCH_ENABLE              1U
146
+#define  INSTRUCTION_CACHE_ENABLE     1U
147
+#define  DATA_CACHE_ENABLE            1U
148
+
149
+#define  USE_HAL_ADC_REGISTER_CALLBACKS         0U /* ADC register callback disabled       */
150
+#define  USE_HAL_CAN_REGISTER_CALLBACKS         0U /* CAN register callback disabled       */
151
+#define  USE_HAL_CEC_REGISTER_CALLBACKS         0U /* CEC register callback disabled       */
152
+#define  USE_HAL_CRYP_REGISTER_CALLBACKS        0U /* CRYP register callback disabled      */
153
+#define  USE_HAL_DAC_REGISTER_CALLBACKS         0U /* DAC register callback disabled       */
154
+#define  USE_HAL_DCMI_REGISTER_CALLBACKS        0U /* DCMI register callback disabled      */
155
+#define  USE_HAL_DFSDM_REGISTER_CALLBACKS       0U /* DFSDM register callback disabled     */
156
+#define  USE_HAL_DMA2D_REGISTER_CALLBACKS       0U /* DMA2D register callback disabled     */
157
+#define  USE_HAL_DSI_REGISTER_CALLBACKS         0U /* DSI register callback disabled       */
158
+#define  USE_HAL_ETH_REGISTER_CALLBACKS         0U /* ETH register callback disabled       */
159
+#define  USE_HAL_HASH_REGISTER_CALLBACKS        0U /* HASH register callback disabled      */
160
+#define  USE_HAL_HCD_REGISTER_CALLBACKS         0U /* HCD register callback disabled       */
161
+#define  USE_HAL_I2C_REGISTER_CALLBACKS         0U /* I2C register callback disabled       */
162
+#define  USE_HAL_FMPI2C_REGISTER_CALLBACKS      0U /* FMPI2C register callback disabled    */
163
+#define  USE_HAL_I2S_REGISTER_CALLBACKS         0U /* I2S register callback disabled       */
164
+#define  USE_HAL_IRDA_REGISTER_CALLBACKS        0U /* IRDA register callback disabled      */
165
+#define  USE_HAL_LPTIM_REGISTER_CALLBACKS       0U /* LPTIM register callback disabled     */
166
+#define  USE_HAL_LTDC_REGISTER_CALLBACKS        0U /* LTDC register callback disabled      */
167
+#define  USE_HAL_MMC_REGISTER_CALLBACKS         0U /* MMC register callback disabled       */
168
+#define  USE_HAL_NAND_REGISTER_CALLBACKS        0U /* NAND register callback disabled      */
169
+#define  USE_HAL_NOR_REGISTER_CALLBACKS         0U /* NOR register callback disabled       */
170
+#define  USE_HAL_PCCARD_REGISTER_CALLBACKS      0U /* PCCARD register callback disabled    */
171
+#define  USE_HAL_PCD_REGISTER_CALLBACKS         0U /* PCD register callback disabled       */
172
+#define  USE_HAL_QSPI_REGISTER_CALLBACKS        0U /* QSPI register callback disabled      */
173
+#define  USE_HAL_RNG_REGISTER_CALLBACKS         0U /* RNG register callback disabled       */
174
+#define  USE_HAL_RTC_REGISTER_CALLBACKS         0U /* RTC register callback disabled       */
175
+#define  USE_HAL_SAI_REGISTER_CALLBACKS         0U /* SAI register callback disabled       */
176
+#define  USE_HAL_SD_REGISTER_CALLBACKS          0U /* SD register callback disabled        */
177
+#define  USE_HAL_SMARTCARD_REGISTER_CALLBACKS   0U /* SMARTCARD register callback disabled */
178
+#define  USE_HAL_SDRAM_REGISTER_CALLBACKS       0U /* SDRAM register callback disabled     */
179
+#define  USE_HAL_SRAM_REGISTER_CALLBACKS        0U /* SRAM register callback disabled      */
180
+#define  USE_HAL_SPDIFRX_REGISTER_CALLBACKS     0U /* SPDIFRX register callback disabled   */
181
+#define  USE_HAL_SMBUS_REGISTER_CALLBACKS       0U /* SMBUS register callback disabled     */
182
+#define  USE_HAL_SPI_REGISTER_CALLBACKS         0U /* SPI register callback disabled       */
183
+#define  USE_HAL_TIM_REGISTER_CALLBACKS         0U /* TIM register callback disabled       */
184
+#define  USE_HAL_UART_REGISTER_CALLBACKS        0U /* UART register callback disabled      */
185
+#define  USE_HAL_USART_REGISTER_CALLBACKS       0U /* USART register callback disabled     */
186
+#define  USE_HAL_WWDG_REGISTER_CALLBACKS        0U /* WWDG register callback disabled      */
187
+
188
+/* ########################## Assert Selection ############################## */
189
+/**
190
+  * @brief Uncomment the line below to expanse the "assert_param" macro in the
191
+  *        HAL drivers code
192
+  */
193
+/* #define USE_FULL_ASSERT    1U */
194
+
195
+/* ################## Ethernet peripheral configuration ##################### */
196
+
197
+/* Section 1 : Ethernet peripheral configuration */
198
+
199
+/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
200
+#define MAC_ADDR0   2U
201
+#define MAC_ADDR1   0U
202
+#define MAC_ADDR2   0U
203
+#define MAC_ADDR3   0U
204
+#define MAC_ADDR4   0U
205
+#define MAC_ADDR5   0U
206
+
207
+/* Definition of the Ethernet driver buffers size and count */
208
+#define ETH_RX_BUF_SIZE                ETH_MAX_PACKET_SIZE /* buffer size for receive               */
209
+#define ETH_TX_BUF_SIZE                ETH_MAX_PACKET_SIZE /* buffer size for transmit              */
210
+#define ETH_RXBUFNB                    ((uint32_t)4U)       /* 4 Rx buffers of size ETH_RX_BUF_SIZE  */
211
+#define ETH_TXBUFNB                    ((uint32_t)4U)       /* 4 Tx buffers of size ETH_TX_BUF_SIZE  */
212
+
213
+/* Section 2: PHY configuration section */
214
+
215
+/* DP83848_PHY_ADDRESS Address*/
216
+#define DP83848_PHY_ADDRESS           0x01U
217
+/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
218
+#define PHY_RESET_DELAY                 ((uint32_t)0x000000FFU)
219
+/* PHY Configuration delay */
220
+#define PHY_CONFIG_DELAY                ((uint32_t)0x00000FFFU)
221
+
222
+#define PHY_READ_TO                     ((uint32_t)0x0000FFFFU)
223
+#define PHY_WRITE_TO                    ((uint32_t)0x0000FFFFU)
224
+
225
+/* Section 3: Common PHY Registers */
226
+
227
+#define PHY_BCR                         ((uint16_t)0x0000U)    /*!< Transceiver Basic Control Register   */
228
+#define PHY_BSR                         ((uint16_t)0x0001U)    /*!< Transceiver Basic Status Register    */
229
+
230
+#define PHY_RESET                       ((uint16_t)0x8000U)  /*!< PHY Reset */
231
+#define PHY_LOOPBACK                    ((uint16_t)0x4000U)  /*!< Select loop-back mode */
232
+#define PHY_FULLDUPLEX_100M             ((uint16_t)0x2100U)  /*!< Set the full-duplex mode at 100 Mb/s */
233
+#define PHY_HALFDUPLEX_100M             ((uint16_t)0x2000U)  /*!< Set the half-duplex mode at 100 Mb/s */
234
+#define PHY_FULLDUPLEX_10M              ((uint16_t)0x0100U)  /*!< Set the full-duplex mode at 10 Mb/s  */
235
+#define PHY_HALFDUPLEX_10M              ((uint16_t)0x0000U)  /*!< Set the half-duplex mode at 10 Mb/s  */
236
+#define PHY_AUTONEGOTIATION             ((uint16_t)0x1000U)  /*!< Enable auto-negotiation function     */
237
+#define PHY_RESTART_AUTONEGOTIATION     ((uint16_t)0x0200U)  /*!< Restart auto-negotiation function    */
238
+#define PHY_POWERDOWN                   ((uint16_t)0x0800U)  /*!< Select the power down mode           */
239
+#define PHY_ISOLATE                     ((uint16_t)0x0400U)  /*!< Isolate PHY from MII                 */
240
+
241
+#define PHY_AUTONEGO_COMPLETE           ((uint16_t)0x0020U)  /*!< Auto-Negotiation process completed   */
242
+#define PHY_LINKED_STATUS               ((uint16_t)0x0004U)  /*!< Valid link established               */
243
+#define PHY_JABBER_DETECTION            ((uint16_t)0x0002U)  /*!< Jabber condition detected            */
244
+
245
+/* Section 4: Extended PHY Registers */
246
+#define PHY_SR                          ((uint16_t)0x10U)    /*!< PHY status register Offset                      */
247
+
248
+#define PHY_SPEED_STATUS                ((uint16_t)0x0002U)  /*!< PHY Speed mask                                  */
249
+#define PHY_DUPLEX_STATUS               ((uint16_t)0x0004U)  /*!< PHY Duplex mask                                 */
250
+
251
+/* ################## SPI peripheral configuration ########################## */
252
+
253
+/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
254
+* Activated: CRC code is present inside driver
255
+* Deactivated: CRC code cleaned from driver
256
+*/
257
+
258
+#define USE_SPI_CRC                     0U
259
+
260
+/* Includes ------------------------------------------------------------------*/
261
+/**
262
+  * @brief Include module's header file
263
+  */
264
+
265
+#ifdef HAL_RCC_MODULE_ENABLED
266
+#include "stm32f4xx_hal_rcc.h"
267
+#endif /* HAL_RCC_MODULE_ENABLED */
268
+
269
+#ifdef HAL_GPIO_MODULE_ENABLED
270
+#include "stm32f4xx_hal_gpio.h"
271
+#endif /* HAL_GPIO_MODULE_ENABLED */
272
+
273
+#ifdef HAL_EXTI_MODULE_ENABLED
274
+#include "stm32f4xx_hal_exti.h"
275
+#endif /* HAL_EXTI_MODULE_ENABLED */
276
+
277
+#ifdef HAL_DMA_MODULE_ENABLED
278
+#include "stm32f4xx_hal_dma.h"
279
+#endif /* HAL_DMA_MODULE_ENABLED */
280
+
281
+#ifdef HAL_CORTEX_MODULE_ENABLED
282
+#include "stm32f4xx_hal_cortex.h"
283
+#endif /* HAL_CORTEX_MODULE_ENABLED */
284
+
285
+#ifdef HAL_ADC_MODULE_ENABLED
286
+#include "stm32f4xx_hal_adc.h"
287
+#endif /* HAL_ADC_MODULE_ENABLED */
288
+
289
+#ifdef HAL_CAN_MODULE_ENABLED
290
+#include "stm32f4xx_hal_can.h"
291
+#endif /* HAL_CAN_MODULE_ENABLED */
292
+
293
+#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
294
+#include "stm32f4xx_hal_can_legacy.h"
295
+#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
296
+
297
+#ifdef HAL_CRC_MODULE_ENABLED
298
+#include "stm32f4xx_hal_crc.h"
299
+#endif /* HAL_CRC_MODULE_ENABLED */
300
+
301
+#ifdef HAL_CRYP_MODULE_ENABLED
302
+#include "stm32f4xx_hal_cryp.h"
303
+#endif /* HAL_CRYP_MODULE_ENABLED */
304
+
305
+#ifdef HAL_DMA2D_MODULE_ENABLED
306
+#include "stm32f4xx_hal_dma2d.h"
307
+#endif /* HAL_DMA2D_MODULE_ENABLED */
308
+
309
+#ifdef HAL_DAC_MODULE_ENABLED
310
+#include "stm32f4xx_hal_dac.h"
311
+#endif /* HAL_DAC_MODULE_ENABLED */
312
+
313
+#ifdef HAL_DCMI_MODULE_ENABLED
314
+#include "stm32f4xx_hal_dcmi.h"
315
+#endif /* HAL_DCMI_MODULE_ENABLED */
316
+
317
+#ifdef HAL_ETH_MODULE_ENABLED
318
+#include "stm32f4xx_hal_eth.h"
319
+#endif /* HAL_ETH_MODULE_ENABLED */
320
+
321
+#ifdef HAL_FLASH_MODULE_ENABLED
322
+#include "stm32f4xx_hal_flash.h"
323
+#endif /* HAL_FLASH_MODULE_ENABLED */
324
+
325
+#ifdef HAL_SRAM_MODULE_ENABLED
326
+#include "stm32f4xx_hal_sram.h"
327
+#endif /* HAL_SRAM_MODULE_ENABLED */
328
+
329
+#ifdef HAL_NOR_MODULE_ENABLED
330
+#include "stm32f4xx_hal_nor.h"
331
+#endif /* HAL_NOR_MODULE_ENABLED */
332
+
333
+#ifdef HAL_NAND_MODULE_ENABLED
334
+#include "stm32f4xx_hal_nand.h"
335
+#endif /* HAL_NAND_MODULE_ENABLED */
336
+
337
+#ifdef HAL_PCCARD_MODULE_ENABLED
338
+#include "stm32f4xx_hal_pccard.h"
339
+#endif /* HAL_PCCARD_MODULE_ENABLED */
340
+
341
+#ifdef HAL_SDRAM_MODULE_ENABLED
342
+#include "stm32f4xx_hal_sdram.h"
343
+#endif /* HAL_SDRAM_MODULE_ENABLED */
344
+
345
+#ifdef HAL_HASH_MODULE_ENABLED
346
+#include "stm32f4xx_hal_hash.h"
347
+#endif /* HAL_HASH_MODULE_ENABLED */
348
+
349
+#ifdef HAL_I2C_MODULE_ENABLED
350
+#include "stm32f4xx_hal_i2c.h"
351
+#endif /* HAL_I2C_MODULE_ENABLED */
352
+
353
+#ifdef HAL_SMBUS_MODULE_ENABLED
354
+#include "stm32f4xx_hal_smbus.h"
355
+#endif /* HAL_SMBUS_MODULE_ENABLED */
356
+
357
+#ifdef HAL_I2S_MODULE_ENABLED
358
+#include "stm32f4xx_hal_i2s.h"
359
+#endif /* HAL_I2S_MODULE_ENABLED */
360
+
361
+#ifdef HAL_IWDG_MODULE_ENABLED
362
+#include "stm32f4xx_hal_iwdg.h"
363
+#endif /* HAL_IWDG_MODULE_ENABLED */
364
+
365
+#ifdef HAL_LTDC_MODULE_ENABLED
366
+#include "stm32f4xx_hal_ltdc.h"
367
+#endif /* HAL_LTDC_MODULE_ENABLED */
368
+
369
+#ifdef HAL_PWR_MODULE_ENABLED
370
+#include "stm32f4xx_hal_pwr.h"
371
+#endif /* HAL_PWR_MODULE_ENABLED */
372
+
373
+#ifdef HAL_RNG_MODULE_ENABLED
374
+#include "stm32f4xx_hal_rng.h"
375
+#endif /* HAL_RNG_MODULE_ENABLED */
376
+
377
+#ifdef HAL_RTC_MODULE_ENABLED
378
+#include "stm32f4xx_hal_rtc.h"
379
+#endif /* HAL_RTC_MODULE_ENABLED */
380
+
381
+#ifdef HAL_SAI_MODULE_ENABLED
382
+#include "stm32f4xx_hal_sai.h"
383
+#endif /* HAL_SAI_MODULE_ENABLED */
384
+
385
+#ifdef HAL_SD_MODULE_ENABLED
386
+#include "stm32f4xx_hal_sd.h"
387
+#endif /* HAL_SD_MODULE_ENABLED */
388
+
389
+#ifdef HAL_SPI_MODULE_ENABLED
390
+#include "stm32f4xx_hal_spi.h"
391
+#endif /* HAL_SPI_MODULE_ENABLED */
392
+
393
+#ifdef HAL_TIM_MODULE_ENABLED
394
+#include "stm32f4xx_hal_tim.h"
395
+#endif /* HAL_TIM_MODULE_ENABLED */
396
+
397
+#ifdef HAL_UART_MODULE_ENABLED
398
+#include "stm32f4xx_hal_uart.h"
399
+#endif /* HAL_UART_MODULE_ENABLED */
400
+
401
+#ifdef HAL_USART_MODULE_ENABLED
402
+#include "stm32f4xx_hal_usart.h"
403
+#endif /* HAL_USART_MODULE_ENABLED */
404
+
405
+#ifdef HAL_IRDA_MODULE_ENABLED
406
+#include "stm32f4xx_hal_irda.h"
407
+#endif /* HAL_IRDA_MODULE_ENABLED */
408
+
409
+#ifdef HAL_SMARTCARD_MODULE_ENABLED
410
+#include "stm32f4xx_hal_smartcard.h"
411
+#endif /* HAL_SMARTCARD_MODULE_ENABLED */
412
+
413
+#ifdef HAL_WWDG_MODULE_ENABLED
414
+#include "stm32f4xx_hal_wwdg.h"
415
+#endif /* HAL_WWDG_MODULE_ENABLED */
416
+
417
+#ifdef HAL_PCD_MODULE_ENABLED
418
+#include "stm32f4xx_hal_pcd.h"
419
+#endif /* HAL_PCD_MODULE_ENABLED */
420
+
421
+#ifdef HAL_HCD_MODULE_ENABLED
422
+#include "stm32f4xx_hal_hcd.h"
423
+#endif /* HAL_HCD_MODULE_ENABLED */
424
+
425
+#ifdef HAL_DSI_MODULE_ENABLED
426
+#include "stm32f4xx_hal_dsi.h"
427
+#endif /* HAL_DSI_MODULE_ENABLED */
428
+
429
+#ifdef HAL_QSPI_MODULE_ENABLED
430
+#include "stm32f4xx_hal_qspi.h"
431
+#endif /* HAL_QSPI_MODULE_ENABLED */
432
+
433
+#ifdef HAL_CEC_MODULE_ENABLED
434
+#include "stm32f4xx_hal_cec.h"
435
+#endif /* HAL_CEC_MODULE_ENABLED */
436
+
437
+#ifdef HAL_FMPI2C_MODULE_ENABLED
438
+#include "stm32f4xx_hal_fmpi2c.h"
439
+#endif /* HAL_FMPI2C_MODULE_ENABLED */
440
+
441
+#ifdef HAL_SPDIFRX_MODULE_ENABLED
442
+#include "stm32f4xx_hal_spdifrx.h"
443
+#endif /* HAL_SPDIFRX_MODULE_ENABLED */
444
+
445
+#ifdef HAL_DFSDM_MODULE_ENABLED
446
+#include "stm32f4xx_hal_dfsdm.h"
447
+#endif /* HAL_DFSDM_MODULE_ENABLED */
448
+
449
+#ifdef HAL_LPTIM_MODULE_ENABLED
450
+#include "stm32f4xx_hal_lptim.h"
451
+#endif /* HAL_LPTIM_MODULE_ENABLED */
452
+
453
+#ifdef HAL_MMC_MODULE_ENABLED
454
+#include "stm32f4xx_hal_mmc.h"
455
+#endif /* HAL_MMC_MODULE_ENABLED */
456
+
457
+/* Exported macro ------------------------------------------------------------*/
458
+#ifdef  USE_FULL_ASSERT
459
+/**
460
+  * @brief  The assert_param macro is used for function's parameters check.
461
+  * @param  expr: If expr is false, it calls assert_failed function
462
+  *         which reports the name of the source file and the source
463
+  *         line number of the call that failed.
464
+  *         If expr is true, it returns no value.
465
+  * @retval None
466
+  */
467
+#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
468
+/* Exported functions ------------------------------------------------------- */
469
+void assert_failed(uint8_t *file, uint32_t line);
470
+#else
471
+#define assert_param(expr) ((void)0U)
472
+#endif /* USE_FULL_ASSERT */
473
+
474
+#ifdef __cplusplus
475
+}
476
+#endif
477
+
478
+#endif /* __STM32F4xx_HAL_CONF_H */
479
+
480
+
481
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

+ 287
- 0
buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/variant.cpp Ver arquivo

@@ -0,0 +1,287 @@
1
+/*
2
+ *******************************************************************************
3
+ * Copyright (c) 2017, STMicroelectronics
4
+ * All rights reserved.
5
+ *
6
+ * Redistribution and use in source and binary forms, with or without
7
+ * modification, are permitted provided that the following conditions are met:
8
+ *
9
+ * 1. Redistributions of source code must retain the above copyright notice,
10
+ *    this list of conditions and the following disclaimer.
11
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ *    this list of conditions and the following disclaimer in the documentation
13
+ *    and/or other materials provided with the distribution.
14
+ * 3. Neither the name of STMicroelectronics nor the names of its contributors
15
+ *    may be used to endorse or promote products derived from this software
16
+ *    without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ *******************************************************************************
29
+ */
30
+
31
+#include "variant.h"
32
+
33
+#ifdef __cplusplus
34
+extern "C" {
35
+#endif
36
+
37
+// Pin number
38
+// This array allows to wrap Arduino pin number(Dx or x)
39
+// to STM32 PinName (PX_n)
40
+const PinName digitalPin[] = {
41
+#if STM32F4X_PIN_NUM >= 64  //64 pins mcu, 51 gpio
42
+  PC_13, //D0
43
+  PC_14, //D1  - OSC32_IN
44
+  PC_15, //D2  - OSC32_OUT
45
+  PH_0,  //D3  - OSC_IN
46
+  PH_1,  //D4  - OSC_OUT
47
+  PC_0,  //D5  - 1:  2:ADC123_IN10
48
+  PC_1,  //D6  - 1:  2:ADC123_IN11
49
+  PC_2,  //D7  - 1:SPI2_MISO  2:ADC123_IN12
50
+  PC_3,  //D8  - 1:SPI2_MOSI  2:ADC123_IN13
51
+  PA_0,  //D9  - 1:UART4_TX / TIM5_CH1  2:ADC123_IN0
52
+  PA_1,  //D10 - 1:UART4_RX / TIM5_CH2 / TIM2_CH2  2:ADC123_IN1
53
+  PA_2,  //D11 - 1:USART2_TX /TIM5_CH3 / TIM9_CH1 / TIM2_CH3  2:ADC123_IN2
54
+  PA_3,  //D12 - 1:USART2_RX /TIM5_CH4 / TIM9_CH2 / TIM2_CH4  2:ADC123_IN3
55
+  PA_4,  //D13 - NOT FT 1:SPI1_NSS / SPI3_NSS / USART2_CK  2:ADC12_IN4 / DAC_OUT1
56
+  PA_5,  //D14 - NOT FT 1:SPI1_SCK  2:ADC12_IN5 / DAC_OUT2
57
+  PA_6,  //D15 - 1:SPI1_MISO / TIM13_CH1 / TIM3_CH1  2:ADC12_IN6
58
+  PA_7,  //D16 - 1:SPI1_MOSI / TIM14_CH1 / TIM3_CH2  2:ADC12_IN7
59
+  PC_4,  //D17 - 1:  2:ADC12_IN14
60
+  PC_5,  //D18 - 1:  2:ADC12_IN15
61
+  PB_0,  //D19 - 1:TIM3_CH3  2:ADC12_IN8
62
+  PB_1,  //D20 - 1:TIM3_CH4  2:ADC12_IN9
63
+  PB_2,  //D21 - BOOT1
64
+  PB_10, //D22 - 1:SPI2_SCK / I2C2_SCL / USART3_TX / TIM2_CH3
65
+  PB_11, //D23 - 1:I2C2_SDA / USART3_RX / TIM2_CH4
66
+  PB_12, //D24 - 1:SPI2_NSS / OTG_HS_ID
67
+  PB_13, //D25 - 1:SPI2_SCK  2:OTG_HS_VBUS
68
+  PB_14, //D26 - 1:SPI2_MISO / TIM12_CH1 / OTG_HS_DM
69
+  PB_15, //D27 - SPI2_MOSI / TIM12_CH2 / OTG_HS_DP
70
+  PC_6,  //D28 - 1:TIM8_CH1 / SDIO_D6 / USART6_TX / TIM3_CH1
71
+  PC_7,  //D29 - 1:TIM8_CH2 / SDIO_D7 / USART6_RX / TIM3_CH2
72
+  PC_8,  //D30 - 1:TIM8_CH3 / SDIO_D0 / TIM3_CH3
73
+  PC_9,  //D31 - 1:TIM8_CH4 / SDIO_D1 / TIM3_CH4
74
+  PA_8,  //D32 - 1:TIM1_CH1 / I2C3_SCL / OTG_FS_SOF
75
+  PA_9,  //D33 - 1:USART1_TX / TIM1_CH2  2:OTG_FS_VBUS
76
+  PA_10, //34 - 1:USART1_RX / TIM1_CH3 / OTG_FS_ID
77
+  PA_11, //D35 - 1:TIM1_CH4 / OTG_FS_DM
78
+  PA_12, //D36 - 1:OTG_FS_DP
79
+  PA_13, //D37 - 0:JTMS-SWDIO
80
+  PA_14, //D38 - 0:JTCK-SWCLK
81
+  PA_15, //D39 - 0:JTDI  1:SPI3_NSS / SPI1_NSS
82
+  PC_10, //D40 - 1:UART4_TX / SPI3_SCK / SDIO_D2 / USART3_TX
83
+  PC_11, //D41 - 1:UART4_RX / SPI3_MISO / SDIO_D3 / USART3_RX
84
+  PC_12, //D42 - 1:UART5_TX / SPI3_MOSI / SDIO_CK
85
+  PD_2,  //D43 - 1:UART5_RX / SDIO_CMD
86
+  PB_3,  //D44 - 0:JTDO  1:SPI3_SCK / TIM2_CH2 / SPI1_SCK
87
+  PB_4,  //D45 - 0:NJTRST  1:SPI3_MISO / TIM3_CH1 / SPI1_MISO
88
+  PB_5,  //D45 - 1:TIM3_CH2 / SPI1_MOSI / SPI3_MOSI
89
+  PB_6,  //D47 - 1:I2C1_SCL / TIM4_CH1 / USART1_TX
90
+  PB_7,  //D48 - 1:I2C1_SDA / TIM4_CH2 / USART1_RX
91
+  PB_8,  //D49 - 1:I2C1_SCL / TIM4_CH3 / SDIO_D4 / TIM10_CH1
92
+  PB_9,  //D50 - 1:I2C1_SDA / TIM4_CH4 / SDIO_D5 / TIM11_CH1 / SPI2_NSS
93
+#endif
94
+#if STM32F4X_PIN_NUM >= 100  //100 pins mcu, 82 gpio
95
+  PE_2,  //D51 - 1:FSMC_A23
96
+  PE_3,  //D52 - 1:FSMC_A19
97
+  PE_4,  //D53 - 1:FSMC_A20
98
+  PE_5,  //D54 - 1:FSMC_A21
99
+  PE_6,  //D55 - 1:FSMC_A22
100
+  PE_7,  //D56 - 1:FSMC_D4
101
+  PE_8,  //D57 - 1:FSMC_D5
102
+  PE_9,  //D58 - 1:FSMC_D6 / TIM1_CH1
103
+  PE_10, //D59 - 1:FSMC_D7
104
+  PE_11, //D60 - 1:FSMC_D8 / TIM1_CH2
105
+  PE_12, //D61 - 1:FSMC_D9
106
+  PE_13, //D62 - 1:FSMC_D10 / TIM1_CH3
107
+  PE_14, //D63 - 1:FSMC_D11 / TIM1_CH4
108
+  PE_15, //D64 - 1:FSMC_D12
109
+  PD_8,  //D65 - 1:FSMC_D13 / USART3_TX
110
+  PD_9,  //D66 - 1:FSMC_D14 / USART3_RX
111
+  PD_10, //D67 - 1:FSMC_D15 
112
+  PD_11, //D68 - 1:FSMC_A16
113
+  PD_12, //D69 - 1:FSMC_A17 / TIM4_CH1
114
+  PD_13, //D70 - 1:FSMC_A18 / TIM4_CH2
115
+  PD_14, //D71 - 1:FSMC_D0 / TIM4_CH3
116
+  PD_15, //D72 - 1:FSMC_D1 / TIM4_CH4
117
+  PD_0,  //D73 - 1:FSMC_D2
118
+  PD_1,  //D74 - 1:FSMC_D3
119
+  PD_3,  //D75 - 1:FSMC_CLK
120
+  PD_4,  //D76 - 1:FSMC_NOE
121
+  PD_5,  //D77 - 1:USART2_TX
122
+  PD_6,  //D78 - 1:USART2_RX
123
+  PD_7,  //D79
124
+  PE_0,  //D80
125
+  PE_1,  //D81
126
+#endif
127
+#if STM32F4X_PIN_NUM >= 144  //144 pins mcu, 114 gpio
128
+  PF_0,  //D82 - 1:FSMC_A0 / I2C2_SDA
129
+  PF_1,  //D83 - 1:FSMC_A1 / I2C2_SCL
130
+  PF_2,  //D84 - 1:FSMC_A2
131
+  PF_3,  //D85 - 1:FSMC_A3  2:ADC3_IN9
132
+  PF_4,  //D86 - 1:FSMC_A4  2:ADC3_IN14
133
+  PF_5,  //D87 - 1:FSMC_A5  2:ADC3_IN15
134
+  PF_6,  //D88 - 1:TIM10_CH1  2:ADC3_IN4
135
+  PF_7,  //D89 - 1:TIM11_CH1  2:ADC3_IN5
136
+  PF_8,  //D90 - 1:TIM13_CH1  2:ADC3_IN6
137
+  PF_9,  //D91 - 1;TIM14_CH1  2:ADC3_IN7
138
+  PF_10, //D92 - 2:ADC3_IN8
139
+  PF_11, //D93
140
+  PF_12, //D94 - 1:FSMC_A6
141
+  PF_13, //D95 - 1:FSMC_A7
142
+  PF_14, //D96 - 1:FSMC_A8
143
+  PF_15, //D97 - 1:FSMC_A9
144
+  PG_0,  //D98 - 1:FSMC_A10
145
+  PG_1,  //D99 - 1:FSMC_A11
146
+  PG_2,  //D100 - 1:FSMC_A12
147
+  PG_3,  //D101 - 1:FSMC_A13
148
+  PG_4,  //D102 - 1:FSMC_A14
149
+  PG_5,  //D103 - 1:FSMC_A15
150
+  PG_6,  //D104
151
+  PG_7,  //D105
152
+  PG_8,  //D106
153
+  PG_9,  //D107 - 1:USART6_RX
154
+  PG_10, //D108 - 1:FSMC_NE3
155
+  PG_11, //D109
156
+  PG_12, //D110 - 1:FSMC_NE4
157
+  PG_13, //D111 - 1:FSMC_A24
158
+  PG_14, //D112 - 1:FSMC_A25 / USART6_TX
159
+  PG_15, //D113
160
+#endif
161
+#if STM32F4X_PIN_NUM >= 176  //176 pins mcu, 140 gpio
162
+  PI_8,  //D114
163
+  PI_9,  //D115
164
+  PI_10, //D116
165
+  PI_11, //D117
166
+  PH_2,  //D118
167
+  PH_3,  //D119
168
+  PH_4,  //D120 - 1:I2C2_SCL
169
+  PH_5,  //D121 - 1:I2C2_SDA
170
+  PH_6,  //D122 - 1:TIM12_CH1
171
+  PH_7,  //D123 - 1:I2C3_SCL
172
+  PH_8,  //D124 - 1:I2C3_SDA
173
+  PH_9,  //D125 - 1:TIM12_CH2
174
+  PH_10, //D126 - 1:TIM5_CH1
175
+  PH_11, //D127 - 1:TIM5_CH2
176
+  PH_12, //D128 - 1:TIM5_CH3
177
+  PH_13, //D129
178
+  PH_14, //D130
179
+  PH_15, //D131
180
+  PI_0,  //D132 - 1:TIM5_CH4 / SPI2_NSS
181
+  PI_1,  //D133 - 1:SPI2_SCK
182
+  PI_2,  //D134 - 1:TIM8_CH4 /SPI2_MISO
183
+  PI_3,  //D135 - 1:SPI2_MOS
184
+  PI_4,  //D136
185
+  PI_5,  //D137 - 1:TIM8_CH1
186
+  PI_6,  //D138 - 1:TIM8_CH2
187
+  PI_7,  //D139 - 1:TIM8_CH3
188
+#endif
189
+#if STM32F4X_PIN_NUM >= 64  //64 pins mcu, 51 gpio, 16 ADC
190
+  PA_0,  //D140/A0 = D9  - 1:UART4_TX / TIM5_CH1  2:ADC123_IN0
191
+  PA_1,  //D141/A1 = D10 - 1:UART4_RX / TIM5_CH2 / TIM2_CH2  2:ADC123_IN1
192
+  PA_2,  //D142/A2 = D11 - 1:USART2_TX /TIM5_CH3 / TIM9_CH1 / TIM2_CH3  2:ADC123_IN2
193
+  PA_3,  //D143/A3 = D12 - 1:USART2_RX /TIM5_CH4 / TIM9_CH2 / TIM2_CH4  2:ADC123_IN3
194
+  PA_4,  //D144/A4 = D13 - NOT FT 1:SPI1_NSS / SPI3_NSS / USART2_CK  2:ADC12_IN4 / DAC_OUT1
195
+  PA_5,  //D145/A5 = D14 - NOT FT 1:SPI1_SCK  2:ADC12_IN5 / DAC_OUT2
196
+  PA_6,  //D146/A6 = D15 - 1:SPI1_MISO / TIM13_CH1 / TIM3_CH1  2:ADC12_IN6
197
+  PA_7,  //D147/A7 = D16 - 1:SPI1_MOSI / TIM14_CH1 / TIM3_CH2  2:ADC12_IN7
198
+  PB_0,  //D148/A8 = D19 - 1:TIM3_CH3  2:ADC12_IN8
199
+  PB_1,  //D149/A9 = D20 - 1:TIM3_CH4  2:ADC12_IN9
200
+  PC_0,  //D150/A10 = D5  - 1:  2:ADC123_IN10
201
+  PC_1,  //D151/A11 = D6  - 1:  2:ADC123_IN11
202
+  PC_2,  //D152/A12 = D7  - 1:SPI2_MISO  2:ADC123_IN12
203
+  PC_3,  //D153/A13 = D8  - 1:SPI2_MOSI  2:ADC123_IN13
204
+  PC_4,  //D154/A14 = D17 - 1:  2:ADC12_IN14
205
+  PC_5,  //D155/A15 = D18 - 1:  2:ADC12_IN15
206
+#endif
207
+#if STM32F4X_PIN_NUM >= 144  //144 pins mcu, 114 gpio, 24 ADC
208
+  PF_3,  //D156/A16 = D85 - 1:FSMC_A3  2:ADC3_IN9
209
+  PF_4,  //D157/A17 = D86 - 1:FSMC_A4  2:ADC3_IN14
210
+  PF_5,  //D158/A18 = D87 - 1:FSMC_A5  2:ADC3_IN15
211
+  PF_6,  //D159/A19 = D88 - 1:TIM10_CH1  2:ADC3_IN4
212
+  PF_7,  //D160/A20 = D89 - 1:TIM11_CH1  2:ADC3_IN5
213
+  PF_8,  //D161/A21 = D90 - 1:TIM13_CH1  2:ADC3_IN6
214
+  PF_9,  //D162/A22 = D91 - 1;TIM14_CH1  2:ADC3_IN7
215
+  PF_10, //D163/A23 = D92 - 2:ADC3_IN8
216
+#endif
217
+};
218
+
219
+#ifdef __cplusplus
220
+}
221
+#endif
222
+
223
+// ----------------------------------------------------------------------------
224
+
225
+#ifdef __cplusplus
226
+extern "C" {
227
+#endif
228
+
229
+/**
230
+  * @brief  System Clock Configuration
231
+  * @param  None
232
+  * @retval None
233
+  */
234
+WEAK void SystemClock_Config(void)
235
+{
236
+
237
+  RCC_OscInitTypeDef RCC_OscInitStruct;
238
+  RCC_ClkInitTypeDef RCC_ClkInitStruct;
239
+
240
+  /**Configure the main internal regulator output voltage
241
+  */
242
+  __HAL_RCC_PWR_CLK_ENABLE();
243
+
244
+  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
245
+
246
+  /**Initializes the CPU, AHB and APB busses clocks
247
+  */
248
+  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
249
+  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
250
+  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
251
+  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
252
+  RCC_OscInitStruct.PLL.PLLM = 8;
253
+  RCC_OscInitStruct.PLL.PLLN = 336;
254
+  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
255
+  RCC_OscInitStruct.PLL.PLLQ = 7;
256
+  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
257
+    _Error_Handler(__FILE__, __LINE__);
258
+  }
259
+
260
+  /**Initializes the CPU, AHB and APB busses clocks
261
+  */
262
+  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
263
+                                | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
264
+  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
265
+  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
266
+  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
267
+  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
268
+
269
+  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) {
270
+    _Error_Handler(__FILE__, __LINE__);
271
+  }
272
+
273
+  /**Configure the Systick interrupt time
274
+  */
275
+  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000);
276
+
277
+  /**Configure the Systick
278
+  */
279
+  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
280
+
281
+  /* SysTick_IRQn interrupt configuration */
282
+  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
283
+}
284
+
285
+#ifdef __cplusplus
286
+}
287
+#endif

+ 296
- 0
buildroot/share/PlatformIO/variants/BIGTREE_GENERIC_STM32F407_5X/variant.h Ver arquivo

@@ -0,0 +1,296 @@
1
+/*
2
+ *******************************************************************************
3
+ * Copyright (c) 2017, STMicroelectronics
4
+ * All rights reserved.
5
+ *
6
+ * Redistribution and use in source and binary forms, with or without
7
+ * modification, are permitted provided that the following conditions are met:
8
+ *
9
+ * 1. Redistributions of source code must retain the above copyright notice,
10
+ *    this list of conditions and the following disclaimer.
11
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ *    this list of conditions and the following disclaimer in the documentation
13
+ *    and/or other materials provided with the distribution.
14
+ * 3. Neither the name of STMicroelectronics nor the names of its contributors
15
+ *    may be used to endorse or promote products derived from this software
16
+ *    without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ *******************************************************************************
29
+ */
30
+
31
+#ifndef _VARIANT_ARDUINO_STM32_
32
+#define _VARIANT_ARDUINO_STM32_
33
+
34
+/*----------------------------------------------------------------------------
35
+ *        Headers
36
+ *----------------------------------------------------------------------------*/
37
+#include "PeripheralPins.h"
38
+
39
+#ifdef __cplusplus
40
+extern "C" {
41
+#endif // __cplusplus
42
+
43
+/*----------------------------------------------------------------------------
44
+ *        Pins
45
+ *----------------------------------------------------------------------------*/
46
+extern const PinName digitalPin[];
47
+
48
+#ifdef STM32F405RX
49
+  #define STM32F4X_PIN_NUM  64  //64 pins mcu, 51 gpio
50
+  #define STM32F4X_GPIO_NUM 51
51
+  #define STM32F4X_ADC_NUM  16
52
+#elif defined STM32F407_5VX
53
+  #define STM32F4X_PIN_NUM  100  //100 pins mcu, 82 gpio
54
+  #define STM32F4X_GPIO_NUM 82
55
+  #define STM32F4X_ADC_NUM  16
56
+#elif defined STM32F407_5ZX
57
+  #define STM32F4X_PIN_NUM  144  //144 pins mcu, 114 gpio
58
+  #define STM32F4X_GPIO_NUM 114
59
+  #define STM32F4X_ADC_NUM  24
60
+#elif defined STM32F407IX
61
+  #define STM32F4X_PIN_NUM  176  //176 pins mcu, 140 gpio
62
+  #define STM32F4X_GPIO_NUM 140
63
+  #define STM32F4X_ADC_NUM  24
64
+#else
65
+  #error "no match MCU defined"
66
+#endif
67
+
68
+#if STM32F4X_PIN_NUM >= 64  //64 pins mcu, 51 gpio
69
+  #define PC13  0
70
+  #define PC14  1  //OSC32_IN
71
+  #define PC15  2  //OSC32_OUT
72
+  #define PH0   3  //OSC_IN
73
+  #define PH1   4  //OSC_OUT
74
+  #define PC0   5  //1:  2:ADC123_IN10
75
+  #define PC1   6  //1:  2:ADC123_IN11
76
+  #define PC2   7  //1:SPI2_MISO  2:ADC123_IN12
77
+  #define PC3   8  //1:SPI2_MOSI  2:ADC123_IN13
78
+  #define PA0   9  //1:UART4_TX / TIM5_CH1  2:ADC123_IN0
79
+  #define PA1   10 //1:UART4_RX / TIM5_CH2 / TIM2_CH2  2:ADC123_IN1
80
+  #define PA2   11 //1:USART2_TX /TIM5_CH3 / TIM9_CH1 / TIM2_CH3  2:ADC123_IN2
81
+  #define PA3   12 //1:USART2_RX /TIM5_CH4 / TIM9_CH2 / TIM2_CH4  2:ADC123_IN3
82
+  #define PA4   13 //NOT FT 1:SPI1_NSS / SPI3_NSS / USART2_CK  2:ADC12_IN4 / DAC_OUT1
83
+  #define PA5   14 //NOT FT 1:SPI1_SCK  2:ADC12_IN5 / DAC_OUT2
84
+  #define PA6   15 //1:SPI1_MISO / TIM13_CH1 / TIM3_CH1  2:ADC12_IN6
85
+  #define PA7   16 //1:SPI1_MOSI / TIM14_CH1 / TIM3_CH2  2:ADC12_IN7
86
+  #define PC4   17 //1:  2:ADC12_IN14
87
+  #define PC5   18 //1:  2:ADC12_IN15
88
+  #define PB0   19 //1:TIM3_CH3  2:ADC12_IN8
89
+  #define PB1   20 //1:TIM3_CH4  2:ADC12_IN9
90
+  #define PB2   21 //BOOT1
91
+  #define PB10  22 //1:SPI2_SCK / I2C2_SCL / USART3_TX / TIM2_CH3
92
+  #define PB11  23 //1:I2C2_SDA / USART3_RX / TIM2_CH4
93
+  #define PB12  24 //1:SPI2_NSS / OTG_HS_ID
94
+  #define PB13  25 //1:SPI2_SCK  2:OTG_HS_VBUS
95
+  #define PB14  26 //1:SPI2_MISO / TIM12_CH1 / OTG_HS_DM
96
+  #define PB15  27 //SPI2_MOSI / TIM12_CH2 / OTG_HS_DP
97
+  #define PC6   28 //1:TIM8_CH1 / SDIO_D6 / USART6_TX / TIM3_CH1
98
+  #define PC7   29 //1:TIM8_CH2 / SDIO_D7 / USART6_RX / TIM3_CH2
99
+  #define PC8   30 //1:TIM8_CH3 / SDIO_D0 / TIM3_CH3
100
+  #define PC9   31 //1:TIM8_CH4 / SDIO_D1 / TIM3_CH4
101
+  #define PA8   32 //1:TIM1_CH1 / I2C3_SCL / OTG_FS_SOF
102
+  #define PA9   33 //1:USART1_TX / TIM1_CH2  2:OTG_FS_VBUS
103
+  #define PA10  34 //1:USART1_RX / TIM1_CH3 / OTG_FS_ID
104
+  #define PA11  35 //1:TIM1_CH4 / OTG_FS_DM
105
+  #define PA12  36 //1:OTG_FS_DP
106
+  #define PA13  37 //0:JTMS-SWDIO
107
+  #define PA14  38 //0:JTCK-SWCLK
108
+  #define PA15  39 //0:JTDI  1:SPI3_NSS / SPI1_NSS
109
+  #define PC10  40 //1:UART4_TX / SPI3_SCK / SDIO_D2 / USART3_TX
110
+  #define PC11  41 //1:UART4_RX / SPI3_MISO / SDIO_D3 / USART3_RX
111
+  #define PC12  42 //1:UART5_TX / SPI3_MOSI / SDIO_CK
112
+  #define PD2   43 //1:UART5_RX / SDIO_CMD
113
+  #define PB3   44 //0:JTDO  1:SPI3_SCK / TIM2_CH2 / SPI1_SCK
114
+  #define PB4   45 //0:NJTRST  1:SPI3_MISO / TIM3_CH1 / SPI1_MISO
115
+  #define PB5   45 //1:TIM3_CH2 / SPI1_MOSI / SPI3_MOSI
116
+  #define PB6   47 //1:I2C1_SCL / TIM4_CH1 / USART1_TX
117
+  #define PB7   48 //1:I2C1_SDA / TIM4_CH2 / USART1_RX
118
+  #define PB8   49 //1:I2C1_SCL / TIM4_CH3 / SDIO_D4 / TIM10_CH1
119
+  #define PB9   50 //1:I2C1_SDA / TIM4_CH4 / SDIO_D5 / TIM11_CH1 / SPI2_NSS
120
+#endif
121
+#if STM32F4X_PIN_NUM >= 100  //100 pins mcu, 82 gpio
122
+  #define PE2   51 //1:FSMC_A23
123
+  #define PE3   52 //1:FSMC_A19
124
+  #define PE4   53 //1:FSMC_A20
125
+  #define PE5   54 //1:FSMC_A21
126
+  #define PE6   55 //1:FSMC_A22
127
+  #define PE7   56 //1:FSMC_D4
128
+  #define PE8   57 //1:FSMC_D5
129
+  #define PE9   58 //1:FSMC_D6 / TIM1_CH1
130
+  #define PE10  59 //1:FSMC_D7
131
+  #define PE11  60 //1:FSMC_D8 / TIM1_CH2
132
+  #define PE12  61 //1:FSMC_D9
133
+  #define PE13  62 //1:FSMC_D10 / TIM1_CH3
134
+  #define PE14  63 //1:FSMC_D11 / TIM1_CH4
135
+  #define PE15  64 //1:FSMC_D12
136
+  #define PD8   65 //1:FSMC_D13 / USART3_TX
137
+  #define PD9   66 //1:FSMC_D14 / USART3_RX
138
+  #define PD10  67 //1:FSMC_D15 
139
+  #define PD11  68 //1:FSMC_A16
140
+  #define PD12  69 //1:FSMC_A17 / TIM4_CH1
141
+  #define PD13  70 //1:FSMC_A18 / TIM4_CH2
142
+  #define PD14  71 //1:FSMC_D0 / TIM4_CH3
143
+  #define PD15  72 //1:FSMC_D1 / TIM4_CH4
144
+  #define PD0   73 //1:FSMC_D2
145
+  #define PD1   74 //1:FSMC_D3
146
+  #define PD3   75 //1:FSMC_CLK
147
+  #define PD4   76 //1:FSMC_NOE
148
+  #define PD5   77 //1:USART2_TX
149
+  #define PD6   78 //1:USART2_RX
150
+  #define PD7   79
151
+  #define PE0   80
152
+  #define PE1   81
153
+#endif
154
+#if STM32F4X_PIN_NUM >= 144  //144 pins mcu, 114 gpio
155
+  #define PF0   82 //1:FSMC_A0 / I2C2_SDA
156
+  #define PF1   83 //1:FSMC_A1 / I2C2_SCL
157
+  #define PF2   84 //1:FSMC_A2
158
+  #define PF3   85 //1:FSMC_A3  2:ADC3_IN9
159
+  #define PF4   86 //1:FSMC_A4  2:ADC3_IN14
160
+  #define PF5   87 //1:FSMC_A5  2:ADC3_IN15
161
+  #define PF6   88 //1:TIM10_CH1  2:ADC3_IN4
162
+  #define PF7   89 //1:TIM11_CH1  2:ADC3_IN5
163
+  #define PF8   90 //1:TIM13_CH1  2:ADC3_IN6
164
+  #define PF9   91 //1;TIM14_CH1  2:ADC3_IN7
165
+  #define PF10  92 //2:ADC3_IN8
166
+  #define PF11  93
167
+  #define PF12  94 //1:FSMC_A6
168
+  #define PF13  95 //1:FSMC_A7
169
+  #define PF14  96 //1:FSMC_A8
170
+  #define PF15  97 //1:FSMC_A9
171
+  #define PG0   98 //1:FSMC_A10
172
+  #define PG1   99 //1:FSMC_A11
173
+  #define PG2   100 //1:FSMC_A12
174
+  #define PG3   101 //1:FSMC_A13
175
+  #define PG4   102 //1:FSMC_A14
176
+  #define PG5   103 //1:FSMC_A15
177
+  #define PG6   104
178
+  #define PG7   105
179
+  #define PG8   106
180
+  #define PG9   107 //1:USART6_RX
181
+  #define PG10  108 //1:FSMC_NE3
182
+  #define PG11  109
183
+  #define PG12  110 //1:FSMC_NE4
184
+  #define PG13  111 //1:FSMC_A24
185
+  #define PG14  112 //1:FSMC_A25 / USART6_TX
186
+  #define PG15  113
187
+#endif
188
+#if STM32F4X_PIN_NUM >= 176  //176 pins mcu, 140 gpio
189
+  #define PI8   114
190
+  #define PI9   115
191
+  #define PI10  116
192
+  #define PI11  117
193
+  #define PH2   118
194
+  #define PH3   119
195
+  #define PH4   120 //1:I2C2_SCL
196
+  #define PH5   121 //1:I2C2_SDA
197
+  #define PH6   122 //1:TIM12_CH1
198
+  #define PH7   123 //1:I2C3_SCL
199
+  #define PH8   124 //1:I2C3_SDA
200
+  #define PH9   125 //1:TIM12_CH2
201
+  #define PH10  126 //1:TIM5_CH1
202
+  #define PH11  127 //1:TIM5_CH2
203
+  #define PH12  128 //1:TIM5_CH3
204
+  #define PH13  129
205
+  #define PH14  130
206
+  #define PH15  131
207
+  #define PI0   132 //1:TIM5_CH4 / SPI2_NSS
208
+  #define PI1   133 //1:SPI2_SCK
209
+  #define PI2   134 //1:TIM8_CH4 /SPI2_MISO
210
+  #define PI3   135 //1:SPI2_MOS
211
+  #define PI4   136
212
+  #define PI5   137 //1:TIM8_CH1
213
+  #define PI6   138 //1:TIM8_CH2
214
+  #define PI7   139 //1:TIM8_CH3
215
+#endif
216
+
217
+
218
+// This must be a literal
219
+#define NUM_DIGITAL_PINS        (STM32F4X_GPIO_NUM + STM32F4X_ADC_NUM)
220
+// This must be a literal with a value less than or equal to MAX_ANALOG_INPUTS
221
+#define NUM_ANALOG_INPUTS       (STM32F4X_ADC_NUM)
222
+#define NUM_ANALOG_FIRST        (STM32F4X_GPIO_NUM)
223
+
224
+// Below ADC, DAC and PWM definitions already done in the core
225
+// Could be redefined here if needed
226
+// ADC resolution is 12bits
227
+//#define ADC_RESOLUTION          12
228
+//#define DACC_RESOLUTION         12
229
+
230
+// PWM resolution
231
+#define PWM_RESOLUTION          8
232
+#define PWM_FREQUENCY           20000
233
+#define PWM_MAX_DUTY_CYCLE      255
234
+
235
+// Below SPI and I2C definitions already done in the core
236
+// Could be redefined here if differs from the default one
237
+// SPI Definitions
238
+#define PIN_SPI_MOSI            PB15
239
+#define PIN_SPI_MISO            PB14
240
+#define PIN_SPI_SCK             PB13
241
+#define PIN_SPI_SS              PB12
242
+
243
+// I2C Definitions
244
+#define PIN_WIRE_SDA            PB7
245
+#define PIN_WIRE_SCL            PB6
246
+
247
+// Timer Definitions
248
+//Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c
249
+#define TIMER_TONE              TIM6
250
+
251
+// Do not use basic timer: OC is required
252
+#define TIMER_SERVO             TIM2  //TODO: advanced-control timers don't work
253
+
254
+// UART Definitions
255
+// Define here Serial instance number to map on Serial generic name
256
+#define SERIAL_UART_INSTANCE    1 //ex: 2 for Serial2 (USART2)
257
+// DEBUG_UART could be redefined to print on another instance than 'Serial'
258
+//#define DEBUG_UART              ((USART_TypeDef *) U(S)ARTX) // ex: USART3
259
+// DEBUG_UART baudrate, default: 9600 if not defined
260
+//#define DEBUG_UART_BAUDRATE     x
261
+// DEBUG_UART Tx pin name, default: the first one found in PinMap_UART_TX for DEBUG_UART
262
+//#define DEBUG_PINNAME_TX        PX_n // PinName used for TX
263
+
264
+// Default pin used for 'Serial' instance (ex: ST-Link)
265
+// Mandatory for Firmata
266
+#define PIN_SERIAL_RX           PA10
267
+#define PIN_SERIAL_TX           PA9
268
+
269
+#ifdef __cplusplus
270
+} // extern "C"
271
+#endif
272
+/*----------------------------------------------------------------------------
273
+ *        Arduino objects - C++ only
274
+ *----------------------------------------------------------------------------*/
275
+
276
+#ifdef __cplusplus
277
+// These serial port names are intended to allow libraries and architecture-neutral
278
+// sketches to automatically default to the correct port name for a particular type
279
+// of use.  For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
280
+// the first hardware serial port whose RX/TX pins are not dedicated to another use.
281
+//
282
+// SERIAL_PORT_MONITOR        Port which normally prints to the Arduino Serial Monitor
283
+//
284
+// SERIAL_PORT_USBVIRTUAL     Port which is USB virtual serial
285
+//
286
+// SERIAL_PORT_LINUXBRIDGE    Port which connects to a Linux system via Bridge library
287
+//
288
+// SERIAL_PORT_HARDWARE       Hardware serial port, physical RX & TX pins.
289
+//
290
+// SERIAL_PORT_HARDWARE_OPEN  Hardware serial ports which are open for use.  Their RX & TX
291
+//                            pins are NOT connected to anything by default.
292
+#define SERIAL_PORT_MONITOR     Serial
293
+#define SERIAL_PORT_HARDWARE    Serial1
294
+#endif
295
+
296
+#endif /* _VARIANT_ARDUINO_STM32_ */

+ 17
- 0
platformio.ini Ver arquivo

@@ -458,6 +458,23 @@ src_filter = ${common.default_src_filter} +<src/HAL/HAL_STM32>
458 458
 monitor_speed = 250000
459 459
 
460 460
 #
461
+# BIGTREE_SKR_PRO (STM32F407ZGT6 ARM Cortex-M4)
462
+#
463
+[env:BIGTREE_SKR_PRO]
464
+platform = ststm32
465
+framework = arduino
466
+board = BigTree_SKR_Pro
467
+extra_scripts = pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
468
+build_flags = ${common.build_flags}
469
+  -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSB_PRODUCT=\"STM32F407ZG\"
470
+  -DTARGET_STM32F4 -DSTM32F407_5ZX -DVECT_TAB_OFFSET=0x8000  
471
+lib_deps = ${common.lib_deps}
472
+lib_ignore = Adafruit NeoPixel, c1921b4, TMC26XStepper, SailfishLCD, SailfishRGB_LED, SlowSoftI2CMaster
473
+src_filter = ${common.default_src_filter} +<src/HAL/HAL_STM32>
474
+monitor_speed = 250000
475
+upload_protocol = cmsis-dap
476
+
477
+#
461 478
 # Teensy 3.5 / 3.6 (ARM Cortex-M4)
462 479
 #
463 480
 [env:teensy35]

Carregando…
Cancelar
Salvar