Skip to content

Commit

Permalink
Initial Anet ET4 Board Support
Browse files Browse the repository at this point in the history
  • Loading branch information
thisiskeithb committed Nov 26, 2020
1 parent 4f4843a commit 12053ee
Show file tree
Hide file tree
Showing 13 changed files with 1,794 additions and 0 deletions.
1 change: 1 addition & 0 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@
#define BOARD_FYSETC_S6_V2_0 4216 // FYSETC S6 v2.0 board
#define BOARD_FLYF407ZG 4217 // FLYF407ZG board (STM32F407ZG)
#define BOARD_MKS_ROBIN2 4218 // MKS_ROBIN2 (STM32F407ZE)
#define BOARD_ANET_ET4 4219 // ANET_ET4 (STM32F407VGT6)

//
// 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 @@ -646,6 +646,8 @@
#include "stm32f4/pins_MKS_ROBIN2.h" // STM32F4 env:MKS_ROBIN2
#elif MB(FYSETC_S6_V2_0)
#include "stm32f4/pins_FYSETC_S6_V2_0.h" // STM32F4 env:FYSETC_S6
#elif MB(ANET_ET4)
#include "stm32f4/pins_ANET_ET4.h" // STM32F4 env:ANET_ET4

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

#if NOT_TARGET(STM32F4)
#error "Oops! Select an STM32F4 board in 'Tools > Board.'"
#elif HOTENDS > 1 || E_STEPPERS > 1
#error "Anet ET4 supports up to 1 hotends / E-steppers."
#endif

#define BOARD_INFO_NAME "Anet ET4"

//
// EEPROM
//
// Use one of these or SDCard-based Emulation will be used
#if NO_EEPROM_SELECTED
//#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation
#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation
//#define IIC_BL24CXX_EEPROM // Use I2C EEPROM onboard IC (AT24C04C, Size 4KB, PageSize 16B)
#endif

#if ENABLED(FLASH_EEPROM_EMULATION)
// Decrease delays and flash wear by spreading writes across the
// 128 kB sector allocated for EEPROM emulation.
#define FLASH_EEPROM_LEVELING
#elif ENABLED(IIC_BL24CXX_EEPROM)
#define IIC_EEPROM_SDA PB11
#define IIC_EEPROM_SCL PB10
#define EEPROM_DEVICE_ADDRESS 0xA0
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB
#endif

//
// Limit Switches
//
#define X_STOP_PIN PC13
#define Y_STOP_PIN PE12
#define Z_STOP_PIN PE11

//
// Z Probe
//
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN PC3
#endif

//
// Filament Runout Sensor
//
#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN PA2
#endif

//
// Power Loss Detection
//
#ifndef POWER_LOSS_PIN
#define POWER_LOSS_PIN PA8
#endif

//
// LED PIN
//
#define LED_PIN PD12

//
// Steppers
//
#define X_STEP_PIN PB6
#define X_DIR_PIN PB5
#define X_ENABLE_PIN PB7

#define Y_STEP_PIN PB3
#define Y_DIR_PIN PD6
#define Y_ENABLE_PIN PB4

#define Z_STEP_PIN PA12
#define Z_DIR_PIN PA11
#define Z_ENABLE_PIN PA15

#define E0_STEP_PIN PB9
#define E0_DIR_PIN PB8
#define E0_ENABLE_PIN PE0

//
// Temperature Sensors
//
#define TEMP_0_PIN PA1
#define TEMP_BED_PIN PA4

//
// Heaters / Fans
//
#define HEATER_0_PIN PA0
#define HEATER_BED_PIN PE2
#define FAN_PIN PE3
#define FAN1_PIN PE1

#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN FAN1_PIN
#endif

//
// LCD / Controller
//
#define TFT_DRIVER ST7789
#define TFT_RESET_PIN PE6
#define TFT_CS_PIN PD7
#define TFT_RS_PIN PD13

#if ENABLED(TOUCH_SCREEN)
#define TOUCH_CS_PIN PB2
#define TOUCH_SCK_PIN PB0
#define TOUCH_MOSI_PIN PE5
#define TOUCH_MISO_PIN PE4
#define TOUCH_INT_PIN PB1
#endif

//
// SD Card
//
//#define SDIO_SUPPORT

#ifndef SDCARD_CONNECTION
#define SDCARD_CONNECTION ONBOARD
#endif

#if ENABLED(SDSUPPORT)

#define SDIO_D0_PIN PC8
#define SDIO_D1_PIN PC9
#define SDIO_D2_PIN PC10
#define SDIO_D3_PIN PC11
#define SDIO_CK_PIN PC12
#define SDIO_CMD_PIN PD2

#if DISABLED(SDIO_SUPPORT)
#define SOFTWARE_SPI
#define SDSS SDIO_D3_PIN
#define SCK_PIN SDIO_CK_PIN
#define MISO_PIN SDIO_D0_PIN
#define MOSI_PIN SDIO_CMD_PIN
#endif

#ifndef SD_DETECT_PIN
#define SD_DETECT_PIN PD3
#endif

#endif
46 changes: 46 additions & 0 deletions buildroot/share/PlatformIO/boards/ANET_ET4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"build": {
"core": "stm32",
"cpu": "cortex-m4",
"extra_flags": "-DSTM32F4 -DSTM32F407xx -DSTM32F40_41xxx",
"f_cpu": "168000000L",
"hwids": [
[
"0x1EAF",
"0x0003"
],
[
"0x0483",
"0x3748"
]
],
"mcu": "stm32f407vgt6",
"variant": "ANET_ET4"
},
"debug": {
"jlink_device": "STM32F407VG",
"openocd_target": "stm32f4x",
"svd_path": "STM32F40x.svd"
},
"frameworks": [
"arduino",
"stm32cube"
],
"name": "STM32F407VG (192k RAM. 1024k Flash)",
"upload": {
"disable_flushing": false,
"maximum_ram_size": 196608,
"maximum_size": 1048576,
"protocol": "jlink",
"protocols": [
"stlink",
"dfu",
"jlink"
],
"require_upload_port": true,
"use_1200bps_touch": false,
"wait_for_upload_port": false
},
"url": "http://www.st.com/en/microcontrollers/stm32f407vg.html",
"vendor": "Generic"
}
Loading

0 comments on commit 12053ee

Please sign in to comment.