Skip to content

Commit 6a96089

Browse files
ellenspernisv
authored andcommitted
🔨 MKS Robin2 PIO Env (MarlinFirmware#25792)
1 parent fbd90d8 commit 6a96089

File tree

11 files changed

+1761
-3
lines changed

11 files changed

+1761
-3
lines changed

Marlin/src/core/boards.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@
425425
#define BOARD_FYSETC_S6_V2_0 5223 // FYSETC S6 v2.0 (STM32F446VE)
426426
#define BOARD_FYSETC_SPIDER 5224 // FYSETC Spider (STM32F446VE)
427427
#define BOARD_FLYF407ZG 5225 // FLYmaker FLYF407ZG (STM32F407ZG)
428-
#define BOARD_MKS_ROBIN2 5226 // MKS_ROBIN2 (STM32F407ZE)
428+
#define BOARD_MKS_ROBIN2 5226 // MKS Robin2 V1.0 (STM32F407ZE)
429429
#define BOARD_MKS_ROBIN_PRO_V2 5227 // MKS Robin Pro V2 (STM32F407VE)
430430
#define BOARD_MKS_ROBIN_NANO_V3 5228 // MKS Robin Nano V3 (STM32F407VG)
431431
#define BOARD_MKS_ROBIN_NANO_V3_1 5229 // MKS Robin Nano V3.1 (STM32F407VE)

Marlin/src/pins/pins.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@
692692
#elif MB(FLYF407ZG)
693693
#include "stm32f4/pins_FLYF407ZG.h" // STM32F4 env:FLYF407ZG
694694
#elif MB(MKS_ROBIN2)
695-
#include "stm32f4/pins_MKS_ROBIN2.h" // STM32F4 env:MKS_ROBIN2
695+
#include "stm32f4/pins_MKS_ROBIN2.h" // STM32F4 env:mks_robin2
696696
#elif MB(MKS_ROBIN_PRO_V2)
697697
#include "stm32f4/pins_MKS_ROBIN_PRO_V2.h" // STM32F4 env:mks_robin_pro2
698698
#elif MB(MKS_ROBIN_NANO_V3)

Marlin/src/pins/stm32f4/pins_MKS_ROBIN2.h

+36
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,39 @@
9999

100100
#define SD_DETECT_PIN PF9
101101
#define BEEPER_PIN PG2
102+
103+
//
104+
// TFT with FSMC interface
105+
//
106+
#if HAS_FSMC_TFT
107+
/**
108+
* Note: MKS Robin TFT screens use various TFT controllers.
109+
* If the screen stays white, disable 'LCD_RESET_PIN'
110+
* to let the bootloader init the screen.
111+
*/
112+
#define LCD_RESET_PIN PD13
113+
#define LCD_BACKLIGHT_PIN PD12
114+
115+
#define TFT_RESET_PIN LCD_RESET_PIN
116+
#define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN
117+
118+
#define FSMC_CS_PIN PG12 // NE4
119+
#define FSMC_RS_PIN PF12 // A0
120+
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
121+
#define TFT_CS_PIN FSMC_CS_PIN
122+
#define TFT_RS_PIN FSMC_RS_PIN
123+
124+
#define TFT_BUFFER_SIZE 14400
125+
126+
#define BEEPER_PIN PG2
127+
128+
#if NEED_TOUCH_PINS
129+
#define TOUCH_BUTTONS_HW_SPI
130+
#define TOUCH_BUTTONS_HW_SPI_DEVICE 1
131+
#define TOUCH_CS_PIN PD11 // SPI1_NSS
132+
#define TOUCH_SCK_PIN PB3 // SPI1_SCK
133+
#define TOUCH_MISO_PIN PB4 // SPI1_MISO
134+
#define TOUCH_MOSI_PIN PB5 // SPI1_MOSI
135+
#endif
136+
137+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"build": {
3+
"cpu": "cortex-m4",
4+
"extra_flags": "-DSTM32F407xx",
5+
"f_cpu": "168000000L",
6+
"hwids": [
7+
[
8+
"0x1EAF",
9+
"0x0003"
10+
],
11+
[
12+
"0x0483",
13+
"0x3748"
14+
]
15+
],
16+
"ldscript": "ldscript.ld",
17+
"mcu": "stm32f407zet6",
18+
"variant": "MARLIN_MKS_ROBIN2"
19+
},
20+
"debug": {
21+
"jlink_device": "STM32F407ZE",
22+
"openocd_target": "stm32f4x",
23+
"svd_path": "STM32F40x.svd",
24+
"tools": {
25+
"stlink": {
26+
"server": {
27+
"arguments": [
28+
"-f",
29+
"scripts/interface/stlink.cfg",
30+
"-c",
31+
"transport select hla_swd",
32+
"-f",
33+
"scripts/target/stm32f4x.cfg",
34+
"-c",
35+
"reset_config none"
36+
],
37+
"executable": "bin/openocd",
38+
"package": "tool-openocd"
39+
}
40+
}
41+
}
42+
},
43+
"frameworks": [
44+
"arduino",
45+
"stm32cube"
46+
],
47+
"name": "STM32F407ZE (192k RAM. 512k Flash)",
48+
"upload": {
49+
"disable_flushing": false,
50+
"maximum_ram_size": 131072,
51+
"maximum_size": 514288,
52+
"protocol": "stlink",
53+
"protocols": [
54+
"stlink",
55+
"dfu",
56+
"jlink",
57+
"cmsis-dap"
58+
],
59+
"require_upload_port": true,
60+
"use_1200bps_touch": false,
61+
"wait_for_upload_port": false
62+
},
63+
"url": "http://www.st.com/en/microcontrollers/stm32f407ze.html",
64+
"vendor": "Generic"
65+
}

