Skip to content

Commit

Permalink
apply formatting and patches
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed May 12, 2022
1 parent d8fce13 commit 0da1f53
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 119 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#pragma once

/**
* Creality v2.4.S1 (STM32F103RE / STM32F103RC) v101 as found in the Ender 7 board pin assignments
* Creality v2.4.S1 (STM32F103RE / STM32F103RC) v101 as found in the Ender 7
*/

#define BOARD_INFO_NAME "Creality v2.4.S1 V101"
Expand Down
105 changes: 50 additions & 55 deletions Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
Expand All @@ -22,40 +22,38 @@
#pragma once

/**
* Creality v2.4.S1 (STM32F103RE / STM32F103RC) v101 as found in the Ender 7 board pin assignments
* Creality v2.5.S1 (STM32F103RE / STM32F103RC) v101 as found in the Ender 7
*/

#include "env_validate.h"

#if HAS_MULTI_HOTEND || E_STEPPERS > 1
#error "Creality V2.5.S1 only supports one hotend / E-stepper. Comment out this line to continue."
#endif

#define BOARD_INFO_NAME "Creality v2.5.S1"
#define DEFAULT_MACHINE_NAME "Creality3D"

//
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
//
#define DISABLE_DEBUG

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

// I2C
#define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 used only for display settings
#if ENABLED(IIC_BL24CXX_EEPROM)
#define IIC_EEPROM_SDA PA11
#define IIC_EEPROM_SCL PA12
#define MARLIN_EEPROM_SIZE 0x800 // 2Kb (24C16)
#else
#define SDCARD_EEPROM_EMULATION // SD EEPROM until all EEPROM is BL24CXX
#define MARLIN_EEPROM_SIZE 0x800 // 2Kb
#endif

// SPI
//#define SPI_EEPROM // EEPROM on SPI-0
//#define SPI_CHAN_EEPROM1 ?
//#define SPI_EEPROM1_CS ?

// 2K EEPROM
//#define SPI_EEPROM2_CS ?

// 32Mb FLASH
//#define SPI_FLASH_CS ?
#if ENABLED(IIC_BL24CXX_EEPROM)
#define IIC_EEPROM_SDA PA11
#define IIC_EEPROM_SCL PA12
#define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16)
#elif EITHER(SDCARD_EEPROM_EMULATION, FLASH_EEPROM_EMULATION)
#define MARLIN_EEPROM_SIZE 0x800 // 2K
#endif

//
Expand All @@ -64,51 +62,45 @@
#define X_STOP_PIN PC4
#define Y_STOP_PIN PC5

//
// Servos
//
#if ENABLED(BLTOUCH)
#define Z_MIN_PROBE_PIN PC15 // BLTouch IN PIN
#define SERVO0_PIN PC14 // BLTouch OUT PIN
#define Z_MIN_PIN -1
#elif ENABLED(PROBE_ACTIVATION_SWITCH)
#define Z_MIN_PIN PC15
#define PROBE_TARE_PIN PC14
#define PROBE_ACTIVATION_SWITCH_PIN PB2
#define Z_STOP_PIN -1
#define SERVO0_PIN PC14 // BLTouch OUT PIN
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN PC15 // BLTouch IN PIN
#endif
#else
#define Z_MIN_PIN PC15
#define Z_STOP_PIN PC15
#if ENABLED(PROBE_ACTIVATION_SWITCH)
#define PROBE_TARE_PIN PC14
#define PROBE_ACTIVATION_SWITCH_PIN PB2
#endif
#endif

//
// Filament Runout Sensor
//
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define FIL_RUNOUT_PIN PA15 // "Pulled-high"
#define FIL_RUNOUT_PIN PA15 // "Pulled-high"
#endif

//
// Steppers
//
#define X_ENABLE_PIN PC3
#define X_STEP_PIN PB8
#define X_DIR_PIN PB7
#define X_ENABLE_PIN PC3

#define Y_ENABLE_PIN PC3
#define Y_STEP_PIN PB6
#define Y_DIR_PIN PB5
#define Y_ENABLE_PIN X_ENABLE_PIN

#define Z_ENABLE_PIN PC3
#define Z_STEP_PIN PB4
#define Z_DIR_PIN PB3
#define Z_ENABLE_PIN X_ENABLE_PIN

#define E0_ENABLE_PIN PC3
#define E0_STEP_PIN PC2
#define E0_DIR_PIN PB9

//
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
//
#define DISABLE_DEBUG
#define E0_ENABLE_PIN X_ENABLE_PIN

//
// Temperature Sensors
Expand All @@ -124,34 +116,37 @@

#define FAN_PIN PB15 // FAN
#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN PC13 // FAN
#define E0_AUTO_FAN_PIN PC13 // FAN
#endif
#define FAN_SOFT_PWM
#define FAN_SOFT_PWM_REQUIRED

//
// SD Card
//
#define SD_DETECT_PIN PC7
#define SDCARD_CONNECTION ONBOARD
#define ON_BOARD_SPI_DEVICE 1
#define ONBOARD_SD_CS_PIN PC12 // SDSS
#define ONBOARD_SD_CS_PIN PC12 // SDSS
#define SDIO_SUPPORT
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer

#define CASE_LIGHT_PIN PA7
//
// Misc. Functions
//
#define CASE_LIGHT_PIN PA7

//
// Suicide Power
//
#define PS_ON_PIN PA0
#define MOTOR_CIRCUIT_PIN PA1
#define PS_ON_PIN PA0
#define MOTOR_CIRCUIT_PIN PA1

//
// Motor Protect
//
#define MOTOR_PROTECT_PIN PC0
#define MOTOR_PROTECT_PIN PC0

