Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CREALITY_CR4NTxxC10 motherboard (E3 Free-runs Silent Motherboard) #25636

Merged
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
725b596
add new board to Marlin
Bob-the-Kuhn Apr 4, 2023
b1c8d5b
Apply pinsformat.js
thinkyhead Apr 6, 2023
68b69e0
Tweak Ender # labels
thinkyhead Apr 6, 2023
47dadbe
pins cleanup
thinkyhead Apr 6, 2023
43239b4
Merge branch 'bugfix-2.1.x' into pr/25636
thinkyhead Apr 6, 2023
f620513
pins cleanup
thinkyhead Apr 6, 2023
5400270
Fixing Pinout for BL-Touch/CR-Touch on CR4NTxxC10 (pinout tested on r…
snoweuph Jun 6, 2023
6ddd7c0
Adding Serial 6 for Cr4ntxxc10
snoweuph Jun 6, 2023
a8e0252
Adding build options for RE and RC for Cr4ntxxC10
snoweuph Jun 6, 2023
67179b5
Adding forced driver with an error for Cr4ntxxc10
snoweuph Jun 6, 2023
1b35486
Fix Stack size from 512kb to 96kb in ldscript
snoweuph Jun 8, 2023
2b78c02
Set Stacksze to a littlebit under the full 96kb, because full 96kb do…
snoweuph Jun 9, 2023
67d3e11
Merge branch 'bugfix-2.1.x' into pr/25636
thinkyhead Jul 17, 2023
372b916
pins cleanup
thinkyhead Jul 17, 2023
7a4d60b
Compare to existing STM32F401RE_creality
thinkyhead Jul 17, 2023
5edfa38
rename (1)
thinkyhead Jul 17, 2023
c9e0bec
rename (2)
thinkyhead Jul 17, 2023
0593a6e
Separate CREALITY_F401RE from CREALITY_CR4NTXXC10
thinkyhead Aug 3, 2023
5fedada
Merge branch 'bugfix-2.1.x' into pr/25636
thinkyhead Aug 3, 2023
ad07ce7
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into pr/25636
thinkyhead Oct 3, 2023
17379db
Merge branch 'bugfix-2.1.x' into pr/25636
thinkyhead Oct 26, 2023
4f914e6
Merge branch 'bugfix-2.1.x' into pr/25636
thinkyhead Dec 14, 2023
3e2d9fc
pins updates
thinkyhead Dec 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,13 +451,14 @@
#define BOARD_ARTILLERY_RUBY 5238 // Artillery Ruby (STM32F401RC)
#define BOARD_FYSETC_SPIDER_V2_2 5239 // FYSETC Spider V2.2 (STM32F446VE)
#define BOARD_CREALITY_V24S1_301F4 5240 // Creality v2.4.S1_301F4 (STM32F401RC) as found in the Ender-3 S1 F4
#define BOARD_OPULO_LUMEN_REV4 5241 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG)
#define BOARD_FYSETC_SPIDER_KING407 5242 // FYSETC Spider King407 (STM32F407ZG)
#define BOARD_MKS_SKIPR_V1 5243 // MKS SKIPR v1.0 all-in-one board (STM32F407VE)
#define BOARD_TRONXY_V10 5244 // TRONXY V10 (STM32F446ZE)
#define BOARD_CREALITY_F401RE 5245 // Creality CR4NS200141C13 (STM32F401RE) as found in the Ender-5 S1
#define BOARD_BLACKPILL_CUSTOM 5246 // Custom board based on STM32F401CDU6.
#define BOARD_I3DBEEZ9_V1 5247 // I3DBEEZ9 V1 (STM32F407ZG)
#define BOARD_CREALITY_CR4NTXXC10 5241 // Creality E3 Free-runs Silent Motherboard (STM32F401RET6)
#define BOARD_OPULO_LUMEN_REV4 5242 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG)
#define BOARD_FYSETC_SPIDER_KING407 5243 // FYSETC Spider King407 (STM32F407ZG)
#define BOARD_MKS_SKIPR_V1 5244 // MKS SKIPR v1.0 all-in-one board (STM32F407VE)
#define BOARD_TRONXY_V10 5245 // TRONXY V10 (STM32F446ZE)
#define BOARD_CREALITY_F401RE 5246 // Creality CR4NS200141C13 (STM32F401RE) as found in the Ender-5 S1
#define BOARD_BLACKPILL_CUSTOM 5247 // Custom board based on STM32F401CDU6.
#define BOARD_I3DBEEZ9_V1 5248 // I3DBEEZ9 V1 (STM32F407ZG)

//
// ARM Cortex-M7
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,8 @@
#include "stm32f4/pins_ARTILLERY_RUBY.h" // STM32F4 env:Artillery_Ruby
#elif MB(CREALITY_V24S1_301F4)
#include "stm32f4/pins_CREALITY_V24S1_301F4.h" // STM32F4 env:STM32F401RC_creality env:STM32F401RC_creality_jlink env:STM32F401RC_creality_stlink
#elif MB(CREALITY_CR4NTXXC10)
#include "stm32f4/pins_CREALITY_CR4NTXXC10.h" // STM32F4 env:STM32F401RE_freeruns env:STM32F401RE_freeruns_jlink env:STM32F401RE_freeruns_stlink
#elif MB(OPULO_LUMEN_REV4)
#include "stm32f4/pins_OPULO_LUMEN_REV4.h" // STM32F4 env:Opulo_Lumen_REV4
#elif MB(FYSETC_SPIDER_KING407)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
#define SPINDLE_LASER_PWM_PIN PC0 // Bed FET
#define SPINDLE_LASER_ENA_PIN PC0 // FET 1
#define SPINDLE_DIR_PIN PC0 // FET 4
#define LASER_SOFT_PWM_PIN PC0
//#define LASER_SOFT_PWM_PIN PC0
#endif

#include "pins_CREALITY_V4.h"
261 changes: 261 additions & 0 deletions Marlin/src/pins/stm32f4/pins_CREALITY_CR4NTXXC10.h

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LCD_PINS_ENABLE generates a error when compiling.
Works when changed to LCD_PINS_EN

Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2023 MarlinFirmware [https:/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 <https://www.gnu.org/licenses/>.
*
*/

/**
* Creality CREALITY_CR4NTXXC10 (STM32F401RET6) board pin assignments
*
* Sold as "E3 Free-runs Silent Motherboard"
*/
#include "env_validate.h"

#if HOTENDS > 1 || E_STEPPERS > 1
#error "CR4NT220622C10 only supports one hotend / E-stepper."
#endif

#if !AXIS_DRIVER_TYPE_X(TMC2209) || !AXIS_DRIVER_TYPE_Y(TMC2209) || !AXIS_DRIVER_TYPE_Z(TMC2209) || !AXIS_DRIVER_TYPE_E0(TMC2209)
#error "This board has onboard TMC2209 drivers for X, Y, Z, and E0."
#endif

#ifndef BOARD_INFO_NAME
#define BOARD_INFO_NAME "CR4NT220622C10"
#endif
#ifndef DEFAULT_MACHINE_NAME
#define DEFAULT_MACHINE_NAME "Ender-3 Series"
#endif
#define BOARD_WEBSITE_URL "www.creality.com"

#define BOARD_NO_NATIVE_USB
//#undef DISABLE_DEBUG // DISABLE_(DEBUG|JTAG) is not supported for STM32F4.
//#define DISABLE_JTAG

//
// EEPROM
//
#if NO_EEPROM_SELECTED
#define IIC_BL24CXX_EEPROM // EEPROM on I2C-0
//#define SDCARD_EEPROM_EMULATION
#undef NO_EEPROM_SELECTED
#endif

#if ENABLED(IIC_BL24CXX_EEPROM)
#define IIC_EEPROM_SDA PA11
#define IIC_EEPROM_SCL PA12
#define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16)
#elif ENABLED(SDCARD_EEPROM_EMULATION)
#define MARLIN_EEPROM_SIZE 0x800 // 2K
#endif

//
// Servos
//
#define SERVO0_PIN PB0 // BLTouch PWM-OUT PIN (TOUCH pins in the schematic have changed)

//
// Limit Switches
//
#define X_STOP_PIN PA5
#define Y_STOP_PIN PA6

#if ENABLED(BLTOUCH)
#define Z_MIN_PIN PB1 // BLTouch IN PIN (TOUCH pins in the schematic have changed)
#define Z_MAX_PIN PA7
#else
#define Z_STOP_PIN PA7 // Z-axis limit switch
#endif

#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN PB1 // BLTouch IN
#endif

//
// Filament Runout Sensor
//
#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN PA4 // "Pulled-high"
#endif

//
// Steppers
//
#define X_ENABLE_PIN PC3
#define X_STEP_PIN PC2
#define X_DIR_PIN PB9

#define Y_ENABLE_PIN PC3
#define Y_STEP_PIN PB8
#define Y_DIR_PIN PB7

#define Z_ENABLE_PIN PC3
#define Z_STEP_PIN PB6
#define Z_DIR_PIN PB5

#define E0_ENABLE_PIN PC3
#define E0_STEP_PIN PB4
#define E0_DIR_PIN PB3

//
// Temperature Sensors
//
#define TEMP_0_PIN PC5 // TH1
#define TEMP_BED_PIN PC4 // TB1

//
// Heaters / Fans
//
#define HEATER_0_PIN PA1 // HEATER1
#define HEATER_BED_PIN PB10 // HOT BED

#ifndef FAN0_PIN
#define FAN0_PIN PA0 // FAN
#endif
#if PIN_EXISTS(FAN0)
#define FAN_SOFT_PWM
#endif

#if HAS_TMC_UART
// Reduce baud rate to improve software serial reliability
#define TMC_BAUD_RATE 19200

/**
* TMC2208/TMC2209 stepper drivers
*
* Hardware serial communication ports.
* If undefined software serial is used according to the pins below
*/
#define X_HARDWARE_SERIAL Serial6
#define Y_HARDWARE_SERIAL Serial6
#define Z_HARDWARE_SERIAL Serial6
#define E0_HARDWARE_SERIAL Serial6

#ifndef X_SLAVE_ADDRESS
#define X_SLAVE_ADDRESS 0
#endif
#ifndef Y_SLAVE_ADDRESS
#define Y_SLAVE_ADDRESS 1
#endif
#ifndef Z_SLAVE_ADDRESS
#define Z_SLAVE_ADDRESS 2
#endif
#ifndef E0_SLAVE_ADDRESS
#define E0_SLAVE_ADDRESS 3
#endif

// Software serial

#define X_SERIAL_TX_PIN PC6
#define X_SERIAL_RX_PIN PC7

#define Y_SERIAL_TX_PIN X_SERIAL_TX_PIN
#define Y_SERIAL_RX_PIN X_SERIAL_RX_PIN

#define Z_SERIAL_TX_PIN X_SERIAL_TX_PIN
#define Z_SERIAL_RX_PIN X_SERIAL_RX_PIN

#define E0_SERIAL_TX_PIN X_SERIAL_TX_PIN
#define E0_SERIAL_RX_PIN X_SERIAL_RX_PIN

#define E1_SERIAL_TX_PIN X_SERIAL_TX_PIN
#define E1_SERIAL_RX_PIN X_SERIAL_RX_PIN

#define X_DIAG_PIN PC13
#define Y_DIAG_PIN PC14
#define Z_DIAG_PIN PC15
#define E0_DIAG_PIN PA15

#endif // HAS_TMC_UART

//
// SD Card
//
#define SD_DETECT_PIN PC1
#define SDCARD_CONNECTION ONBOARD
#define ONBOARD_SPI_DEVICE 1
//#define ONBOARD_SD_CS_PIN PA4 // SDSS
#define SDIO_SUPPORT
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer

#if ENABLED(CR10_STOCKDISPLAY)

#if ENABLED(RET6_12864_LCD)
// RET6 12864 LCD
#define LCD_PINS_RS PB12
#define LCD_PINS_ENABLE PB15
#define LCD_PINS_D4 PB13

#define BTN_ENC PB2
#define BTN_EN1 PA2
#define BTN_EN2 PB14

#ifndef HAS_PIN_27_BOARD
#define BEEPER_PIN PC0
#endif

#elif ENABLED(VET6_12864_LCD)
// VET6 12864 LCD
#define LCD_PINS_RS PA4
//#define LCD_PINS_ENABLE PA7
#define LCD_PINS_D4 PA5

#define BTN_ENC PC5
#define BTN_EN1 PB10
#define BTN_EN2 PA6

#else
#error "Define RET6_12864_LCD or VET6_12864_LCD to select pins for CR10_STOCKDISPLAY with the CREALITY_CR4NTXXC10 controller."
#endif

#elif ENABLED(DWIN_CREALITY_LCD)

// RET6 DWIN ENCODER LCD
#define BTN_ENC PB14
#define BTN_EN1 PB15
#define BTN_EN2 PB12

//#define LCD_LED_PIN PB2
#ifndef BEEPER_PIN
#define BEEPER_PIN PB13
#undef SPEAKER
#endif

#elif ENABLED(DWIN_VET6_CREALITY_LCD)

// VET6 DWIN ENCODER LCD
#define BTN_ENC PA6
//#define BTN_EN1 PA7
#define BTN_EN2 PA4

#define BEEPER_PIN PA5

#endif

//
// M3/M4/M5 - Spindle/Laser Control
//
#if HAS_CUTTER
//#undef HEATER_0_PIN
//#undef HEATER_BED_PIN
//#undef FAN0_PIN
#define SPINDLE_LASER_ENA_PIN PC0 // FET 1
#define SPINDLE_LASER_PWM_PIN PC0 // Bed FET
#define SPINDLE_DIR_PIN PC0 // FET 4
Copy link
Member

@thinkyhead thinkyhead Jul 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These don't seem quite correct. The ENA and PWM pins might coincide, but the DIR pin can't also be the same as the rest. Follow the pattern established by other (similar) pins files and enable SPINDLE/LASER pins based on whether SPINDLE or LASER is enabled. The file pins_CREALITY_V24S1_301.h is probably also incorrect.

//#define LASER_SOFT_PWM_PIN PC0
#endif
65 changes: 65 additions & 0 deletions buildroot/share/PlatformIO/boards/marlin_STM32F401RE_freeruns.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"build": {
"core": "stm32",
"cpu": "cortex-m4",
"extra_flags": "-DSTM32F401xx",
"f_cpu": "84000000L",
"hwids": [
[
"0x1EAF",
"0x0003"
],
[
"0x0483",
"0x3748"
]
],
"ldscript": "ldscript.ld",
"mcu": "stm32f401ret6",
"variant": "MARLIN_STM32F401RE_FREERUNS"
},
"debug": {
"jlink_device": "STM32F401RE",
"openocd_target": "stm32f4x",
"svd_path": "STM32F40x.svd",
"tools": {
"stlink": {
"server": {
"arguments": [
"-f",
"scripts/interface/stlink.cfg",
"-c",
"transport select hla_swd",
"-f",
"scripts/target/stm32f4x.cfg",
"-c",
"reset_config none"
],
"executable": "bin/openocd",
"package": "tool-openocd"
}
}
}
},
"frameworks": [
"arduino",
"stm32cube"
],
"name": "STM32F401RE (96k RAM. 512k Flash)",
"upload": {
"disable_flushing": false,
"maximum_ram_size": 98304,
"maximum_size": 524288,
"protocol": "stlink",
"protocols": [
"stlink",
"dfu",
"jlink"
],
"require_upload_port": true,
"use_1200bps_touch": false,
"wait_for_upload_port": false
},
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f401re.html",
"vendor": "Generic"
}
Loading