From 5d9e1e7f8744e54c5e24aaf22e6ab8c648db539d Mon Sep 17 00:00:00 2001 From: Sergey Date: Wed, 19 Aug 2020 14:33:31 +0300 Subject: [PATCH] =?UTF-8?q?=D0=90=D0=BA=D1=82=D1=83=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8?= =?UTF-8?q?=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 48 +++---------------- Marlin/Configuration_adv.h | 11 ++--- Marlin/src/HAL/STM32/inc/SanityCheck.h | 46 ------------------ Marlin/src/HAL/STM32F1/build_flags.py | 0 Marlin/src/gcode/gcode.cpp | 13 +---- Marlin/src/gcode/queue.cpp | 1 + Marlin/src/gcode/temp/M105.cpp | 3 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 23 +++++++++ platformio.ini | 1 + 9 files changed, 38 insertions(+), 108 deletions(-) mode change 100644 => 100755 Marlin/src/HAL/STM32F1/build_flags.py diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index f3d1bdd8e9..8f6eb0db88 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -74,7 +74,6 @@ #define STRING_CONFIG_H_AUTHOR "(Sergey, FlyingbearGhost4S)" // Who made the changes. //#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) - /** * *** VENDORS PLEASE READ *** * @@ -486,13 +485,8 @@ #if ENABLED(PIDTEMP) #define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of PROGMEM) #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of PROGMEM) - //#define PID_DEBUG // Sends debug data to the serial port. Use 'M303 D' to toggle activation. - //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX - //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) // Set/get with gcode: M301 E[extruder number, 0-2] - //#define PID_FUNCTIONAL_RANGE 15 // If the temperature difference between the target temperature and the actual temperature - // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it @@ -765,7 +759,7 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2...]] */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 400 } +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 421 } /** * Default Max Feed Rate (mm/s) @@ -1072,7 +1066,7 @@ */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing #if ENABLED(PROBING_HEATERS_OFF) - #define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) + //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) #endif //#define PROBING_FANS_OFF // Turn fans off when probing //#define PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing @@ -1346,7 +1340,7 @@ //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 20 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1362,7 +1356,7 @@ //=================================== Mesh ================================== //=========================================================================== - #define MESH_INSET 20 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1421,8 +1415,8 @@ #define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT X_CENTER // X point for Z homing - #define Z_SAFE_HOMING_Y_POINT Y_CENTER // Y point for Z homing + #define Z_SAFE_HOMING_X_POINT (0) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT (0) // Y point for Z homing when homing all axes (G28). #endif // Homing speeds (mm/m) @@ -2230,36 +2224,6 @@ EEPROM_W25Q #define FSMC_UPSCALE 3 //3x upscaler for 480x320 displays #endif // -// TFT LVGL UI -// -// Using default MKS icons and fonts from: https://git.io/JJvzK -// Just copy the 'assets' folder from the build directory to the -// root of your SD card, together with the compiled firmware. -// -//#define TFT_LVGL_UI_FSMC // Robin nano v1.2 uses FSMC -//#define TFT_LVGL_UI_SPI // Robin nano v2.0 uses SPI - -// -// Anycubic Mega TFT (AI3M) -// -//#define ANYCUBIC_TFT_MODEL -//#define ANYCUBIC_TFT_DEBUG - -// -// TFT LVGL UI -// -// Using default MKS icons and fonts from: https://git.io/JJvzK -// Just copy the 'assets' folder from the build directory to the -// root of your SD card, together with the compiled firmware. -// -//#define TFT_LVGL_UI_FSMC // Robin nano v1.2 uses FSMC -//#define TFT_LVGL_UI_SPI // Robin nano v2.0 uses SPI - -// -// Anycubic Mega TFT (AI3M) -// -//#define ANYCUBIC_TFT_MODEL -//#define ANYCUBIC_TFT_DEBUG // // TFT LVGL UI diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 75ebb7722a..635b867e4a 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1150,8 +1150,8 @@ #define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500) //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss //#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS) - #define POWER_LOSS_PIN PWR_DET_PIN // Pin to detect power loss. Set to -1 to disable default pin on boards without module. - #define POWER_LOSS_STATE LOW // State of pin indicating power loss + //#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module. + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss //#define POWER_LOSS_PULL // Set pullup / pulldown as appropriate //#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume //#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power. @@ -2406,8 +2406,7 @@ */ #define STEALTHCHOP_XY #define STEALTHCHOP_Z - // @efim-a-efim: Vendor recommends disabling stealthchop on extruder - // #define STEALTHCHOP_E + #define STEALTHCHOP_E /** * Optimize spreadCycle chopper parameters by using predefined parameter sets @@ -2437,7 +2436,7 @@ * M912 - Clear stepper driver overtemperature pre-warn condition flag. * M122 - Report driver parameters (Requires TMC_DEBUG) */ - //#define MONITOR_DRIVER_STATUS + #define MONITOR_DRIVER_STATUS #if ENABLED(MONITOR_DRIVER_STATUS) #define CURRENT_STEP_DOWN 50 // [mA] @@ -2532,7 +2531,7 @@ * Enable M122 debugging command for TMC stepper drivers. * M122 S0/1 will enable continous reporting. */ - //#define TMC_DEBUG + #define TMC_DEBUG /** * You can set your own advanced settings by filling in predefined functions. diff --git a/Marlin/src/HAL/STM32/inc/SanityCheck.h b/Marlin/src/HAL/STM32/inc/SanityCheck.h index f6f0ecb814..30d0750d90 100644 --- a/Marlin/src/HAL/STM32/inc/SanityCheck.h +++ b/Marlin/src/HAL/STM32/inc/SanityCheck.h @@ -54,49 +54,3 @@ #elif ENABLED(SERIAL_STATS_DROPPED_RX) #error "SERIAL_STATS_DROPPED_RX is not supported on this platform." #endif - -#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT) - #undef SDCARD_EEPROM_EMULATION // Avoid additional error noise - #if USE_FALLBACK_EEPROM - #warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION." - #endif - #error "SDCARD_EEPROM_EMULATION requires SDSUPPORT. Enable SDSUPPORT or choose another EEPROM emulation." -#endif - -#if defined(STM32F4xx) && BOTH(PRINTCOUNTER, FLASH_EEPROM_EMULATION) - #warning "FLASH_EEPROM_EMULATION may cause long delays when writing and should not be used while printing." - #error "Disable PRINTCOUNTER or choose another EEPROM emulation." -#endif - -#if !defined(STM32F4xx) && ENABLED(FLASH_EEPROM_LEVELING) - #error "FLASH_EEPROM_LEVELING is currently only supported on STM32F4 hardware." -#endif - -#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - #error "SERIAL_STATS_MAX_RX_QUEUED is not supported on this platform." -#elif ENABLED(SERIAL_STATS_DROPPED_RX) - #error "SERIAL_STATS_DROPPED_RX is not supported on this platform." -#endif - -#if ENABLED(SDCARD_EEPROM_EMULATION) && DISABLED(SDSUPPORT) - #undef SDCARD_EEPROM_EMULATION // Avoid additional error noise - #if USE_FALLBACK_EEPROM - #warning "EEPROM type not specified. Fallback is SDCARD_EEPROM_EMULATION." - #endif - #error "SDCARD_EEPROM_EMULATION requires SDSUPPORT. Enable SDSUPPORT or choose another EEPROM emulation." -#endif - -#if defined(STM32F4xx) && BOTH(PRINTCOUNTER, FLASH_EEPROM_EMULATION) - #warning "FLASH_EEPROM_EMULATION may cause long delays when writing and should not be used while printing." - #error "Disable PRINTCOUNTER or choose another EEPROM emulation." -#endif - -#if !defined(STM32F4xx) && ENABLED(FLASH_EEPROM_LEVELING) - #error "FLASH_EEPROM_LEVELING is currently only supported on STM32F4 hardware." -#endif - -#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) - #error "SERIAL_STATS_MAX_RX_QUEUED is not supported on this platform." -#elif ENABLED(SERIAL_STATS_DROPPED_RX) - #error "SERIAL_STATS_DROPPED_RX is not supported on this platform." -#endif diff --git a/Marlin/src/HAL/STM32F1/build_flags.py b/Marlin/src/HAL/STM32F1/build_flags.py old mode 100644 new mode 100755 diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 1060058fa3..1617e4eb98 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -444,18 +444,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 24: M24(); break; // M24: Start SD print case 25: M25(); break; // M25: Pause SD print case 26: M26(); break; // M26: Set SD index - case 27: - // #if ENABLED(MKS_WIFI) - // if(!serial_port_index){ - M27(); - // }else{ - // mks_m27(); - // return; - // } - // #else - // M27(); - // #endif - break; // M27: Get SD status + case 27: M27(); break; // M27: Get SD status case 28: M28(); break; // M28: Start SD write case 29: M29(); break; // M29: Stop SD write case 30: diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index f5164022e1..aa20951cca 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -466,6 +466,7 @@ void GCodeQueue::get_serial_commands() { #endif if (ISEOL(serial_char)) { + // Reset our state, continue if the line was empty if (process_line_done(serial_input_state[i], serial_line_buffer[i], serial_count[i])) continue; diff --git a/Marlin/src/gcode/temp/M105.cpp b/Marlin/src/gcode/temp/M105.cpp index 72ffbcac43..eefc3ae9f1 100644 --- a/Marlin/src/gcode/temp/M105.cpp +++ b/Marlin/src/gcode/temp/M105.cpp @@ -31,9 +31,8 @@ void GcodeSuite::M105() { const int8_t target_extruder = get_target_extruder_from_command(); if (target_extruder < 0) return; - SERIAL_ECHOPGM(STR_OK); - + #if HAS_TEMP_SENSOR thermalManager.print_heater_states(target_extruder diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 5b172a6412..23485ee098 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -181,3 +181,26 @@ BlTouch #define W25QXX_SCK_PIN PB13 #endif +#if HAS_TMC220x + /** + * TMC2208/TMC2209 stepper drivers + */ + // + // Software serial + // + // #define X_SERIAL_TX_PIN PC7 + // #define X_SERIAL_RX_PIN PC7 + + // #define Y_SERIAL_TX_PIN PD2 + // #define Y_SERIAL_RX_PIN PD2 + + // #define Z_SERIAL_TX_PIN PC12 + // #define Z_SERIAL_RX_PIN PC12 + + #define E0_SERIAL_TX_PIN PA6 + #define E0_SERIAL_RX_PIN PA6 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + diff --git a/platformio.ini b/platformio.ini index 5d5ef84074..9a33a84713 100644 --- a/platformio.ini +++ b/platformio.ini @@ -630,6 +630,7 @@ extra_scripts = ${common.extra_scripts} [env:trigorilla_pro] platform = ${common_stm32f1.platform} extends = env:mks_robin +extra_scripts = ${common.extra_scripts} # # MKS Robin E3D (STM32F103RCT6) and