Compare commits

...

17 Commits

Author SHA1 Message Date
Sergey f837488a4f Merge branch 'vanilla_fb_2.0.x' into MKS_UI 2 years ago
Sergey 7f034eb376 enable EMERGENCY_PARSER 2 years ago
Sergey e91fd74c34 Merge branch 'vanilla_fb_2.0.x' into MKS_UI 2 years ago
Sergey 4fd8ccae20 Merge branch 'vanilla_fb_2.0.x' into MKS_UI 2 years ago
Sergey 8329d49b54 Update from 2.0.x 2 years ago
Sergey a9641c6400 Squashed commit of the following: 2 years ago
Sergey 826c01cf96 fix E0 for Nano1.3 2 years ago
Sergey af2e90d364 merge 2.0.x 2 years ago
Sergey 89341581b1 fix 2 years ago
Sergey beae78bf2f Nano-s external driver direction 2 years ago
Sergey d0b633219d EXT_EXTRUDER_DRIVER 2 years ago
Sergey f54767ec21 resize buffers 2 years ago
Sergey 0cb3416d16 readme 2 years ago
Sergey 71bc11fce4 Enable touch 2 years ago
Sergey 85567b3f15 Driver dir config 2 years ago
Sergey cb4ada6343 driver configuration 2 years ago
Sergey 31bc558235 MKS UI fix 2 years ago
  1. 53
      Marlin/Configuration.h
  2. 8
      Marlin/Configuration_adv.h
  3. 15
      Marlin/src/gcode/calibrate/G28.cpp
  4. 4
      Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp
  5. 4
      Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h
  6. 2
      Marlin/src/lcd/extui/mks_ui/wifi_module.h
  7. 4
      Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h
  8. 2
      Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h
  9. 20
      Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V1_3_F4.h
  10. 4
      README.md
  11. 1
      platformio.ini

53
Marlin/Configuration.h

@ -128,8 +128,8 @@
* Currently Ethernet (-2) is only supported on Teensy 4.1 boards.
* :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7]
*/
#define SERIAL_PORT_2 1
#define BAUDRATE_2 115200 // Enable to override BAUDRATE
//#define SERIAL_PORT_2 1
//#define BAUDRATE_2 115200 // Enable to override BAUDRATE
/**
* Select a third serial port on the board to use for communication with the host.
@ -1328,10 +1328,28 @@
// @section machine
/**************** Driver DIR Configuration *******************/
//Robin Nano v1.1 and v1.2 configs:
// 4 x TMC 2208/2209
#define ALL_DRV_2208
// 4 x A4988
//#define FB_4S_STOCK
// 2 x A4988, 2 x TMC 2208/2209
//#define FB_5_STOCK
//Robin Nano v1.3 and Robin Nano-S v1.3:
//Robin Nano-S v1.3
//#define FB_5_NANO_S_V1_3
//Robin Nano v1.3 with 4 x TMC 2208/2209
//#define FB_5_NANO_V1_3_4TMC
//Robin Nano v1.3 with 2x A4988 and 2 x TMC 2208/2209
//#define FB_5_NANO_V1_3
#ifdef ALL_DRV_2208
#define USR_E0_DIR true
#define USR_X_DIR false
@ -1347,19 +1365,36 @@
#endif
#ifdef FB_5_STOCK
#if MOTHERBOARD == BOARD_MKS_ROBIN_NANO_S_V13
#define USR_E0_DIR false
#define USR_X_DIR false
#define USR_Y_DIR false
#define USR_Z_DIR false
#endif
#ifdef FB_5_NANO_S_V1_3
#ifdef EXT_EXTRUDER_DRIVER
#define USR_E0_DIR true
#else
#define USR_E0_DIR false
#endif
#define USR_X_DIR true
#define USR_Y_DIR true
#define USR_Z_DIR false
#else
#endif
#ifdef FB_5_NANO_V1_3
#define USR_E0_DIR false
#define USR_X_DIR false
#define USR_Y_DIR false
#define USR_Z_DIR false
#endif
#endif
#ifdef FB_5_NANO_V1_3_4TMC
#define USR_E0_DIR true
#define USR_X_DIR false
#define USR_Y_DIR false
#define USR_Z_DIR true
#endif
// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
#define INVERT_X_DIR USR_X_DIR
@ -1475,7 +1510,7 @@
* RAMPS-based boards use SERVO3_PIN for the first runout sensor.
* For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc.
*/
#define FILAMENT_RUNOUT_SENSOR
//#define FILAMENT_RUNOUT_SENSOR
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define FIL_RUNOUT_ENABLED_DEFAULT false // Enable the sensor on startup. Override with M412 followed by M500.
#define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
@ -1708,7 +1743,7 @@
* Add a bed leveling sub-menu for ABL or MBL.
* Include a guided procedure if manual probing is enabled.
*/
#define LCD_BED_LEVELING
//#define LCD_BED_LEVELING
#if ENABLED(LCD_BED_LEVELING)
#define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis.
@ -2792,8 +2827,8 @@
* root of your SD card, together with the compiled firmware.
*/
//#define TFT_CLASSIC_UI
#define TFT_COLOR_UI
//#define TFT_LVGL_UI
//#define TFT_COLOR_UI
#define TFT_LVGL_UI
#if ENABLED(TFT_LVGL_UI)
#define MKS_WIFI_MODULE // MKS WiFi module

