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

[2.0.x] Add support for 'Black' STM32F407VET6 board with RAMP-like shield #13524

Merged
merged 3 commits into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion Marlin/src/HAL/HAL_STM32/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@
#if ENABLED(EEPROM_EMULATED_WITH_SRAM)
#if STM32F7xx
#include "stm32f7xx_ll_pwr.h"
#elif STM32F4xx
#include "stm32f4xx_ll_pwr.h"
#else
#error "EEPROM_EMULATED_WITH_SRAM is currently only supported for STM32F7xx"
#error "EEPROM_EMULATED_WITH_SRAM is currently only supported for STM32F4xx and STM32F7xx"
#endif
#endif // EEPROM_EMULATED_WITH_SRAM

Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@
#define BOARD_STM32F4 1804 // STM32 STM32GENERIC based STM32F4 controller
#define BOARD_ARMED 1807 // Arm'ed STM32F4 based controller
#define BOARD_RUMBA32 1809 // RUMBA32 STM32F4 based controller
#define BOARD_BLACK_STM32F407VE 1810 // BLACK_STM32F407VE
#define BOARD_BLACK_STM32F407ZE 1811 // BLACK_STM32F407ZE
#define BOARD_STEVAL 1866 // STEVAL-3DP001V1 3D PRINTER BOARD

//
Expand Down
6 changes: 5 additions & 1 deletion Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
#elif MB(MORPHEUS)
#include "pins_MORPHEUS.h" // STM32F1 env:STM32F1
#elif MB(MKS_ROBIN)
#include "pins_MKS_ROBIN.h" // STM32F1 env:STM32F1
#include "pins_MKS_ROBIN.h" // STM32F1 env:mks_robin

//
// STM32 ARM Cortex-M4F
Expand All @@ -435,9 +435,13 @@
#include "pins_ARMED.h" // STM32F4 env:ARMED
#elif MB(RUMBA32)
#include "pins_RUMBA32.h" // STM32F4 env:RUMBA32
#elif MB(BLACK_STM32F407VE)
#include "pins_BLACK_STM32F407VE.h" // STM32F4 env:black_stm32f407ve
#elif MB(STEVAL)
#include "pins_STEVAL.h" // STM32F4 env:STM32F4



//
// ARM Cortex M7
//
Expand Down
131 changes: 131 additions & 0 deletions Marlin/src/pins/pins_BLACK_STM32F407VE.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2019 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/>.
*
*/

/**
* STM32F407VET6 with RAMPS-like shield
* 'Black' STM32F407VET6 board - http://wiki.stm32duino.com/index.php?title=STM32F407
* Shield - https://github.com/jmz52/Hardware
*/

#pragma once

#if !defined(STM32F4) && !defined(STM32F4xx)
#error "Oops! Select an STM32F4 board in 'Tools > Board.'"
#endif

#define DEFAULT_MACHINE_NAME "STM32F407VET6"
//#define BOARD_NAME "Black STM32F4VET6"

//#define I2C_EEPROM
//#define E2END 0x1FFF // EEPROM end address (8kB)
#define EEPROM_EMULATED_WITH_SRAM

#if HOTENDS > 2 || E_STEPPERS > 2
#error "Black STM32F4VET6 supports up to 2 hotends / E-steppers."
#endif

//
// Servos
//
#define SERVO0_PIN PC6
#define SERVO1_PIN PC7

//
// Limit Switches
//
#define X_MIN_PIN PC13
#define X_MAX_PIN PA15
#define Y_MIN_PIN PA5
#define Y_MAX_PIN PD12
#define Z_MIN_PIN PD14
#define Z_MAX_PIN PD15

//
// Steppers
//
#define X_STEP_PIN PC4
#define X_DIR_PIN PA4
#define X_ENABLE_PIN PE7

#define Y_STEP_PIN PE5
#define Y_DIR_PIN PE2
#define Y_ENABLE_PIN PE6

#define Z_STEP_PIN PD5
#define Z_DIR_PIN PD3
#define Z_ENABLE_PIN PD6

