Skip to content

Commit 0c72dc3

Browse files
authored
🔨 Creality V4.2.7 (GD32) (MarlinFirmware#27796)
1 parent 019915b commit 0c72dc3

File tree

5 files changed

+62
-8
lines changed

5 files changed

+62
-8
lines changed

Marlin/src/HAL/GD32_MFL/timers.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ bool is_temp_timer_initialized = false;
9292

9393
// Retrieves the clock frequency of the stepper timer
9494
uint32_t GetStepperTimerClkFreq() {
95-
return Step_Timer.getTimerClockFrequency();
95+
// Cache result
96+
static uint32_t clkFreq = Step_Timer.getTimerClockFrequency();
97+
return clkFreq;
9698
}
9799

98100
/**
@@ -191,10 +193,12 @@ void SetTimerInterruptPriorities() {
191193
// Detect timer conflicts
192194
// ------------------------
193195

196+
TERN_(HAS_TMC_SW_SERIAL, static constexpr timer::TIMER_Base timer_serial[] = {static_cast<timer::TIMER_Base>(TIMER_SERIAL)});
194197
TERN_(SPEAKER, static constexpr timer::TIMER_Base timer_tone[] = {static_cast<timer::TIMER_Base>(TIMER_TONE)});
195198
TERN_(HAS_SERVOS, static constexpr timer::TIMER_Base timer_servo[] = {static_cast<timer::TIMER_Base>(TIMER_SERVO)});
196199

197200
enum TimerPurpose {
201+
PURPOSE_SERIAL,
198202
PURPOSE_TONE,
199203
PURPOSE_SERVO,
200204
PURPOSE_STEP,
@@ -205,6 +209,9 @@ enum TimerPurpose {
205209
// Includes the timer purpose to ease debugging when evaluating at build-time
206210
// This cannot yet account for timers used for PWM output, such as for fans
207211
static constexpr struct { TimerPurpose p; int t; } timers_in_use[] = {
212+
#if HAS_TMC_SW_SERIAL
213+
{ PURPOSE_SERIAL, timer_base_to_index(timer_serial[0]) }, // Set in variant.h
214+
#endif
208215
#if ENABLED(SPEAKER)
209216
{ PURPOSE_TONE, timer_base_to_index(timer_tone[0]) }, // Set in variant.h
210217
#endif

Marlin/src/core/boards.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@
386386
#define BOARD_CREALITY_V422 5039 // Creality v4.2.2 (STM32F103RC / STM32F103RE) ... GD32 Variant Below!
387387
#define BOARD_CREALITY_V423 5040 // Creality v4.2.3 (STM32F103RC / STM32F103RE)
388388
#define BOARD_CREALITY_V425 5041 // Creality v4.2.5 (STM32F103RC / STM32F103RE)
389-
#define BOARD_CREALITY_V427 5042 // Creality v4.2.7 (STM32F103RC / STM32F103RE)
389+
#define BOARD_CREALITY_V427 5042 // Creality v4.2.7 (STM32F103RC / STM32F103RE) ... GD32 Variant Below!
390390
#define BOARD_CREALITY_V4210 5043 // Creality v4.2.10 (STM32F103RC / STM32F103RE) as found in the CR-30
391391
#define BOARD_CREALITY_V431 5044 // Creality v4.3.1 (STM32F103RC / STM32F103RE)
392392
#define BOARD_CREALITY_V431_A 5045 // Creality v4.3.1a (STM32F103RC / STM32F103RE)
@@ -563,6 +563,7 @@
563563
//
564564

565565
#define BOARD_CREALITY_V422_GD32_MFL 7400 // Creality V4.2.2 MFL (GD32F303RE) ... STM32 Variant Above!
566+
#define BOARD_CREALITY_V427_GD32_MFL 7401 // Creality V4.2.7 MFL (GD32F303RE) ... STM32 Variant Above!
566567

567568
//
568569
// Raspberry Pi

Marlin/src/pins/gd32f3/pins_CREALITY_V422_GD32_MFL.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@
2727

2828
#define ALLOW_GD32F3
2929

30-
#ifndef BOARD_INFO_NAME
31-
#define BOARD_INFO_NAME "Creality V4.2.2 MFL"
32-
#endif
33-
#ifndef DEFAULT_MACHINE_NAME
34-
#define DEFAULT_MACHINE_NAME "Ender-3 MFL"
35-
#endif
30+
#define BOARD_INFO_NAME "Creality V4.2.2 MFL"
31+
#define DEFAULT_MACHINE_NAME "Ender-3 MFL"
3632

3733
#include "../stm32f1/pins_CREALITY_V4.h"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2025 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 <https://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
#pragma once
23+
24+
/**
25+
* Creality MFL GD32 V4.2.7 (GD32F303RE) board pin assignments
26+
*/
27+
28+
#define ALLOW_GD32F3
29+
30+
#define BOARD_INFO_NAME "Creality V4.2.7 MFL"
31+
#define DEFAULT_MACHINE_NAME "Creality3D MFL"
32+
33+
//
34+
// Steppers
35+
//
36+
#define X_STEP_PIN PB9
37+
#define X_DIR_PIN PC2
38+
39+
#define Y_STEP_PIN PB7
40+
#define Y_DIR_PIN PB8
41+
42+
#define Z_STEP_PIN PB5
43+
#define Z_DIR_PIN PB6
44+
45+
#define E0_STEP_PIN PB3
46+
#define E0_DIR_PIN PB4
47+
48+
#include "../stm32f1/pins_CREALITY_V4.h"

Marlin/src/pins/pins.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,8 @@
977977

978978
#elif MB(CREALITY_V422_GD32_MFL)
979979
#include "gd32f3/pins_CREALITY_V422_GD32_MFL.h" // GD32F303RE env:GD32F303RE_creality_mfl
980+
#elif MB(CREALITY_V427_GD32_MFL)
981+
#include "gd32f3/pins_CREALITY_V427_GD32_MFL.h" // GD32F303RE env:GD32F303RE_creality_mfl
980982

981983
//
982984
// Raspberry Pi RP2040

0 commit comments

Comments
 (0)