From dd0e5c26d15a188dca9f7c772f8058bffdda108c Mon Sep 17 00:00:00 2001
From: ellensp <ellensp@hotmail.com>
Date: Thu, 3 Jun 2021 19:40:16 +1200
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20env:STM32F103RE=20maple/un?=
 =?UTF-8?q?ified=20split-up=20(#22019)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Followup to #21999
---
 Marlin/src/pins/pins.h | 24 ++++++++++++------------
 ini/stm32f1-maple.ini  |  8 ++++----
 ini/stm32f1.ini        | 27 +++++++++++++++++++++++++++
 3 files changed, 43 insertions(+), 16 deletions(-)

diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h
index b4c79b3226..49d91e493a 100644
--- a/Marlin/src/pins/pins.h
+++ b/Marlin/src/pins/pins.h
@@ -469,25 +469,25 @@
 //
 
 #elif MB(STM32F103RE)
-  #include "stm32f1/pins_STM32F1R.h"            // STM32F1                                env:STM32F103RE
+  #include "stm32f1/pins_STM32F1R.h"            // STM32F103RE                            env:STM32F103RE env:STM32F103RE_maple
 #elif MB(MALYAN_M200)
-  #include "stm32f1/pins_MALYAN_M200.h"         // STM32F1                                env:STM32F103CB_malyan
+  #include "stm32f1/pins_MALYAN_M200.h"         // STM32F103CB                            env:STM32F103CB_malyan
 #elif MB(STM3R_MINI)
-  #include "stm32f1/pins_STM3R_MINI.h"          // STM32F1                                env:STM32F103RE
+  #include "stm32f1/pins_STM3R_MINI.h"          // STM32F103RE?                           env:STM32F103RE env:STM32F103RE_maple
 #elif MB(GTM32_PRO_VB)
-  #include "stm32f1/pins_GTM32_PRO_VB.h"        // STM32F1                                env:STM32F103RE
+  #include "stm32f1/pins_GTM32_PRO_VB.h"        // STM32F103VE                            env:STM32F103VE env:STM32F103RE_maple
 #elif MB(GTM32_PRO_VD)
-  #include "stm32f1/pins_GTM32_PRO_VD.h"        // STM32F1                                env:STM32F103RE
+  #include "stm32f1/pins_GTM32_PRO_VD.h"        // STM32F103VE                            env:STM32F103VE env:STM32F103RE_maple
 #elif MB(GTM32_MINI)
-  #include "stm32f1/pins_GTM32_MINI.h"          // STM32F1                                env:STM32F103RE
+  #include "stm32f1/pins_GTM32_MINI.h"          // STM32F103VE                            env:STM32F103VE env:STM32F103RE_maple
 #elif MB(GTM32_MINI_A30)
-  #include "stm32f1/pins_GTM32_MINI_A30.h"      // STM32F1                                env:STM32F103RE
+  #include "stm32f1/pins_GTM32_MINI_A30.h"      // STM32F103VE                            env:STM32F103VE env:STM32F103RE_maple
 #elif MB(GTM32_REV_B)
-  #include "stm32f1/pins_GTM32_REV_B.h"         // STM32F1                                env:STM32F103RE
+  #include "stm32f1/pins_GTM32_REV_B.h"         // STM32F103VE                            env:STM32F103VE env:STM32F103RE_maple
 #elif MB(MORPHEUS)
-  #include "stm32f1/pins_MORPHEUS.h"            // STM32F1                                env:STM32F103RE
+  #include "stm32f1/pins_MORPHEUS.h"            // STM32F103RE                            env:STM32F103RE env:STM32F103RE_maple
 #elif MB(CHITU3D)
-  #include "stm32f1/pins_CHITU3D.h"             // STM32F1                                env:STM32F103RE
+  #include "stm32f1/pins_CHITU3D.h"             // STM32F103ZE                            env:STM32F103ZE env:STM32F103RE_maple
 #elif MB(MKS_ROBIN)
   #include "stm32f1/pins_MKS_ROBIN.h"           // STM32F1                                env:mks_robin env:mks_robin_maple
 #elif MB(MKS_ROBIN_MINI)
@@ -561,9 +561,9 @@
 #elif MB(FLSUN_HISPEED)
   #include "stm32f1/pins_FLSUN_HISPEED.h"       // STM32F1                                env:flsun_hispeedv1
 #elif MB(BEAST)
-  #include "stm32f1/pins_BEAST.h"               // STM32F1                                env:STM32F103RE
+  #include "stm32f1/pins_BEAST.h"               // STM32F1                                env:STM32F103VE env:STM32F103RE_maple
 #elif MB(MINGDA_MPX_ARM_MINI)
-  #include "stm32f1/pins_MINGDA_MPX_ARM_MINI.h" // STM32F1                                env:STM32F103RE
+  #include "stm32f1/pins_MINGDA_MPX_ARM_MINI.h" // STM32F1                                env:mingda_mpx_arm_mini
 
 //
 // ARM Cortex-M4F
diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini
index cc9942fd75..e58064424d 100644
--- a/ini/stm32f1-maple.ini
+++ b/ini/stm32f1-maple.ini
@@ -131,9 +131,9 @@ lib_deps          = ${env:STM32F103RC_btt_512K_maple.lib_deps}
   USBComposite for STM32F1@0.91
 
 #
-# STM32F103RE with Unified STM32F1 HAL
+# Generic STM32F103RE environment
 #
-[common_STM32F103RE]
+[env:STM32F103RE_maple]
 platform          = ${common_stm32f1.platform}
 extends           = common_stm32f1
 board             = genericSTM32F103RE
@@ -144,7 +144,7 @@ monitor_speed     = 115200
 #
 [env:STM32F103RET6_creality_maple]
 platform             = ${common_stm32f1.platform}
-extends              = common_STM32F103RE
+extends              = env:STM32F103RE_maple
 build_flags          = ${common_stm32f1.build_flags} -DTEMP_TIMER_CHAN=4
 board_build.address  = 0x08007000
 board_build.ldscript = creality.ld
@@ -160,7 +160,7 @@ upload_protocol      = jlink
 #
 [env:STM32F103RE_btt]
 platform          = ${common_stm32f1.platform}
-extends           = common_STM32F103RE
+extends           = env:STM32F103RE_maple
 board_build.address  = 0x08007000
 board_build.ldscript = STM32F103RE_SKR_E3_DIP.ld
 extra_scripts     = ${common_stm32f1.extra_scripts}
diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini
index c6aa464979..1a70ca62a6 100644
--- a/ini/stm32f1.ini
+++ b/ini/stm32f1.ini
@@ -57,6 +57,33 @@ extra_scripts        = ${common.extra_scripts}
   pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
   buildroot/share/PlatformIO/scripts/stm32_bootloader.py
 
+#
+# STM32F103RE
+#
+[env:STM32F103RE]
+platform          = ${common_stm32.platform}
+extends           = common_stm32
+board             = genericSTM32F103RE
+monitor_speed     = 115200
+
+#
+# STM32F103VE
+#
+[env:STM32F103VE]
+platform          = ${common_stm32.platform}
+extends           = common_stm32
+board             = genericSTM32F103VE
+monitor_speed     = 115200
+
+#
+# STM32F103ZE
+#
+[env:STM32F103ZE]
+platform          = ${common_stm32.platform}
+extends           = common_stm32
+board             = genericSTM32F103ZE
+monitor_speed     = 115200
+
 [env:STM32F103RC_btt]
 platform             = ${common_stm32.platform}
 extends              = common_STM32F103RC