8
Marlin/Configuration_adv.h

@ -2266,13 +2266,13 @@
// For debug-echo: 128 bytes for the optimal speed.
// Other output doesn't need to be that speedy.
// :[0, 2, 4, 8, 16, 32, 64, 128, 256]
#define TX_BUFFER_SIZE 64
#define TX_BUFFER_SIZE 32
// Host Receive Buffer Size
// Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough.
// To use flow control, set this buffer size to at least 1024 bytes.
// :[0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048]
#define RX_BUFFER_SIZE 512
#define RX_BUFFER_SIZE 32
#if RX_BUFFER_SIZE >= 1024
// Enable to have the controller send XON/XOFF control characters to
@ -2304,7 +2304,7 @@
* Currently handles M108, M112, M410, M876
* NOTE: Not yet implemented for all platforms.
*/
//#define EMERGENCY_PARSER
#define EMERGENCY_PARSER
/**
* Realtime Reporting (requires EMERGENCY_PARSER)
@ -2482,7 +2482,7 @@
*
* Enable PARK_HEAD_ON_PAUSE to add the G-code M125 Pause and Park.
*/
#define ADVANCED_PAUSE_FEATURE
//#define ADVANCED_PAUSE_FEATURE
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#define PAUSE_PARK_RETRACT_FEEDRATE 35 // (mm/s) Initial retract feedrate.
#define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract.

15
Marlin/src/gcode/calibrate/G28.cpp

