Skip to content

Commit

Permalink
🔨 MKS Robin2 PIO Env (MarlinFirmware#25792)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensp authored and Tracy Spiva committed May 25, 2023
1 parent c3a5f0b commit 848c8cf
Show file tree
Hide file tree
Showing 11 changed files with 1,761 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
#define BOARD_FYSETC_S6_V2_0 5223 // FYSETC S6 v2.0 (STM32F446VE)
#define BOARD_FYSETC_SPIDER 5224 // FYSETC Spider (STM32F446VE)
#define BOARD_FLYF407ZG 5225 // FLYmaker FLYF407ZG (STM32F407ZG)
#define BOARD_MKS_ROBIN2 5226 // MKS_ROBIN2 (STM32F407ZE)
#define BOARD_MKS_ROBIN2 5226 // MKS Robin2 V1.0 (STM32F407ZE)
#define BOARD_MKS_ROBIN_PRO_V2 5227 // MKS Robin Pro V2 (STM32F407VE)
#define BOARD_MKS_ROBIN_NANO_V3 5228 // MKS Robin Nano V3 (STM32F407VG)
#define BOARD_MKS_ROBIN_NANO_V3_1 5229 // MKS Robin Nano V3.1 (STM32F407VE)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@
#elif MB(FLYF407ZG)
#include "stm32f4/pins_FLYF407ZG.h" // STM32F4 env:FLYF407ZG
#elif MB(MKS_ROBIN2)
#include "stm32f4/pins_MKS_ROBIN2.h" // STM32F4 env:MKS_ROBIN2
#include "stm32f4/pins_MKS_ROBIN2.h" // STM32F4 env:mks_robin2
#elif MB(MKS_ROBIN_PRO_V2)
#include "stm32f4/pins_MKS_ROBIN_PRO_V2.h" // STM32F4 env:mks_robin_pro2
#elif MB(MKS_ROBIN_NANO_V3)
Expand Down
36 changes: 36 additions & 0 deletions Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,39 @@

#define SD_DETECT_PIN PF9
#define BEEPER_PIN PG2

//
// TFT with FSMC interface
//
#if HAS_FSMC_TFT
/**
* Note: MKS Robin TFT screens use various TFT controllers.
* If the screen stays white, disable 'LCD_RESET_PIN'
* to let the bootloader init the screen.
*/
#define LCD_RESET_PIN PD13
#define LCD_BACKLIGHT_PIN PD12

#define TFT_RESET_PIN LCD_RESET_PIN
#define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN

#define FSMC_CS_PIN PG12 // NE4
#define FSMC_RS_PIN PF12 // A0
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
#define TFT_CS_PIN FSMC_CS_PIN
#define TFT_RS_PIN FSMC_RS_PIN

#define TFT_BUFFER_SIZE 14400

#define BEEPER_PIN PG2

#if NEED_TOUCH_PINS
#define TOUCH_BUTTONS_HW_SPI
#define TOUCH_BUTTONS_HW_SPI_DEVICE 1
#define TOUCH_CS_PIN PD11 // SPI1_NSS
#define TOUCH_SCK_PIN PB3 // SPI1_SCK
#define TOUCH_MISO_PIN PB4 // SPI1_MISO
#define TOUCH_MOSI_PIN PB5 // SPI1_MOSI
#endif

#endif
65 changes: 65 additions & 0 deletions buildroot/share/PlatformIO/boards/marlin_MKS_ROBIN2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"build": {
"cpu": "cortex-m4",
"extra_flags": "-DSTM32F407xx",
"f_cpu": "168000000L",
"hwids": [
[
"0x1EAF",
"0x0003"
],
[
"0x0483",
"0x3748"
]
],
"ldscript": "ldscript.ld",
"mcu": "stm32f407zet6",
"variant": "MARLIN_MKS_ROBIN2"
},
"debug": {
"jlink_device": "STM32F407ZE",
"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": "STM32F407ZE (192k RAM. 512k Flash)",
"upload": {
"disable_flushing": false,
"maximum_ram_size": 131072,
"maximum_size": 514288,
"protocol": "stlink",
"protocols": [
"stlink",
"dfu",
"jlink",
"cmsis-dap"
],
"require_upload_port": true,
"use_1200bps_touch": false,
"wait_for_upload_port": false
},
"url": "http://www.st.com/en/microcontrollers/stm32f407ze.html",
"vendor": "Generic"
}
437 changes: 437 additions & 0 deletions buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/PeripheralPins.c

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/* SYS_WKUP */
#ifdef PWR_WAKEUP_PIN1
SYS_WKUP1 = PA_0,
#endif
#ifdef PWR_WAKEUP_PIN2
SYS_WKUP2 = NC,
#endif
#ifdef PWR_WAKEUP_PIN3
SYS_WKUP3 = NC,
#endif
#ifdef PWR_WAKEUP_PIN4
SYS_WKUP4 = NC,
#endif
#ifdef PWR_WAKEUP_PIN5
SYS_WKUP5 = NC,
#endif
#ifdef PWR_WAKEUP_PIN6
SYS_WKUP6 = NC,
#endif
#ifdef PWR_WAKEUP_PIN7
SYS_WKUP7 = NC,
#endif
#ifdef PWR_WAKEUP_PIN8
SYS_WKUP8 = NC,
#endif
/* USB */
#ifdef USBCON
USB_OTG_FS_SOF = PA_8,
USB_OTG_FS_VBUS = PA_9,
USB_OTG_FS_ID = PA_10,
USB_OTG_FS_DM = PA_11,
USB_OTG_FS_DP = PA_12,
USB_OTG_HS_ULPI_D0 = PA_3,
USB_OTG_HS_SOF = PA_4,
USB_OTG_HS_ULPI_CK = PA_5,
USB_OTG_HS_ULPI_D1 = PB_0,
USB_OTG_HS_ULPI_D2 = PB_1,
USB_OTG_HS_ULPI_D7 = PB_5,
USB_OTG_HS_ULPI_D3 = PB_10,
USB_OTG_HS_ULPI_D4 = PB_11,
USB_OTG_HS_ID = PB_12,
USB_OTG_HS_ULPI_D5 = PB_12,
USB_OTG_HS_ULPI_D6 = PB_13,
USB_OTG_HS_VBUS = PB_13,
USB_OTG_HS_DM = PB_14,
USB_OTG_HS_DP = PB_15,
USB_OTG_HS_ULPI_STP = PC_0,
USB_OTG_HS_ULPI_DIR = PC_2,
USB_OTG_HS_ULPI_NXT = PC_3,
#endif
Loading

0 comments on commit 848c8cf

Please sign in to comment.