Skip to content

Commit e80d8e9

Browse files
authored
🐛 Fix UART pins for GD32 MFL (#28011)
1 parent 950d141 commit e80d8e9

File tree

2 files changed

+24
-11
lines changed

2 files changed

+24
-11
lines changed

Marlin/src/inc/Conditionals-4-adv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,7 @@
14861486
#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)
14871487

14881488
#define LCD_SERIAL_PORT 1
1489-
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_F401RE, CREALITY_V423, CREALITY_CR4NTXXC10, CREALITY_CR4NS, MKS_ROBIN, PANOWIN_CUTLASS, KODAMA_BARDO)
1489+
#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)
14901490
#define LCD_SERIAL_PORT 2
14911491
#else
14921492
#define LCD_SERIAL_PORT 3

Marlin/src/pins/stm32f1/pins_CREALITY_V4.h

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,26 @@
326326
// Changing these will not change the pin they are on.
327327

328328
// Hardware UART pins
329-
#define UART1_TX_PIN PA9 // default uses CH340 RX
330-
#define UART1_RX_PIN PA10 // default uses CH340 TX
331-
#define UART2_TX_PIN PA2 // default uses HEATER_BED_PIN
332-
#define UART2_RX_PIN PA3 // not connected
333-
#define UART3_TX_PIN PB10 // default uses LCD connector
334-
#define UART3_RX_PIN PB11 // default uses LCD connector
335-
#define UART4_TX_PIN PC10 // default uses sdcard SDIO_D2
336-
#define UART4_RX_PIN PC11 // default uses sdcard SDIO_D3
337-
#define UART5_TX_PIN PC12 // default uses sdcard SDIO_CK
338-
#define UART5_RX_PIN PD2 // default uses sdcard SDIO_CMD
329+
#ifdef ARDUINO_ARCH_MFL // GD32 MFL UARTs start from 0
330+
#define UART0_TX_PIN PA9 // default uses CH340 RX
331+
#define UART0_RX_PIN PA10 // default uses CH340 TX
332+
#define UART1_TX_PIN PA2 // default uses HEATER_BED_PIN
333+
#define UART1_RX_PIN PA3 // not connected
334+
#define UART2_TX_PIN PB10 // default uses LCD connector
335+
#define UART2_RX_PIN PB11 // default uses LCD connector
336+
#define UART3_TX_PIN PC10 // default uses sdcard SDIO_D2
337+
#define UART3_RX_PIN PC11 // default uses sdcard SDIO_D3
338+
#define UART4_TX_PIN PC12 // default uses sdcard SDIO_CK
339+
#define UART4_RX_PIN PD2 // default uses sdcard SDIO_CMD
340+
#else
341+
#define UART1_TX_PIN PA9 // default uses CH340 RX
342+
#define UART1_RX_PIN PA10 // default uses CH340 TX
343+
#define UART2_TX_PIN PA2 // default uses HEATER_BED_PIN
344+
#define UART2_RX_PIN PA3 // not connected
345+
#define UART3_TX_PIN PB10 // default uses LCD connector
346+
#define UART3_RX_PIN PB11 // default uses LCD connector
347+
#define UART4_TX_PIN PC10 // default uses sdcard SDIO_D2
348+
#define UART4_RX_PIN PC11 // default uses sdcard SDIO_D3
349+
#define UART5_TX_PIN PC12 // default uses sdcard SDIO_CK
350+
#define UART5_RX_PIN PD2 // default uses sdcard SDIO_CMD
351+
#endif

0 commit comments

Comments
 (0)