Skip to content

Commit

Permalink
✨ Add BOARD_CREALITY_V24S1_301F4
Browse files Browse the repository at this point in the history
Co-Authored-By: Miguel Risco-Castillo <mriscoc@users.noreply.github.com>
  • Loading branch information
2 people authored and tomek2k1 committed Jan 13, 2023
1 parent 3c8866e commit a0befa2
Show file tree
Hide file tree
Showing 19 changed files with 1,537 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
- STM32F103RE_btt
- STM32F103RE_btt_USB
- STM32F103RE_creality
- STM32F401RC_creality
- STM32F103VE_longer
- STM32F407VE_black
- STM32F401VE_STEVAL
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@
#define BOARD_MKS_EAGLE 4237 // MKS Eagle (STM32F407VE)
#define BOARD_ARTILLERY_RUBY 4238 // Artillery Ruby (STM32F401RC)
#define BOARD_FYSETC_SPIDER_V2_2 4239 // FYSETC Spider V2.2 (STM32F446VE)
#define BOARD_CREALITY_V24S1_301F4 4240 // Creality v2.4.S1_301F4 (STM32F401RC) as found in the Ender-3 S1 F4

//
// ARM Cortex M7
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@
#ifndef LCD_SERIAL_PORT
#if MB(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_E3_TURBO)
#define LCD_SERIAL_PORT 1
#elif MB(CREALITY_V24S1_301)
#elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4)
#define LCD_SERIAL_PORT 2 // Creality Ender3S1 board
#else
#define LCD_SERIAL_PORT 3 // Creality 4.x board
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/libs/BL24CXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#ifdef __STM32F1__
#define SDA_IN() do{ PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH &= 0XFFFF0FFF; PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH |= 8 << 12; }while(0)
#define SDA_OUT() do{ PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH &= 0XFFFF0FFF; PIN_MAP[IIC_EEPROM_SDA].gpio_device->regs->CRH |= 3 << 12; }while(0)
#elif STM32F1
#elif defined(STM32F1) || defined(STM32F4)
#define SDA_IN() SET_INPUT(IIC_EEPROM_SDA)
#define SDA_OUT() SET_OUTPUT(IIC_EEPROM_SDA)
#endif
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 @@ -695,6 +695,8 @@
#include "stm32f4/pins_MKS_EAGLE.h" // STM32F4 env:mks_eagle
#elif MB(ARTILLERY_RUBY)
#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

//
// ARM Cortex M7
Expand Down
8 changes: 7 additions & 1 deletion Marlin/src/pins/stm32f1/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@
#pragma once

#if NOT_TARGET(__STM32F1__, STM32F1)
#error "Oops! Select an STM32F1 board in 'Tools > Board.'"
#if DISABLED(ALLOW_STM32F4)
#error "Oops! Select an STM32F1 board in 'Tools > Board.'"
#elif NOT_TARGET(STM32F4)
#error "Oops! Select an STM32F4 board in 'Tools > Board.'"
#endif
#endif

#undef ALLOW_STM32F4
22 changes: 14 additions & 8 deletions Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
#pragma once

/**
* Creality V24S1_301 (STM32F103RE / STM32F103RC) board pin assignments as found on Ender 3 S1
* Creality V24S1_301 (STM32F103RE / STM32F103RC) board pin assignments as found on Ender 3 S1.
* Also supports the STM32F4 version of the board with identical pin mapping.
*/

#include "env_validate.h"
Expand All @@ -35,8 +36,12 @@
#error "Disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN when using BLTOUCH with Creality V24S1-301."
#endif

#define BOARD_INFO_NAME "Creality V24S1-301"
#define DEFAULT_MACHINE_NAME "Ender 3 S1"
#ifndef BOARD_INFO_NAME
#define BOARD_INFO_NAME "Creality V24S1-301"
#endif
#ifndef DEFAULT_MACHINE_NAME
#define DEFAULT_MACHINE_NAME "Ender 3 S1"
#endif

//
// Servos
Expand Down Expand Up @@ -70,8 +75,8 @@
//
// SD Card
//
#define ONBOARD_SPI_DEVICE 1
#define ONBOARD_SD_CS_PIN PA4 // SDSS
#define ONBOARD_SPI_DEVICE 1
#define ONBOARD_SD_CS_PIN PA4 // SDSS

//
// M3/M4/M5 - Spindle/Laser Control
Expand All @@ -80,9 +85,10 @@
//#define HEATER_0_PIN -1
//#define HEATER_BED_PIN -1
#define FAN_PIN -1
#define SPINDLE_LASER_ENA_PIN PA0 // FET 1
#define SPINDLE_LASER_PWM_PIN PA0 // Bed FET
#define SPINDLE_DIR_PIN PA0 // FET 4
#define SPINDLE_LASER_ENA_PIN PC0 // FET 1
#define SPINDLE_LASER_PWM_PIN PC0 // Bed FET
#define SPINDLE_DIR_PIN PC0 // FET 4
#define LASER_SOFT_PWM_PIN PC0
#endif

#include "pins_CREALITY_V4.h"
4 changes: 3 additions & 1 deletion Marlin/src/pins/stm32f1/pins_CREALITY_V4.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
//
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
//
#define DISABLE_DEBUG
#ifndef DISABLE_DEBUG
#define DISABLE_DEBUG
#endif

//
// EEPROM
Expand Down
38 changes: 38 additions & 0 deletions Marlin/src/pins/stm32f4/pins_CREALITY_V24S1_301F4.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2022 MarlinFirmware [https://github.com/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/>.
*
*/
#pragma once

/**
* Creality V24S1_301F4 (STM32F401RC) board pin assignments as found on Ender 3 S1.
*/

#ifndef BOARD_INFO_NAME
#define BOARD_INFO_NAME "Creality V24S1-301F4"
#endif
#ifndef DEFAULT_MACHINE_NAME
#define DEFAULT_MACHINE_NAME "Ender-3 S1 F4"
#endif

#define DISABLE_DEBUG false // DISABLE_(DEBUG|JTAG) is not supported for STM32F4.
#define ALLOW_STM32F4

#include "../stm32f1/pins_CREALITY_V24S1_301.h"
65 changes: 65 additions & 0 deletions buildroot/share/PlatformIO/boards/marlin_CREALITY_STM32F401RC.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": "stm32f401rct6",
"variant": "MARLIN_CREALITY_STM32F401RC"
},
"debug": {
"jlink_device": "STM32F401RC",
"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": "STM32F401RC (64k RAM. 256k Flash)",
"upload": {
"disable_flushing": false,
"maximum_ram_size": 65536,
"maximum_size": 262144,
"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/stm32f401rc.html",
"vendor": "Generic"
}
Loading

0 comments on commit a0befa2

Please sign in to comment.