@ -305,6 +305,21 @@ void GcodeSuite::G28() {
stepperK.rms_current(K_CURRENT_HOME);
if (DEBUGGING(LEVELING)) debug_current(F(STR_K), tmc_save_current_K, K_CURRENT_HOME);
#endif
#if HAS_CURRENT_HOME(I)
const int16_t tmc_save_current_I = stepperI.getMilliamps();
stepperI.rms_current(I_CURRENT_HOME);
if (DEBUGGING(LEVELING)) debug_current(F(AXIS4_STR), tmc_save_current_I, I_CURRENT_HOME);
#endif
#if HAS_CURRENT_HOME(J)
const int16_t tmc_save_current_J = stepperJ.getMilliamps();
stepperJ.rms_current(J_CURRENT_HOME);
if (DEBUGGING(LEVELING)) debug_current(F(AXIS5_STR), tmc_save_current_J, J_CURRENT_HOME);
#endif
#if HAS_CURRENT_HOME(K)
const int16_t tmc_save_current_K = stepperK.getMilliamps();
stepperK.rms_current(K_CURRENT_HOME);
if (DEBUGGING(LEVELING)) debug_current(F(AXIS6_STR), tmc_save_current_K, K_CURRENT_HOME);
#endif
#if HAS_CURRENT_HOME(Z) && ENABLED(DELTA)
const int16_t tmc_save_current_Z = stepperZ.getMilliamps();
stepperZ.rms_current(Z_CURRENT_HOME);

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

@ -84,7 +84,7 @@ lv_group_t* g;
uint16_t DeviceCode = 0x9488;
extern uint8_t sel_id;
uint8_t bmp_public_buf[14 * 1024];
uint8_t bmp_public_buf[BUF_SIZE_KB * 1024];
uint8_t public_buf[513];
extern bool flash_preview_begin, default_preview_flg, gcode_preview_over;
@ -143,7 +143,7 @@ void tft_lvgl_init() {
lv_init();
lv_disp_buf_init(&disp_buf, bmp_public_buf, nullptr, LV_HOR_RES_MAX * 14); // Initialize the display buffer
lv_disp_buf_init(&disp_buf, bmp_public_buf, nullptr, (BUF_SIZE_KB*1024)/2); // Initialize the display buffer
lv_disp_drv_t disp_drv; // Descriptor of a display driver
lv_disp_drv_init(&disp_drv); // Basic initialization

4
Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h

@ -31,10 +31,10 @@
#endif
#include <lvgl.h>
#include "../../../pins/pins.h"
//#define TFT_ROTATION TFT_ROTATE_180
extern uint8_t bmp_public_buf[14 * 1024];
extern uint8_t bmp_public_buf[BUF_SIZE_KB * 1024];
extern uint8_t public_buf[513];
void tft_lvgl_init();

2
Marlin/src/lcd/extui/mks_ui/wifi_module.h

@ -61,7 +61,7 @@ typedef enum {
udisk_buf_full,
} UDISK_DATA_BUFFER_STATE;
#define TRANS_RCV_FIFO_BLOCK_NUM 14
#define TRANS_RCV_FIFO_BLOCK_NUM BUF_SIZE_KB
typedef struct {
bool receiveEspData;

4
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h

@ -46,6 +46,10 @@
#include "pins_MKS_ROBIN_NANO_common.h"
#if HAS_TFT_LVGL_UI
#define BUF_SIZE_KB 12
#endif
#if HAS_TFT_LVGL_UI && FAN1_PIN != PB0 && HEATER_1_PIN != PB0
#define BOARD_INIT OUT_WRITE(PB0, LOW)
#endif

2
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h

@ -196,7 +196,7 @@
#define TOUCH_BUTTONS_HW_SPI
#define TOUCH_BUTTONS_HW_SPI_DEVICE 2
#define TFT_BUFFER_SIZE 14400
#define TFT_BUFFER_SIZE 20*480
#endif
#define HAS_SPI_FLASH 1

20
Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V1_3_F4.h

@ -43,3 +43,23 @@
#define LED_PIN PB1
#include "../stm32f1/pins_MKS_ROBIN_NANO_common.h"
#if HAS_TFT_LVGL_UI
#define BUF_SIZE_KB 14
#endif
// Если нужен сменный драйвер в слоте второго экструдера как основной экструдер, нужно раскоментировать этот параметр
//#define EXT_EXTRUDER_DRIVER
#ifdef EXT_EXTRUDER_DRIVER
#undef E1_ENABLE_PIN
#undef E1_STEP_PIN
#undef E1_DIR_PIN
#undef E0_ENABLE_PIN
#undef E0_STEP_PIN
#undef E0_DIR_PIN
#define E0_ENABLE_PIN PA3
#define E0_STEP_PIN PA6
#define E0_DIR_PIN PA1
#endif

4
README.md

@ -2,6 +2,8 @@
Это конфигурация [официального Marlin](https://github.com/MarlinFirmware/Marlin) для принтера Flying Bear Ghost 4S и 5. На данный момент поддерживаются платы MKS Robin Nano 1.x, MKS Robin Nano v2, MKS Robin Nano-s v1.3, MKS Robin Nano v1.3
![MKS UI](https://github.com/makerbase-mks/Mks-Robin-Nano-Marlin2.0-Firmware/blob/master/Images/MKS_Robin_Nano_printing.png)
В данном репозитории есть несколько веток:
* [FB4S_WIFI](https://github.com/Sergey1560/Marlin_FB4S/tree/FB4S_WIFI) - основная ветка. Эта ветка содержит дополнительный код для работы с модулем [MKS WIFI](https://github.com/makerbase-mks/MKS-WIFI), установленным в FB4S и FB5. Загрузка файлов через стандартный plugin в Cura. Классический интерфейс Color UI.
@ -12,7 +14,7 @@
## MKS WIFI модуль
В данной ветке WIFI модуль не работает.
В данной ветке WIFI модуль работает.
### Варианты прошивки

1
platformio.ini

@ -14,6 +14,7 @@
src_dir = Marlin
boards_dir = buildroot/share/PlatformIO/boards
default_envs = mks_robin_nano35
#default_envs = mks_robin_nano_v1_3_f4
include_dir = Marlin
extra_configs =
ini/avr.ini

Loading…
Cancel
Save