Skip to content

Commit e679faf

Browse files
mks-vivathinkyhead
authored andcommitted
✨ MKS Robin Nano V1.3 (STM32F407VET6) (#22749)
1 parent 6de2580 commit e679faf

File tree

9 files changed

+292
-196
lines changed

9 files changed

+292
-196
lines changed

Marlin/src/core/boards.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@
401401
#define BOARD_FYSETC_CHEETAH_V20 4231 // FYSETC Cheetah V2.0
402402
#define BOARD_TH3D_EZBOARD_LITE_V2 4232 // TH3D EZBoard Lite v2.0
403403
#define BOARD_INDEX_REV03 4233 // Index PnP Controller REV03 (STM32F407VET6/VGT6)
404+
#define BOARD_MKS_ROBIN_NANO_V1_3_F4 4234 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VET6)
404405

405406
//
406407
// ARM Cortex M7

Marlin/src/lcd/extui/mks_ui/draw_ui.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,8 @@ void tft_style_init() {
347347
style_num_key_rel.body.grad_color = LV_COLOR_KEY_BACKGROUND;
348348
style_num_key_rel.text.color = LV_COLOR_TEXT;
349349
style_num_key_rel.text.sel_color = LV_COLOR_TEXT;
350-
#if HAS_SPI_FLASH_FONT
351-
style_num_key_pre.text.font = &gb2312_puhui32;
352-
style_num_key_rel.text.font = &gb2312_puhui32;
353-
#else
354-
style_num_key_pre.text.font = LV_FONT_DEFAULT;
355-
style_num_key_rel.text.font = LV_FONT_DEFAULT;
356-
#endif
350+
style_num_key_pre.text.font = TERN(HAS_SPI_FLASH_FONT, &gb2312_puhui32, LV_FONT_DEFAULT);
351+
style_num_key_rel.text.font = TERN(HAS_SPI_FLASH_FONT, &gb2312_puhui32, LV_FONT_DEFAULT);
357352

358353
style_num_key_pre.line.width = 0;
359354
style_num_key_rel.line.width = 0;

Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,7 @@ void tft_lvgl_init() {
192192

193193
systick_attach_callback(SysTick_Callback);
194194

195-
#if HAS_SPI_FLASH_FONT
196-
init_gb2312_font();
197-
#endif
195+
TERN_(HAS_SPI_FLASH_FONT, init_gb2312_font());
198196

199197
tft_style_init();
200198
filament_pin_setup();

Marlin/src/pins/pins.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,8 @@
649649
#include "stm32f4/pins_TH3D_EZBOARD_LITE_V2.h" // STM32F4 env:TH3D_EZBoard_Lite_V2
650650
#elif MB(INDEX_REV03)
651651
#include "stm32f4/pins_INDEX_REV03.h" // STM32F4 env:Index_Mobo_Rev03
652+
#elif MB(MKS_ROBIN_NANO_V1_3_F4)
653+
#include "stm32f4/pins_MKS_ROBIN_NANO_V1_3_F4.h" // STM32F4 env:mks_robin_nano_v1_3_f4
652654

653655
//
654656
// ARM Cortex M7

Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h

Lines changed: 3 additions & 181 deletions
Original file line numberDiff line numberDiff line change
@@ -26,200 +26,22 @@
2626
* https://github.com/makerbase-mks/MKS-Robin-Nano-V1.X/tree/master/hardware
2727
*/
2828

29-
#if NOT_TARGET(STM32F1, STM32F1xx)
30-
#error "Oops! Select an STM32F1 board in 'Tools > Board.'"
31-
#elif HOTENDS > 2 || E_STEPPERS > 2
32-
#error "MKS Robin nano supports up to 2 hotends / E-steppers. Comment out this line to continue."
33-
#endif
29+
#define ALLOW_STM32DUINO
30+
#include "env_validate.h"
3431

3532
#define BOARD_INFO_NAME "MKS Robin Nano"
3633

37-
#define BOARD_NO_NATIVE_USB
38-
39-
// Avoid conflict with TIMER_SERVO when using the STM32 HAL
40-
#define TEMP_TIMER 5
41-
4234
//
4335
// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
4436
//
4537
#define DISABLE_JTAG
4638

47-
//
48-
// EEPROM
49-
//
50-
#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
51-
#define FLASH_EEPROM_EMULATION
52-
#define EEPROM_PAGE_SIZE (0x800U) // 2KB
53-
#define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
54-
#define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB
55-
#endif
56-
57-
#define SPI_DEVICE 2
58-
59-
//
60-
// Servos
61-
//
62-
#define SERVO0_PIN PA8 // Enable BLTOUCH
63-
64-
//
65-
// Limit Switches
66-
//
67-
#define X_STOP_PIN PA15
68-
#define Y_STOP_PIN PA12
69-
#define Z_MIN_PIN PA11
70-
#define Z_MAX_PIN PC4
71-
72-
//
73-
// Steppers
74-
//
75-
#define X_ENABLE_PIN PE4
76-
#define X_STEP_PIN PE3
77-
#define X_DIR_PIN PE2
78-
79-
#define Y_ENABLE_PIN PE1
80-
#define Y_STEP_PIN PE0
81-
#define Y_DIR_PIN PB9
82-
83-
#define Z_ENABLE_PIN PB8
84-
#define Z_STEP_PIN PB5
85-
#define Z_DIR_PIN PB4
86-
87-
#define E0_ENABLE_PIN PB3
88-
#define E0_STEP_PIN PD6
89-
#define E0_DIR_PIN PD3
90-
91-
#define E1_ENABLE_PIN PA3
92-
#define E1_STEP_PIN PA6
93-
#define E1_DIR_PIN PA1
94-
95-
//
96-
// Temperature Sensors
97-
//
98-
#define TEMP_0_PIN PC1 // TH1
99-
#define TEMP_1_PIN PC2 // TH2
100-
#define TEMP_BED_PIN PC0 // TB1
101-
102-
//
103-
// Heaters / Fans
104-
//
105-
#ifndef HEATER_0_PIN
106-
#define HEATER_0_PIN PC3
107-
#endif
108-
#if HOTENDS == 1 && DISABLED(HEATERS_PARALLEL)
109-
#ifndef FAN1_PIN
110-
#define FAN1_PIN PB0
111-
#endif
112-
#else
113-
#ifndef HEATER_1_PIN
114-
#define HEATER_1_PIN PB0
115-
#endif
116-
#endif
117-
#ifndef FAN_PIN
118-
#define FAN_PIN PB1 // FAN
119-
#endif
120-
#ifndef HEATER_BED_PIN
121-
#define HEATER_BED_PIN PA0
122-
#endif
123-
12439
//
12540
// Thermocouples
12641
//
12742
//#define TEMP_0_CS_PIN PE5 // TC1 - CS1
12843
//#define TEMP_0_CS_PIN PE6 // TC2 - CS2
12944

130-
//
131-
// Power Supply Control
132-
//
133-
#if ENABLED(MKS_PWC)
134-
#if ENABLED(TFT_LVGL_UI)
135-
#undef PSU_CONTROL
136-
#undef MKS_PWC
137-
#define SUICIDE_PIN PB2
138-
#define SUICIDE_PIN_STATE LOW
139-
#else
140-
#define PS_ON_PIN PB2 // PW_OFF
141-
#endif
142-
#define KILL_PIN PA2
143-
#define KILL_PIN_STATE HIGH
144-
#endif
145-
146-
//
147-
// Misc. Functions
148-
//
149-
#if HAS_TFT_LVGL_UI
150-
#define MT_DET_1_PIN PA4
151-
#define MT_DET_2_PIN PE6
152-
#define MT_DET_PIN_STATE LOW
153-
154-
#define WIFI_IO0_PIN PC13
155-
#define WIFI_IO1_PIN PC7
156-
#define WIFI_RESET_PIN PA5
157-
#else
158-
//#define POWER_LOSS_PIN PA2 // PW_DET
159-
//#define PS_ON_PIN PB2 // PW_OFF
160-
#define FIL_RUNOUT_PIN PA4
161-
#define FIL_RUNOUT2_PIN PE6
162-
#endif
163-
16445
//#define LED_PIN PB2
16546

166-
//
167-
// SD Card
168-
//
169-
#ifndef SDCARD_CONNECTION
170-
#define SDCARD_CONNECTION ONBOARD
171-
#endif
172-
173-
#define SDIO_SUPPORT
174-
#define SDIO_CLOCK 4500000 // 4.5 MHz
175-
#define SD_DETECT_PIN PD12
176-
#define ONBOARD_SD_CS_PIN PC11
177-
178-
//
179-
// LCD / Controller
180-
//
181-
#define BEEPER_PIN PC5
182-
183-
//
184-
// TFT with FSMC interface
185-
//
186-
#if HAS_FSMC_TFT
187-
/**
188-
* Note: MKS Robin TFT screens use various TFT controllers.
189-
* If the screen stays white, disable 'TFT_RESET_PIN'
190-
* to let the bootloader init the screen.
191-
*/
192-
#define TFT_RESET_PIN PC6 // FSMC_RST
193-
#define TFT_BACKLIGHT_PIN PD13
194-
195-
#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
196-
#define DOGLCD_SCK -1
197-
198-
#define TOUCH_CS_PIN PA7 // SPI2_NSS
199-
#define TOUCH_SCK_PIN PB13 // SPI2_SCK
200-
#define TOUCH_MISO_PIN PB14 // SPI2_MISO
201-
#define TOUCH_MOSI_PIN PB15 // SPI2_MOSI
202-
203-
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
204-
#define FSMC_CS_PIN PD7
205-
#define FSMC_RS_PIN PD11
206-
#define FSMC_DMA_DEV DMA2
207-
#define FSMC_DMA_CHANNEL DMA_CH5
208-
209-
#define TFT_CS_PIN FSMC_CS_PIN
210-
#define TFT_RS_PIN FSMC_RS_PIN
211-
212-
#define TOUCH_BUTTONS_HW_SPI
213-
#define TOUCH_BUTTONS_HW_SPI_DEVICE 2
214-
215-
#define TFT_BUFFER_SIZE 14400
216-
#endif
217-
218-
#define HAS_SPI_FLASH 1
219-
#if HAS_SPI_FLASH
220-
#define SPI_FLASH_SIZE 0x1000000 // 16MB
221-
#define SPI_FLASH_CS_PIN PB12
222-
#define SPI_FLASH_MOSI_PIN PB15
223-
#define SPI_FLASH_MISO_PIN PB14
224-
#define SPI_FLASH_SCK_PIN PB13
225-
#endif
47+
#include "pins_MKS_ROBIN_NANO_common.h"

0 commit comments

Comments
 (0)