//
// WiFI Reset
// WiFi Reset
//
#define RESET_WIFI_PIN PB12
#define RESET_WIFI_PIN PB12
10 changes: 5 additions & 5 deletions Marlin/src/pins/stm32f1/pins_CREALITY_V4.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@

#define BOARD_NO_NATIVE_USB

//
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
//
#define DISABLE_DEBUG

//
// EEPROM
//
Expand Down Expand Up @@ -122,11 +127,6 @@
#endif
#define E0_ENABLE_PIN X_ENABLE_PIN

//
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
//
#define DISABLE_DEBUG

//
// Temperature Sensors
//
Expand Down
55 changes: 21 additions & 34 deletions Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,34 +40,24 @@

#define BOARD_NO_NATIVE_USB

//
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
//
#define DISABLE_DEBUG

//
// EEPROM
//
#if NO_EEPROM_SELECTED
// FLASH
//#define FLASH_EEPROM_EMULATION

// I2C
#define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 used only for display settings
#if ENABLED(IIC_BL24CXX_EEPROM)
#define IIC_EEPROM_SDA PA11
#define IIC_EEPROM_SCL PA12
#define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16)
#else
#define SDCARD_EEPROM_EMULATION // SD EEPROM until all EEPROM is BL24CXX
#define MARLIN_EEPROM_SIZE 0x800 // 2K
#endif

// SPI
//#define SPI_EEPROM // EEPROM on SPI-0
//#define SPI_CHAN_EEPROM1 ?
//#define SPI_EEPROM1_CS_PIN ?

// 2K EEPROM
//#define SPI_EEPROM2_CS_PIN ?

// 32Mb FLASH
//#define SPI_FLASH_CS_PIN ?
#define IIC_BL24CXX_EEPROM // EEPROM on I2C-0
#endif
#if ENABLED(IIC_BL24CXX_EEPROM)
#define IIC_EEPROM_SDA PA11
#define IIC_EEPROM_SCL PA12
#define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16)
#else
#define SDCARD_EEPROM_EMULATION // SD EEPROM until all EEPROM is BL24CXX
#define MARLIN_EEPROM_SIZE 0x800 // 2K
#endif

//
Expand All @@ -82,7 +72,9 @@
#define Y_STOP_PIN PA7
#define Z_STOP_PIN PA5

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

//
// Filament Runout Sensor
Expand All @@ -94,42 +86,37 @@
//
// Steppers
//
#define X_ENABLE_PIN PC3
#ifndef X_STEP_PIN
#define X_STEP_PIN PC2
#endif
#ifndef X_DIR_PIN
#define X_DIR_PIN PB9
#endif
#define X_ENABLE_PIN PC3

#define Y_ENABLE_PIN PC3
#ifndef Y_STEP_PIN
#define Y_STEP_PIN PB8
#endif
#ifndef Y_DIR_PIN
#define Y_DIR_PIN PB7
#endif
#define Y_ENABLE_PIN X_ENABLE_PIN

#define Z_ENABLE_PIN PC3
#ifndef Z_STEP_PIN
#define Z_STEP_PIN PB6
#endif
#ifndef Z_DIR_PIN
#define Z_DIR_PIN PB5
#endif
#define Z_ENABLE_PIN X_ENABLE_PIN

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

//
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
//
#define DISABLE_DEBUG
#define E0_ENABLE_PIN X_ENABLE_PIN

//
// Temperature Sensors
Expand Down
8 changes: 1 addition & 7 deletions ini/stm32f1-maple.ini
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,9 @@ upload_protocol = jlink
# Creality (STM32F103RET6)
#
[env:STM32F103RE_creality_smartPro_maple]
extends = env:STM32F103RE_maple
build_flags = ${common_stm32f1.build_flags} -DTEMP_TIMER_CHAN=4
extends = env:STM32F103RE_creality_maple
board_build.address = 0x08010000
board_build.ldscript = crealityPro.ld
extra_scripts = ${common_stm32f1.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/random-bin.py
buildroot/share/PlatformIO/scripts/custom_board.py
debug_tool = jlink
upload_protocol = jlink

#
# BigTree SKR Mini E3 V2.0 & DIP / SKR CR6 (STM32F103RET6 ARM Cortex-M3)
Expand Down
22 changes: 5 additions & 17 deletions ini/stm32f1.ini
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ board = genericSTM32F103RE
extends = STM32F103Rx_creality_xfer
board = genericSTM32F103RE

[env:STM32F103RE_creality_smartPro]
extends = STM32F103Rx_creality
board_build.offset = 0x10000
board_upload.offset_address = 0x08010000

#
# Creality 256K (STM32F103RC)
#
Expand All @@ -164,23 +169,6 @@ board = genericSTM32F103RC
extends = STM32F103Rx_creality_xfer
board = genericSTM32F103RC

[STM32F103RE_creality_SmartPro]
extends = stm32_variant
board_build.variant = MARLIN_F103Rx
board_build.offset = 0x10000
board_upload.offset_address = 0x08010000
build_flags = ${stm32_variant.build_flags}
-DMCU_STM32F103RE -DHAL_SD_MODULE_ENABLED
-DSS_TIMER=4 -DTIMER_SERVO=TIM5
-DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8
build_unflags = ${stm32_variant.build_unflags}
-DUSBCON -DUSBD_USE_CDC
extra_scripts = ${stm32_variant.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/random-bin.py
monitor_speed = 115200
debug_tool = stlink
upload_protocol = stlink

#
# BigTree SKR Mini E3 V2.0 & DIP / SKR CR6 (STM32F103RET6 ARM Cortex-M3)
#
Expand Down

0 comments on commit 0da1f53

Please sign in to comment.