#define E0_STEP_PIN PD7
#define E0_DIR_PIN PD0
#define E0_ENABLE_PIN PB9

#define E1_STEP_PIN PE0
#define E1_DIR_PIN PE1
#define E1_ENABLE_PIN PB8

//
// Temperature Sensors
//
#define TEMP_0_PIN PC0 // T0
#define TEMP_1_PIN PC1 // T1
#define TEMP_BED_PIN PC2 // TB
#define TEMP_CHAMBER_PIN PC3 // TC

//
// Heaters / Fans
//
#define HEATER_0_PIN PA2 // Heater0
#define HEATER_1_PIN PA3 // Heater1
#define HEATER_BED_PIN PA1 // Hotbed

#define FAN_PIN PE9 // Fan0
#define FAN1_PIN PE11 // Fan1
#define FAN2_PIN PE13 // Fan2
#define FAN3_PIN PE14 // Fan3

//
// Misc. Functions
//
#define SDSS PB12
#define LED_PIN PA6
//#define LED_PIN PA7
#define KILL_PIN PB1

//
// LCD / Controller
//
#define SD_DETECT_PIN PC5
//#define SD_DETECT_PIN PA8 // SDIO SD_DETECT_PIN, external SDIO card reader only

#define BEEPER_PIN PD10
#define LCD_PINS_RS PE15
#define LCD_PINS_ENABLE PD8
#define LCD_PINS_D4 PE10
#define LCD_PINS_D5 PE12
#define LCD_PINS_D6 PD1
#define LCD_PINS_D7 PE8
#define BTN_ENC PD9
#define BTN_EN1 PD4
#define BTN_EN2 PD13

#define DOGLCD_CS LCD_PINS_D5
#define DOGLCD_A0 LCD_PINS_D6
65 changes: 65 additions & 0 deletions buildroot/share/PlatformIO/boards/blackSTM32F407VET6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"build": {
"core": "stm32",
"cpu": "cortex-m4",
"extra_flags": "-DSTM32F407xx",
"f_cpu": "168000000L",
"hwids": [
[
"0x1EAF",
"0x0003"
],
[
"0x0483",
"0x3748"
]
],
"ldscript": "stm32f407xe.ld",
"mcu": "stm32f407vet6",
"variant": "MARLIN_F407VE"
},
"debug": {
"jlink_device": "STM32F407VE",
"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": "STM32F407VE (192k RAM. 512k Flash)",
"upload": {
"disable_flushing": false,
"maximum_ram_size": 131072,
"maximum_size": 514288,
"protocol": "stlink",
"protocols": [
"stlink",
"dfu",
"jlink"
],
"require_upload_port": true,
"use_1200bps_touch": false,
"wait_for_upload_port": false
},
"url": "http://www.st.com/en/microcontrollers/stm32f407ve.html",
"vendor": "Generic"
}
29 changes: 29 additions & 0 deletions buildroot/share/PlatformIO/scripts/black_stm32f407vet6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import os,shutil
from SCons.Script import DefaultEnvironment
from platformio import util

env = DefaultEnvironment()
platform = env.PioPlatform()
board = env.BoardConfig()

FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoststm32")
CMSIS_DIR = os.path.join(FRAMEWORK_DIR, "CMSIS", "CMSIS")
assert os.path.isdir(FRAMEWORK_DIR)
assert os.path.isdir(CMSIS_DIR)
assert os.path.isdir("buildroot/share/PlatformIO/variants")

mcu_type = board.get("build.mcu")[:-2]
variant = board.get("build.variant")
series = mcu_type[:7].upper() + "xx"
variant_dir = os.path.join(FRAMEWORK_DIR, "variants", variant)

source_dir = os.path.join("buildroot/share/PlatformIO/variants", variant)
assert os.path.isdir(source_dir)

if not os.path.isdir(variant_dir):
os.mkdir(variant_dir)

for file_name in os.listdir(source_dir):
full_file_name = os.path.join(source_dir, file_name)
if os.path.isfile(full_file_name):
shutil.copy(full_file_name, variant_dir)
Loading