From e80d8e9dcf6fb4328592b254d475568174aa9b34 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sun, 7 Sep 2025 06:22:45 +1200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20UART=20pins=20for=20GD32?= =?UTF-8?q?=20MFL=20(#28011)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals-4-adv.h | 2 +- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 33 +++++++++++++++------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Marlin/src/inc/Conditionals-4-adv.h b/Marlin/src/inc/Conditionals-4-adv.h index 66897abc84..0967f994ce 100644 --- a/Marlin/src/inc/Conditionals-4-adv.h +++ b/Marlin/src/inc/Conditionals-4-adv.h @@ -1486,7 +1486,7 @@ #if MB(MKS_MONSTER8_V1, BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_MINI_E3_V3_0_1, BTT_SKR_E3_TURBO, BTT_OCTOPUS_V1_1, BTT_SKR_V3_0, BTT_SKR_V3_0_EZ, AQUILA_V101) #define LCD_SERIAL_PORT 1 - #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_F401RE, CREALITY_V423, CREALITY_CR4NTXXC10, CREALITY_CR4NS, MKS_ROBIN, PANOWIN_CUTLASS, KODAMA_BARDO) + #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_F401RE, CREALITY_V422_GD32_MFL, CREALITY_V423, CREALITY_V427_GD32_MFL, CREALITY_CR4NTXXC10, CREALITY_CR4NS, MKS_ROBIN, PANOWIN_CUTLASS, KODAMA_BARDO) #define LCD_SERIAL_PORT 2 #else #define LCD_SERIAL_PORT 3 diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index a0e36c7f1b..34b1e633df 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -326,13 +326,26 @@ // Changing these will not change the pin they are on. // Hardware UART pins -#define UART1_TX_PIN PA9 // default uses CH340 RX -#define UART1_RX_PIN PA10 // default uses CH340 TX -#define UART2_TX_PIN PA2 // default uses HEATER_BED_PIN -#define UART2_RX_PIN PA3 // not connected -#define UART3_TX_PIN PB10 // default uses LCD connector -#define UART3_RX_PIN PB11 // default uses LCD connector -#define UART4_TX_PIN PC10 // default uses sdcard SDIO_D2 -#define UART4_RX_PIN PC11 // default uses sdcard SDIO_D3 -#define UART5_TX_PIN PC12 // default uses sdcard SDIO_CK -#define UART5_RX_PIN PD2 // default uses sdcard SDIO_CMD +#ifdef ARDUINO_ARCH_MFL // GD32 MFL UARTs start from 0 + #define UART0_TX_PIN PA9 // default uses CH340 RX + #define UART0_RX_PIN PA10 // default uses CH340 TX + #define UART1_TX_PIN PA2 // default uses HEATER_BED_PIN + #define UART1_RX_PIN PA3 // not connected + #define UART2_TX_PIN PB10 // default uses LCD connector + #define UART2_RX_PIN PB11 // default uses LCD connector + #define UART3_TX_PIN PC10 // default uses sdcard SDIO_D2 + #define UART3_RX_PIN PC11 // default uses sdcard SDIO_D3 + #define UART4_TX_PIN PC12 // default uses sdcard SDIO_CK + #define UART4_RX_PIN PD2 // default uses sdcard SDIO_CMD +#else + #define UART1_TX_PIN PA9 // default uses CH340 RX + #define UART1_RX_PIN PA10 // default uses CH340 TX + #define UART2_TX_PIN PA2 // default uses HEATER_BED_PIN + #define UART2_RX_PIN PA3 // not connected + #define UART3_TX_PIN PB10 // default uses LCD connector + #define UART3_RX_PIN PB11 // default uses LCD connector + #define UART4_TX_PIN PC10 // default uses sdcard SDIO_D2 + #define UART4_RX_PIN PC11 // default uses sdcard SDIO_D3 + #define UART5_TX_PIN PC12 // default uses sdcard SDIO_CK + #define UART5_RX_PIN PD2 // default uses sdcard SDIO_CMD +#endif