diff --git a/Marlin/src/HAL/STM32/MarlinSPI.cpp b/Marlin/src/HAL/STM32/MarlinSPI.cpp
index f7c603d77e5c..ba99879bd1ed 100644
--- a/Marlin/src/HAL/STM32/MarlinSPI.cpp
+++ b/Marlin/src/HAL/STM32/MarlinSPI.cpp
@@ -26,7 +26,7 @@
#include "MarlinSPI.h"
-static void spi_init(spi_t *obj, uint32_t speed, spi_mode_e mode, uint8_t msb, uint32_t dataSize) {
+static void spi_init(spi_t *obj, uint32_t speed, SPIMode mode, uint8_t msb, uint32_t dataSize) {
spi_init(obj, speed, mode, msb);
// spi_init set 8bit always
// TODO: copy the code from spi_init and handle data size, to avoid double init always!!
diff --git a/Marlin/src/HAL/STM32/MarlinSPI.h b/Marlin/src/HAL/STM32/MarlinSPI.h
index fbd3585ff447..caf735d4e2d9 100644
--- a/Marlin/src/HAL/STM32/MarlinSPI.h
+++ b/Marlin/src/HAL/STM32/MarlinSPI.h
@@ -61,7 +61,7 @@ class MarlinSPI {
_spi.pin_ssel = digitalPinToPinName(_ssPin);
_dataSize = DATA_SIZE_8BIT;
_bitOrder = MSBFIRST;
- _dataMode = SPI_MODE_0;
+ _dataMode = SPI_MODE0;
_spi.handle.State = HAL_SPI_STATE_RESET;
setClockDivider(SPI_SPEED_CLOCK_DIV2_MHZ);
}
@@ -80,10 +80,10 @@ class MarlinSPI {
void setDataMode(uint8_t _mode) {
switch (_mode) {
- case SPI_MODE0: _dataMode = SPI_MODE_0; break;
- case SPI_MODE1: _dataMode = SPI_MODE_1; break;
- case SPI_MODE2: _dataMode = SPI_MODE_2; break;
- case SPI_MODE3: _dataMode = SPI_MODE_3; break;
+ case SPI_MODE0: _dataMode = SPI_MODE0; break;
+ case SPI_MODE1: _dataMode = SPI_MODE1; break;
+ case SPI_MODE2: _dataMode = SPI_MODE2; break;
+ case SPI_MODE3: _dataMode = SPI_MODE3; break;
}
}
@@ -96,7 +96,7 @@ class MarlinSPI {
DMA_HandleTypeDef _dmaTx;
DMA_HandleTypeDef _dmaRx;
BitOrder _bitOrder;
- spi_mode_e _dataMode;
+ SPIMode _dataMode;
uint8_t _clockDivider;
uint32_t _speed;
uint32_t _dataSize;
diff --git a/Marlin/src/HAL/STM32/pinsDebug.h b/Marlin/src/HAL/STM32/pinsDebug.h
index b14c9c721c48..0825a6032bee 100644
--- a/Marlin/src/HAL/STM32/pinsDebug.h
+++ b/Marlin/src/HAL/STM32/pinsDebug.h
@@ -21,6 +21,10 @@
*/
#pragma once
+#ifndef PINS_DEBUGGING
+ #error "PINS_DEBUGGING not defined but tried to include debug header!"
+#endif
+
/**
* Pins Debugging for STM32
*
@@ -47,6 +51,9 @@
// Only in ST's Arduino core (STM32duino, STM32Core)
#error "Expected NUM_DIGITAL_PINS not found"
#endif
+#ifndef NUM_ANALOG_INPUTS
+ #error "Expected NUM_ANALOG_INPUTS not found"
+#endif
/**
* Life gets complicated if you want an easy to use 'M43 I' output (in port/pin order)
@@ -124,10 +131,28 @@ const XrefInfo pin_xref[] PROGMEM = {
#define PORT_NUM(P) (((P) >> 4) & 0x0007)
#define PORT_ALPHA(P) ('A' + ((P) >> 4))
-#if NUM_ANALOG_FIRST >= NUM_DIGITAL_PINS
- #define HAS_HIGH_ANALOG_PINS 1
+/**
+ * Translation of routines & variables used by pinsDebug.h
+ */
+#ifndef __STRINGIFY
+ #define __STRINGIFY(x) #x
+#endif
+#define TOSTRING(x) __STRINGIFY(x)
+#define _STM32_PLATDEFPATH(x) TOSTRING(platdefs/x.h)
+#ifdef _STM32_PLATDEFS
+ #if __has_include(_STM32_PLATDEFPATH(_STM32_PLATDEFS))
+ #include _STM32_PLATDEFPATH(_STM32_PLATDEFS)
+ #endif
#endif
-#ifndef NUM_ANALOG_LAST
+
+#ifndef NUM_ANALOG_FIRST
+ #warning "Preprocessor macro NUM_ANALOG_FIRST is not defined but PINS_DEBUGGING is enabled; ignoring analog pin debug functions."
+#endif
+
+#ifdef NUM_ANALOG_FIRST
+ #if NUM_ANALOG_FIRST >= NUM_DIGITAL_PINS
+ #define HAS_HIGH_ANALOG_PINS 1
+ #endif
#define NUM_ANALOG_LAST ((NUM_ANALOG_FIRST) + (NUM_ANALOG_INPUTS) - 1)
#endif
#define NUMBER_PINS_TOTAL ((NUM_DIGITAL_PINS) + TERN0(HAS_HIGH_ANALOG_PINS, NUM_ANALOG_INPUTS))
@@ -186,8 +211,10 @@ bool getValidPinMode(const pin_t pin) {
}
int8_t digital_pin_to_analog_pin(const pin_t pin) {
- if (WITHIN(pin, NUM_ANALOG_FIRST, NUM_ANALOG_LAST))
- return pin - NUM_ANALOG_FIRST;
+ #ifdef NUM_ANALOG_FIRST
+ if (WITHIN(pin, NUM_ANALOG_FIRST, NUM_ANALOG_LAST))
+ return pin - NUM_ANALOG_FIRST;
+ #endif
const int8_t ind = digitalPinToAnalogIndex(pin);
return (ind < NUM_ANALOG_INPUTS) ? ind : -1;
@@ -225,10 +252,12 @@ void printPinPort(const pin_t pin) {
// Print number to be used with M42
int calc_p = pin;
- if (pin > NUM_DIGITAL_PINS) {
- calc_p -= NUM_ANALOG_FIRST;
- if (calc_p > 7) calc_p += 8;
- }
+ #ifdef NUM_ANALOG_FIRST
+ if (pin > NUM_DIGITAL_PINS) {
+ calc_p -= NUM_ANALOG_FIRST;
+ if (calc_p > 7) calc_p += 8;
+ }
+ #endif
SERIAL_ECHOPGM(" M42 P", calc_p);
SERIAL_CHAR(' ');
if (calc_p < 100) {
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_ARTILLERY_RUBY.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_ARTILLERY_RUBY.h
new file mode 100644
index 000000000000..0ca44d39df8b
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_ARTILLERY_RUBY.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST 50
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_BTT002.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_BTT002.h
new file mode 100644
index 000000000000..12cd49d16b3e
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_BTT002.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST 35
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_E3_RRF.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_E3_RRF.h
new file mode 100644
index 000000000000..12cd49d16b3e
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_E3_RRF.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST 35
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_GTR_V1.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_GTR_V1.h
new file mode 100644
index 000000000000..12cd49d16b3e
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_GTR_V1.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST 35
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429.h
new file mode 100644
index 000000000000..071b5a612064
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST NUM_DIGITAL_PINS
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_OCTOPUS_V1.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_OCTOPUS_V1.h
new file mode 100644
index 000000000000..071b5a612064
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_OCTOPUS_V1.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST NUM_DIGITAL_PINS
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_SKR_PRO_11.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_SKR_PRO_11.h
new file mode 100644
index 000000000000..12cd49d16b3e
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_SKR_PRO_11.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST 35
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_BTT_SKR_SE_BX.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_BTT_SKR_SE_BX.h
new file mode 100644
index 000000000000..05d9c4f97326
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_BTT_SKR_SE_BX.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST 108
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Rx.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Rx.h
new file mode 100644
index 000000000000..5f1a94e9203a
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Rx.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F103VE_LONGER.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103VE_LONGER.h
new file mode 100644
index 000000000000..5f1a94e9203a
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103VE_LONGER.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Vx.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Vx.h
new file mode 100644
index 000000000000..5f1a94e9203a
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Vx.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Zx.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Zx.h
new file mode 100644
index 000000000000..5f1a94e9203a
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F103Zx.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC.h
new file mode 100644
index 000000000000..fa79c7ab5f68
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST 192
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC_CREALITY.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC_CREALITY.h
new file mode 100644
index 000000000000..5f1a94e9203a
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC_CREALITY.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F407VE.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F407VE.h
new file mode 100644
index 000000000000..45d85cacc238
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F407VE.h
@@ -0,0 +1,40 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#if defined(ARDUINO_BLACK_F407VE) || defined(ARDUINO_BLACK_F407VG)
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST 44
+#endif
+
+#endif
+
+#if defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG)
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST 75
+#endif
+
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F407ZE.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F407ZE.h
new file mode 100644
index 000000000000..071b5a612064
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F407ZE.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST NUM_DIGITAL_PINS
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F446VE.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F446VE.h
new file mode 100644
index 000000000000..5f1a94e9203a
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F446VE.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F446Zx_TRONXY.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F446Zx_TRONXY.h
new file mode 100644
index 000000000000..69ae8fa3f217
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F446Zx_TRONXY.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST 128
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_F4x7Vx.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_F4x7Vx.h
new file mode 100644
index 000000000000..5f1a94e9203a
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_F4x7Vx.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_FLY_F407ZG.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_FLY_F407ZG.h
new file mode 100644
index 000000000000..f0eedf13b079
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_FLY_F407ZG.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST 107
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_FYSETC_S6.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_FYSETC_S6.h
new file mode 100644
index 000000000000..5ae0ecdb5061
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_FYSETC_S6.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST 80
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_FYSETC_SPIDER_KING407.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_FYSETC_SPIDER_KING407.h
new file mode 100644
index 000000000000..f0eedf13b079
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_FYSETC_SPIDER_KING407.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST 107
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_G0B1RE.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_G0B1RE.h
new file mode 100644
index 000000000000..8523b8bf13c5
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_G0B1RE.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST PA0
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_LERDGE.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_LERDGE.h
new file mode 100644
index 000000000000..9a91c879a498
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_LERDGE.h
@@ -0,0 +1,27 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#ifndef NUM_ANALOG_FIRST
+ #error "NUM_ANALOG_FIRST is not defined??"
+ #define NUM_ANALOG_FIRST 75
+#endif
diff --git a/Marlin/src/HAL/STM32/platdefs/MARLIN_TH3D_EZBOARD_V2.h b/Marlin/src/HAL/STM32/platdefs/MARLIN_TH3D_EZBOARD_V2.h
new file mode 100644
index 000000000000..5f1a94e9203a
--- /dev/null
+++ b/Marlin/src/HAL/STM32/platdefs/MARLIN_TH3D_EZBOARD_V2.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/buildroot/share/PlatformIO/boards/README.md b/buildroot/share/PlatformIO/boards/README.md
new file mode 100644
index 000000000000..b178efc17966
--- /dev/null
+++ b/buildroot/share/PlatformIO/boards/README.md
@@ -0,0 +1,9 @@
+# Marlin Custom Boards
+
+Boards are specified in the INI files with the `board = board_name` field. If the board doesn't exist in the platform folder downloaded by PlatformIO then it should be defined in this folder.
+
+The board definition JSON files in this folder provide build and upload information about boards that Marlin supports but which are not defined by any platform included with PlatformIO.
+
+## Custom Variants
+
+See the `buildroot/PlatformIO/variants` folder for custom variants referred to by `build.variant` in the JSON.
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant_MARLIN_ARTILLERY_RUBY.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant_MARLIN_ARTILLERY_RUBY.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant_MARLIN_ARTILLERY_RUBY.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/variant_MARLIN_ARTILLERY_RUBY.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant_MARLIN_BTT_BTT002.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant_MARLIN_BTT_BTT002.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant_MARLIN_BTT_BTT002.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_BTT002/variant_MARLIN_BTT_BTT002.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant_generic.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant_generic.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant_generic.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_E3_RRF/variant_generic.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant_MARLIN_BTT_GTR_V1.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant_MARLIN_BTT_GTR_V1.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant_MARLIN_BTT_GTR_V1.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_GTR_V1/variant_MARLIN_BTT_GTR_V1.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant_MARLIN_BTT_OCTOPUS_PRO_V1_F429.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant_MARLIN_BTT_OCTOPUS_PRO_V1_F429.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant_MARLIN_BTT_OCTOPUS_PRO_V1_F429.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_PRO_V1_F429/variant_MARLIN_BTT_OCTOPUS_PRO_V1_F429.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant_MARLIN_BTT_OCTOPUS_V1.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant_MARLIN_BTT_OCTOPUS_V1.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant_MARLIN_BTT_OCTOPUS_V1.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_OCTOPUS_V1/variant_MARLIN_BTT_OCTOPUS_V1.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant_MARLIN_BTT_SKR_PRO_11.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant_MARLIN_BTT_SKR_PRO_11.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant_MARLIN_BTT_SKR_PRO_11.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_PRO_11/variant_MARLIN_BTT_SKR_PRO_11.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant_MARLIN_BTT_SKR_SE_BX.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant_MARLIN_BTT_SKR_SE_BX.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant_MARLIN_BTT_SKR_SE_BX.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_BTT_SKR_SE_BX/variant_MARLIN_BTT_SKR_SE_BX.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant_generic.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant_generic.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant_generic.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant_generic.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant_MARLIN_F103VE_LONGER.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant_MARLIN_F103VE_LONGER.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant_MARLIN_F103VE_LONGER.h
similarity index 97%
rename from buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant_MARLIN_F103VE_LONGER.h
index 05ce7161db1b..0fc0599b05e4 100644
--- a/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant.h
+++ b/buildroot/share/PlatformIO/variants/MARLIN_F103VE_LONGER/variant_MARLIN_F103VE_LONGER.h
@@ -140,15 +140,15 @@ extern "C" {
// Extra HAL modules
#ifdef STM32F103xE
-#ifndef HAL_DAC_MODULE_ENABLED
- //#define HAL_DAC_MODULE_ENABLED (unused or maybe for the eeprom write?)
-#endif
-#ifndef HAL_SD_MODULE_ENABLED
- #define HAL_SD_MODULE_ENABLED
-#endif
-#ifndef HAL_SRAM_MODULE_ENABLED
- #define HAL_SRAM_MODULE_ENABLED
-#endif
+ #ifndef HAL_DAC_MODULE_ENABLED
+ //#define HAL_DAC_MODULE_ENABLED (unused or maybe for the eeprom write?)
+ #endif
+ #ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+ #endif
+ #ifndef HAL_SRAM_MODULE_ENABLED
+ #define HAL_SRAM_MODULE_ENABLED
+ #endif
#endif
#ifdef __cplusplus
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant_generic.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant_generic.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant_generic.h
similarity index 95%
rename from buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant_generic.h
index 8ed0025a6250..f704af879f69 100644
--- a/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant.h
+++ b/buildroot/share/PlatformIO/variants/MARLIN_F103Vx/variant_generic.h
@@ -145,15 +145,15 @@ extern "C" {
// Extra HAL modules
#if defined(STM32F103xE) || defined(STM32F103xG)
-#ifndef HAL_DAC_MODULE_ENABLED
- #define HAL_DAC_MODULE_ENABLED
-#endif
-#ifndef HAL_SD_MODULE_ENABLED
- #define HAL_SD_MODULE_ENABLED
-#endif
-#ifndef HAL_SRAM_MODULE_ENABLED
- #define HAL_SRAM_MODULE_ENABLED
-#endif
+ #ifndef HAL_DAC_MODULE_ENABLED
+ #define HAL_DAC_MODULE_ENABLED
+ #endif
+ #ifndef HAL_SD_MODULE_ENABLED
+ #define HAL_SD_MODULE_ENABLED
+ #endif
+ #ifndef HAL_SRAM_MODULE_ENABLED
+ #define HAL_SRAM_MODULE_ENABLED
+ #endif
#endif
// Default pin used for 'Serial' instance (ex: ST-Link)
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant_generic.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant_generic.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant_generic.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_F103Zx/variant_generic.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_STM32F401RC.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_F401RC.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_STM32F401RC.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_F401RC.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_STM32F401RC.h b/buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_F401RC.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_STM32F401RC.h
rename to buildroot/share/PlatformIO/variants/MARLIN_F401RC/variant_MARLIN_F401RC.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant_generic.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant_generic.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant_generic.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_F401RC_CREALITY/variant_generic.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant_MARLIN_F401RE_CREALITY.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant_MARLIN_F401RE_CREALITY.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant_MARLIN_F401RE_CREALITY.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_F401RE_CREALITY/variant_MARLIN_F401RE_CREALITY.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant_generic.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant_generic.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant_generic.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant_generic.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant_generic.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant_generic.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant_generic.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_F446VE_FYSETC/variant_generic.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant_generic.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant_generic.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant_generic.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_F446Zx_TRONXY/variant_generic.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant_generic.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant_generic.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant_generic.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_F4x7Vx/variant_generic.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant_MARLIN_STM32F407VGT6_CCM.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant_MARLIN_STM32F407VGT6_CCM.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant_MARLIN_STM32F407VGT6_CCM.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_FLY_CDY_V3/variant_MARLIN_STM32F407VGT6_CCM.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant_generic.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant_generic.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant_generic.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_FLY_F407ZG/variant_generic.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant_generic.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant_generic.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant_generic.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_FYSETC_SPIDER_KING407/variant_generic.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.cpp b/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_G0B1RE.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_G0B1RE.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.h b/buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_G0B1RE.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.h
rename to buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_G0B1RE.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_STM32G0B1VE.cpp b/buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_G0B1VE.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_STM32G0B1VE.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_G0B1VE.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_STM32G0B1VE.h b/buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_G0B1VE.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_STM32G0B1VE.h
rename to buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/variant_MARLIN_G0B1VE.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_STM32H723VG.cpp b/buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_H723VG.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_STM32H723VG.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_H723VG.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_STM32H723VG.h b/buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_H723VG.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_STM32H723VG.h
rename to buildroot/share/PlatformIO/variants/MARLIN_H723VG/variant_MARLIN_H723VG.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_STM32H723ZE.cpp b/buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_H723ZE.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_STM32H723ZE.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_H723ZE.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_STM32H723ZE.h b/buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_H723ZE.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_STM32H723ZE.h
rename to buildroot/share/PlatformIO/variants/MARLIN_H723ZE/variant_MARLIN_H723ZE.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_STM32H723ZG.cpp b/buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_H723ZG.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_STM32H723ZG.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_H723ZG.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_STM32H723ZG.h b/buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_H723ZG.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_STM32H723ZG.h
rename to buildroot/share/PlatformIO/variants/MARLIN_H723ZG/variant_MARLIN_H723ZG.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_STM32H743VI.cpp b/buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_H743VI.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_STM32H743VI.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_H743VI.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_STM32H743VI.h b/buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_H743VI.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_STM32H743VI.h
rename to buildroot/share/PlatformIO/variants/MARLIN_H743VI/variant_MARLIN_H743VI.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant_MARLIN_I3DBEEZ9.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant_MARLIN_I3DBEEZ9.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant_MARLIN_I3DBEEZ9.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_I3DBEEZ9/variant_MARLIN_I3DBEEZ9.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant_generic.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant_generic.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant_generic.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_LERDGE/variant_generic.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant_MARLIN_MKS_ROBIN2.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant_MARLIN_MKS_ROBIN2.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant_MARLIN_MKS_ROBIN2.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/variant_MARLIN_MKS_ROBIN2.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant_MARLIN_MKS_SKIPR_V1.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant_MARLIN_MKS_SKIPR_V1.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant_MARLIN_MKS_SKIPR_V1.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_MKS_SKIPR_V1/variant_MARLIN_MKS_SKIPR_V1.h
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant_generic.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant_generic.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant_generic.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant.h
rename to buildroot/share/PlatformIO/variants/MARLIN_TH3D_EZBOARD_V2/variant_generic.h
diff --git a/ini/features.ini b/ini/features.ini
index 1c10302fb0c0..5f439384c2db 100644
--- a/ini/features.ini
+++ b/ini/features.ini
@@ -383,6 +383,7 @@ HAS_SERVOS = build_src_filter=+
HAS_MICROSTEPS = build_src_filter=+
(ESP3D_)?WIFISUPPORT = esp32async/AsyncTCP@3.3.3, mathieucarbou/ESP Async WebServer@3.0.6
+ WebServer=https://github.com/har-in-air/ESPAsyncWebServer.git
ESP3DLib=https://github.com/luc-github/ESP3DLib/archive/6d62f76c3f.zip
arduinoWebSockets=links2004/WebSockets@2.3.4
luc-github/ESP32SSDP@1.1.1
diff --git a/ini/stm32-common.ini b/ini/stm32-common.ini
index c5fedfa4e101..b602ea316b93 100644
--- a/ini/stm32-common.ini
+++ b/ini/stm32-common.ini
@@ -9,7 +9,8 @@
#
####################################
-[common_stm32]
+# For Compatibility. Should be set to version that is last known to work across all boards.
+[common_stm32_stable]
platform = ststm32@~12.1
#platform_packages = toolchain-gccarmnoneeabi@1.100301.220327 # Otherwise it's GCC 9.2.1
board_build.core = stm32
@@ -28,14 +29,42 @@ custom_marlin.HAS_TFT_XPT2046 = build_src_filter=+
#
-# STM32 board based on a variant.
+# Use the latest release of platformio/platform-ststm32
+# from https://github.com/platformio/platform-ststm32/releases
+# for all boards where it will build and run.
+# Only bump the common_stm32 platform to a tested and stable version.
#
-[stm32_variant]
-extends = common_stm32
-extra_scripts = ${common_stm32.extra_scripts}
+[common_stm32_latest]
+extends = common_stm32
+platform = ststm32@~17.6.0
+build_flags = ${common_stm32.build_flags}
+ -std=gnu++2a
+build_unflags = -std=gnu++14
+
+#
+# STM32 boards based on variants (copied from buildroot/share/PlatformIO/variants)
+#
+[stm32_variant_stable]
+extends = common_stm32_stable
+extra_scripts = ${common_stm32_stable.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
buildroot/share/PlatformIO/scripts/offset_and_rename.py
+[stm32_variant_latest]
+extends = common_stm32_latest
+extra_scripts = ${stm32_variant.extra_scripts}
+
+#
+# Change 'extends' here to use the stable or latest STM32 platform
+#
+[common_stm32]
+extends = common_stm32_stable
+#extends = common_stm32_latest
+
+[stm32_variant]
+extends = stm32_variant_stable
+#extends = stm32_variant_latest
+
#
# USB Flash Drive mix-ins for STM32
#
diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini
index f6c8b8da56bf..f4231ae4f8e7 100644
--- a/ini/stm32f1-maple.ini
+++ b/ini/stm32f1-maple.ini
@@ -416,6 +416,7 @@ build_flags = ${STM32F1_maple.build_flags}
-DMCU_STM32F103VE -DARDUINO_GENERIC_STM32F103V -DARDUINO_ARCH_STM32F1
-DDEBUG_LEVEL=DEBUG_NONE -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1
-DSS_TIMER=4
+ -D_STM32_PLATDEFS=MARLIN_F103Vx
-DNO_MAPLE_WARNING
board_build.variant = MARLIN_F103Vx
board_build.ldscript = eryone_ery32_mini.ld
diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini
index 58b33afaafdc..8c142541b9ff 100644
--- a/ini/stm32f1.ini
+++ b/ini/stm32f1.ini
@@ -22,8 +22,8 @@
[common_STM32F103RC_variant]
extends = stm32_variant
board = genericSTM32F103RC
-board_build.variant = MARLIN_F103Rx
-build_flags = ${stm32_variant.build_flags} -DDEBUG_LEVEL=0
+build_flags = ${stm32_variant.build_flags}
+ -DDEBUG_LEVEL=0 -D_STM32_PLATDEFS=MARLIN_F103Rx
monitor_speed = 115200
#
@@ -70,6 +70,7 @@ build_unflags = -DUSBD_USE_CDC
[env:STM32F103RC_btt_USB]
extends = env:STM32F103RC_btt
platform_packages = ${stm_flash_drive.platform_packages}
+board_build.variant = MARLIN_F103Rx
build_flags = ${env:STM32F103RC_btt.build_flags} ${USBD_CDC_MSC.build_flags}
build_unflags = ${env:STM32F103RC_btt.build_unflags} ${USBD_CDC_MSC.build_unflags}
@@ -92,12 +93,12 @@ lib_deps = markyue/Panda_SoftMasterI2C@1.0.3
[env:mks_robin]
extends = stm32_variant
board = genericSTM32F103ZE
-board_build.variant = MARLIN_F103Zx
board_build.encrypt_mks = Robin.bin
board_build.offset = 0x7000
board_build.offset_address = 0x08007000
build_flags = ${stm32_variant.build_flags}
-DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5
+ -D_STM32_PLATDEFS=MARLIN_F103Zx
build_unflags = ${stm32_variant.build_unflags}
-DUSBCON -DUSBD_USE_CDC
@@ -120,7 +121,6 @@ debug_tool = stlink
#
[STM32F103Rx_creality]
extends = stm32_variant
-board_build.variant = MARLIN_F103Rx
board_build.offset = 0x7000
board_upload.offset_address = 0x08007000
board_build.rename = firmware-{date}-{time}.bin
@@ -128,6 +128,7 @@ build_flags = ${stm32_variant.build_flags}
-DMCU_STM32F103RE -DHAL_SD_MODULE_ENABLED
-DSS_TIMER=4 -DTIMER_SERVO=TIM5
-DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8
+ -D_STM32_PLATDEFS=MARLIN_F103Rx
build_unflags = ${stm32_variant.build_unflags}
-DUSBCON -DUSBD_USE_CDC
monitor_speed = 115200
@@ -200,10 +201,10 @@ board = genericSTM32F103RC
[env:STM32F103VE_creality]
extends = STM32F103Rx_creality
board = genericSTM32F103VE
-board_build.variant = MARLIN_F103Vx
build_flags = ${STM32F103Rx_creality.build_flags}
-DSS_TIMER=4 -DTIMER_SERVO=TIM5
-DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8
+ -D_STM32_PLATDEFS=MARLIN_F103Vx
#
# BigTreeTech SKR Mini E3 V2.0 & DIP / SKR CR6 (STM32F103RET6 ARM Cortex-M3)
#
@@ -213,13 +214,13 @@ build_flags = ${STM32F103Rx_creality.build_flags}
[env:STM32F103RE_btt]
extends = stm32_variant
board = genericSTM32F103RE
-board_build.variant = MARLIN_F103Rx
board_build.offset = 0x7000
board_upload.offset_address = 0x08007000
build_flags = ${stm32_variant.build_flags}
-DMCU_STM32F103RE -DHAL_SD_MODULE_ENABLED
-DSS_TIMER=4 -DTIMER_SERVO=TIM5
-DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8
+ -D_STM32_PLATDEFS=MARLIN_F103Rx
monitor_speed = 115200
debug_tool = jlink
upload_protocol = jlink
@@ -227,6 +228,7 @@ upload_protocol = jlink
[env:STM32F103RE_btt_USB]
extends = env:STM32F103RE_btt
platform_packages = ${stm_flash_drive.platform_packages}
+board_build.variant = MARLIN_F103Rx
build_flags = ${env:STM32F103RE_btt.build_flags} ${USBD_CDC_MSC.build_flags}
build_unflags = ${env:STM32F103RE_btt.build_unflags} ${USBD_CDC_MSC.build_unflags}
@@ -243,11 +245,11 @@ board_build.encrypt_mks = elegoo.bin
[env:mingda_mpx_arm_mini]
extends = stm32_variant
board = genericSTM32F103ZE
-board_build.variant = MARLIN_F103Zx
board_build.offset = 0x10000
board_build.offset_address = 0x08010000
build_flags = ${stm32_variant.build_flags}
-DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5
+ -D_STM32_PLATDEFS=MARLIN_F103Zx
build_unflags = ${stm32_variant.build_unflags}
-DUSBCON -DUSBD_USE_CDC
@@ -268,10 +270,9 @@ build_src_filter = ${common_stm32.build_src_filter} + -