Skip to content

Commit

Permalink
✨ Artillery Ruby (STM32F401RCT6) (MarlinFirmware#23029)
Browse files Browse the repository at this point in the history
  • Loading branch information
thisiskeithb authored and AlexColello committed Jan 14, 2022
1 parent 949b49e commit e39974a
Show file tree
Hide file tree
Showing 14 changed files with 1,552 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { HAL_adc_result = analogRe
uint16_t HAL_adc_get_result() { return HAL_adc_result; }

// Reset the system to initiate a firmware flash
void flashFirmware(const int16_t) { HAL_reboot(); }
WEAK void flashFirmware(const int16_t) { HAL_reboot(); }

// Maple Compatibility
volatile uint32_t systick_uptime_millis = 0;
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 @@ -406,6 +406,7 @@
#define BOARD_INDEX_REV03 4234 // Index PnP Controller REV03 (STM32F407VET6/VGT6)
#define BOARD_MKS_ROBIN_NANO_V1_3_F4 4235 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VET6)
#define BOARD_MKS_EAGLE 4236 // MKS Eagle (STM32F407VET6)
#define BOARD_ARTILLERY_RUBY 4237 // Artillery Ruby (STM32F401RCT6)

//
// 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 @@ -667,6 +667,8 @@
#include "stm32f4/pins_MKS_ROBIN_NANO_V1_3_F4.h" // STM32F4 env:mks_robin_nano_v1_3_f4
#elif MB(MKS_EAGLE)
#include "stm32f4/pins_MKS_EAGLE.h" // STM32F4 env:mks_eagle
#elif MB(ARTILLERY_RUBY)
#include "stm32f4/pins_ARTILLERY_RUBY.h" // STM32F4 env:Artillery_Ruby

//
// ARM Cortex M7
Expand Down
182 changes: 182 additions & 0 deletions Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 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 <http://www.gnu.org/licenses/>.
*
*/
#pragma once

#include "env_validate.h"

#if HOTENDS > 1 || E_STEPPERS > 1
#error "Artillery Ruby supports up to 1 hotends / E-steppers."
#endif

#define BOARD_INFO_NAME "Artillery Ruby"

#define FLASH_EEPROM_EMULATION
//#define I2C_EEPROM
//#define E2END 0xFFF // 4KB

#define HAL_TIMER_RATE F_CPU

//
// Limit Switches
//
#if (X_HOME_DIR == 1)
#define X_MIN_PIN -1
#define X_MAX_PIN PA2
#else
#define X_MIN_PIN PA2
#define X_MAX_PIN -1
#endif
#if (Y_HOME_DIR == 1)
#define Y_MIN_PIN -1
#define Y_MAX_PIN PA1
#else
#define Y_MIN_PIN PA1
#define Y_MAX_PIN -1
#endif
#if (Z_HOME_DIR == 1)
#define Z_MIN_PIN PC2
#define Z_MAX_PIN PA0
#else
#define Z_MIN_PIN PA0
#define Z_MAX_PIN PC2
#endif

//
// Steppers
//
#define X_STEP_PIN PB14
#define X_DIR_PIN PB13
#define X_ENABLE_PIN PB15

#define Y_STEP_PIN PB10
#define Y_DIR_PIN PB2
#define Y_ENABLE_PIN PB12

#define Z_STEP_PIN PB0
#define Z_DIR_PIN PC5
#define Z_ENABLE_PIN PB1

#define E0_STEP_PIN PA7
#define E0_DIR_PIN PA6
#define E0_ENABLE_PIN PC4

#define E1_STEP_PIN PA4
#define E1_DIR_PIN PA3
#define E1_ENABLE_PIN PA5

//
// Temperature Sensors
//
#define TEMP_0_PIN PC0
#define TEMP_BED_PIN PC1

//
// Heaters / Fans
//
#ifndef HEATER_0_PIN
#define HEATER_0_PIN PC9 // Heater0
#endif
#ifndef HEATER_BED_PIN
#define HEATER_BED_PIN PA8 // Hotbed
#endif
#ifndef FAN_PIN
#define FAN_PIN PC8 // Fan0
#endif
#ifndef FAN1_PIN
#define FAN1_PIN PC7 // Fan1
#endif
#ifndef FAN2_PIN
#define FAN2_PIN PC6 // Fan2
#endif

//
// Servos
//
#define SERVO0_PIN PC3

//
// SPI
//
#define SCK_PIN PC10
#define MISO_PIN PC11
#define MOSI_PIN PC12

//
// LCD / Controller
//
#if HAS_WIRED_LCD
#if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
#define LCD_PINS_DC PB8 // Set as output on init
#define LCD_PINS_RS PB9 // Pull low for 1s to init
// DOGM SPI LCD Support
#define DOGLCD_CS PC15
#define DOGLCD_MOSI PB6
#define DOGLCD_SCK PB5
#define DOGLCD_A0 LCD_PINS_DC
#elif ENABLED(FYSETC_MINI_12864)
#define DOGLCD_CS PB6
#define DOGLCD_A0 PC15

//#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
// results in LCD soft SPI mode 3, SD soft SPI mode 0

#define LCD_RESET_PIN PB5 // Must be high or open for LCD to operate normally.

#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN PB9
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN PB8
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN PB7
#endif
#elif ENABLED(FYSETC_MINI_12864_2_1)
#define NEOPIXEL_PIN PB9
#endif

#define DEFAULT_LCD_CONTRAST 255
#else
#define LCD_PINS_RS PC15
#define LCD_PINS_ENABLE PB6
#define LCD_PINS_D4 PB5
#define LCD_PINS_D5 PB9
#define LCD_PINS_D6 PB8
#endif

#define LCD_PINS_D7 PB7

//
// Beeper, SD Card, Encoder
//
#define BEEPER_PIN PC13

#if ENABLED(SDSUPPORT)
#define SDSS PA15
#define SD_DETECT_PIN PD2
#endif

#define BTN_EN1 PB4
#define BTN_EN2 PB3
#define BTN_ENC PC14
#endif
60 changes: 60 additions & 0 deletions buildroot/share/PlatformIO/boards/marlin_Artillery_Ruby.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"build": {
"core": "stm32",
"cpu": "cortex-m4",
"extra_flags": "-DSTM32F401xx",
"f_cpu": "84000000L",
"hwids": [
[
"0x0483",
"0xDF11"
]
],
"mcu": "stm32f401rct6",
"variant": "MARLIN_ARTILLERY_RUBY"
},
"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/evaluation-tools/steval-3dp001v1.html",
"vendor": "Generic"
}
18 changes: 0 additions & 18 deletions buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,19 @@

import os
Import("env", "projenv")
# access to global build environment
print(env)
# access to project build environment (is used source files in "src" folder)
print(projenv)

config = configparser.ConfigParser()
config.read("platformio.ini")

#com_port = config.get("env:STM32F103RC_meeb", "upload_port")
#print('Use the {0:s} to reboot the board to dfu mode.'.format(com_port))

#
# Upload actions
#

def before_upload(source, target, env):
print("before_upload")
# do some actions
# use com_port
#
env.Execute("pwd")

def after_upload(source, target, env):
print("after_upload")
# do some actions
#
#
env.Execute("pwd")

print("Current build targets", map(str, BUILD_TARGETS))

env.AddPreAction("upload", before_upload)
env.AddPostAction("upload", after_upload)

Expand Down
1 change: 0 additions & 1 deletion buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#
# buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py
#
import os
from os.path import join
from os.path import expandvars
Import("env")
Expand Down
Loading

0 comments on commit e39974a

Please sign in to comment.