buildroot/share/PlatformIO/variants/MARLIN_MKS_ROBIN2/PeripheralPins.c

+437
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/* SYS_WKUP */
2+
#ifdef PWR_WAKEUP_PIN1
3+
SYS_WKUP1 = PA_0,
4+
#endif
5+
#ifdef PWR_WAKEUP_PIN2
6+
SYS_WKUP2 = NC,
7+
#endif
8+
#ifdef PWR_WAKEUP_PIN3
9+
SYS_WKUP3 = NC,
10+
#endif
11+
#ifdef PWR_WAKEUP_PIN4
12+
SYS_WKUP4 = NC,
13+
#endif
14+
#ifdef PWR_WAKEUP_PIN5
15+
SYS_WKUP5 = NC,
16+
#endif
17+
#ifdef PWR_WAKEUP_PIN6
18+
SYS_WKUP6 = NC,
19+
#endif
20+
#ifdef PWR_WAKEUP_PIN7
21+
SYS_WKUP7 = NC,
22+
#endif
23+
#ifdef PWR_WAKEUP_PIN8
24+
SYS_WKUP8 = NC,
25+
#endif
26+
/* USB */
27+
#ifdef USBCON
28+
USB_OTG_FS_SOF = PA_8,
29+
USB_OTG_FS_VBUS = PA_9,
30+
USB_OTG_FS_ID = PA_10,
31+
USB_OTG_FS_DM = PA_11,
32+
USB_OTG_FS_DP = PA_12,
33+
USB_OTG_HS_ULPI_D0 = PA_3,
34+
USB_OTG_HS_SOF = PA_4,
35+
USB_OTG_HS_ULPI_CK = PA_5,
36+
USB_OTG_HS_ULPI_D1 = PB_0,
37+
USB_OTG_HS_ULPI_D2 = PB_1,
38+
USB_OTG_HS_ULPI_D7 = PB_5,
39+
USB_OTG_HS_ULPI_D3 = PB_10,
40+
USB_OTG_HS_ULPI_D4 = PB_11,
41+
USB_OTG_HS_ID = PB_12,
42+
USB_OTG_HS_ULPI_D5 = PB_12,
43+
USB_OTG_HS_ULPI_D6 = PB_13,
44+
USB_OTG_HS_VBUS = PB_13,
45+
USB_OTG_HS_DM = PB_14,
46+
USB_OTG_HS_DP = PB_15,
47+
USB_OTG_HS_ULPI_STP = PC_0,
48+
USB_OTG_HS_ULPI_DIR = PC_2,
49+
USB_OTG_HS_ULPI_NXT = PC_3,
50+
#endif

0 commit comments

Comments
 (0)