Skip to content

Instantly share code, notes, and snippets.

@ckuethe
Created October 1, 2021 04:20
Show Gist options
  • Save ckuethe/62e6b51ab6a359fedda8ab631ddafa8e to your computer and use it in GitHub Desktop.
Save ckuethe/62e6b51ab6a359fedda8ab631ddafa8e to your computer and use it in GitHub Desktop.
Marlin 2.0.7.2 config changes to make the BTT SKR E3 DIP work with TMC2130 drivers and BLTourch.
Finally spent a while getting Marlin 2.0.7.2 compiled with all the bits the way I want.
Changes:
* Enable TMC2130
- Explicitly set the pins for TMC_USE_SW_SPI because pins.h wasn't doing it for me
- Enabled all the TMC2130 debug and status
* Enabled arc and bezier curves so I can use arcwelder
* BLTouch support
- Disable Z-Endstop as Z Probe, use PC14 (the dedicated bltouch port)
* Auto Bed Leveling (UBL)
- Restore leveling after homing
- Z-Safe homing
Neat trick for finding at least the X and Y offsets of BLTouch-to-nozzle:
* power off printer
* physically push the steppers to (0,0,0) ... the endstops
* power on printer
* raise Z axis to 30mm
* deploy bltouch
* carefuly move the axes around until the tip of the bltouch is pointing right at the corner of the build surface
* observe the X and Y positions on your display.
* raise Z axis to ...
diff --git a/Firmware/Marlin-2.0.7.2-SKR-E3-DIP/Marlin/Configuration.h b/Firmware/Marlin-2.0.7.2-SKR-E3-DIP/Marlin/Configuration.h
index 3d3ee0d..f1314fa 100644
--- a/Firmware/Marlin-2.0.7.2-SKR-E3-DIP/Marlin/Configuration.h
+++ b/Firmware/Marlin-2.0.7.2-SKR-E3-DIP/Marlin/Configuration.h
@@ -72,7 +72,7 @@
// @section info
// Author info of this build printed to the host during boot and M115
-#define STRING_CONFIG_H_AUTHOR "(BIGTREETECH, SKR-E3-DIP)" // Who made the changes.
+#define STRING_CONFIG_H_AUTHOR "(BIGTREE+ckuethe, SKR-E3-DIP)" // Who made the changes.
//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes)
/**
@@ -122,7 +122,7 @@
*
* :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000]
*/
-#define BAUDRATE 115200
+#define BAUDRATE 250000
// Enable the Bluetooth serial interface on AT90USB devices
//#define BLUETOOTH
@@ -133,7 +133,7 @@
#endif
// Name displayed in the LCD "Ready" message and Info menu
-#define CUSTOM_MACHINE_NAME "Ender-3"
+#define CUSTOM_MACHINE_NAME "Ender-3-ckuethe"
// Printer's unique ID, used by some programs to differentiate between machines.
// Choose your own or use a service like https://www.uuidgenerator.net/version4
@@ -683,15 +683,15 @@
* TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
* :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
*/
-//#define X_DRIVER_TYPE TMC2208
-//#define Y_DRIVER_TYPE TMC2208
-//#define Z_DRIVER_TYPE TMC2208
+#define X_DRIVER_TYPE TMC2130
+#define Y_DRIVER_TYPE TMC2130
+#define Z_DRIVER_TYPE TMC2130
//#define X2_DRIVER_TYPE A4988
//#define Y2_DRIVER_TYPE A4988
//#define Z2_DRIVER_TYPE A4988
//#define Z3_DRIVER_TYPE A4988
//#define Z4_DRIVER_TYPE A4988
-//#define E0_DRIVER_TYPE TMC2208
+#define E0_DRIVER_TYPE TMC2130
//#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988
//#define E3_DRIVER_TYPE A4988
@@ -846,10 +846,10 @@
* The probe replaces the Z-MIN endstop and is used for Z homing.
* (Automatically enables USE_PROBE_FOR_Z_HOMING.)
*/
-#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
+//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
// Force the use of the probe for Z-axis homing
-//#define USE_PROBE_FOR_Z_HOMING
+#define USE_PROBE_FOR_Z_HOMING
/**
* Z_MIN_PROBE_PIN
@@ -866,7 +866,7 @@
* - normally-closed switches to GND and D32.
* - normally-open switches to 5V and D32.
*/
-//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default
+#define Z_MIN_PROBE_PIN PC14
/**
* Probe Type
@@ -904,7 +904,7 @@
/**
* The BLTouch probe uses a Hall effect sensor and emulates a servo.
*/
-//#define BLTOUCH
+#define BLTOUCH
/**
* Pressure sensor with a BLTouch-like interface
@@ -991,7 +991,7 @@
* | [-] |
* O-- FRONT --+
*/
-#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
+#define NOZZLE_TO_PROBE_OFFSET { -40, -13, -2 }
// Most probes should stay away from the edges of the bed, but
// with NOZZLE_AS_PROBE this can be negative for a wider probing area.
@@ -1240,14 +1240,14 @@
//#define AUTO_BED_LEVELING_3POINT
//#define AUTO_BED_LEVELING_LINEAR
//#define AUTO_BED_LEVELING_BILINEAR
-//#define AUTO_BED_LEVELING_UBL
-#define MESH_BED_LEVELING
+#define AUTO_BED_LEVELING_UBL
+//#define MESH_BED_LEVELING
/**
* Normally G28 leaves leveling disabled on completion. Enable
* this option to have G28 restore the prior leveling state.
*/
-//#define RESTORE_LEVELING_AFTER_G28
+#define RESTORE_LEVELING_AFTER_G28
/**
* Enable detailed logging of G28, G29, M48, etc.
@@ -1390,7 +1390,7 @@
// - Move the Z probe (or nozzle) to a defined XY point before Z Homing.
// - Prevent Z homing when the Z probe is outside bed area.
//
-//#define Z_SAFE_HOMING
+#define Z_SAFE_HOMING
#if ENABLED(Z_SAFE_HOMING)
#define Z_SAFE_HOMING_X_POINT X_CENTER // X point for Z homing
diff --git a/Firmware/Marlin-2.0.7.2-SKR-E3-DIP/Marlin/Configuration_adv.h b/Firmware/Marlin-2.0.7.2-SKR-E3-DIP/Marlin/Configuration_adv.h
index 3a4fe58..d4e49d3 100644
--- a/Firmware/Marlin-2.0.7.2-SKR-E3-DIP/Marlin/Configuration_adv.h
+++ b/Firmware/Marlin-2.0.7.2-SKR-E3-DIP/Marlin/Configuration_adv.h
@@ -524,7 +524,7 @@
// If you want endstops to stay on (by default) even when not homing
// enable this option. Override at any time with M120, M121.
-//#define ENDSTOPS_ALWAYS_ON_DEFAULT
+#define ENDSTOPS_ALWAYS_ON_DEFAULT
// @section extras
@@ -653,7 +653,7 @@
* the position of the toolhead relative to the workspace.
*/
-//#define SENSORLESS_BACKOFF_MM { 2, 2 } // (mm) Backoff from endstops before sensorless homing
+#define SENSORLESS_BACKOFF_MM { 2, 2 } // (mm) Backoff from endstops before sensorless homing
#define HOMING_BUMP_MM { 5, 5, 2 } // (mm) Backoff from endstops after first bump
#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)
@@ -1796,7 +1796,7 @@
//
// G2/G3 Arc Support
//
-//#define ARC_SUPPORT // Disable this feature to save ~3226 bytes
+#define ARC_SUPPORT // Disable this feature to save ~3226 bytes
#if ENABLED(ARC_SUPPORT)
#define MM_PER_ARC_SEGMENT 1 // (mm) Length (or minimum length) of each arc segment
//#define ARC_SEGMENTS_PER_R 1 // Max segment length, MM_PER = Min
@@ -1809,7 +1809,7 @@
#endif
// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes.
-//#define BEZIER_CURVE_SUPPORT
+#define BEZIER_CURVE_SUPPORT
/**
* Direct Stepping
@@ -2413,10 +2413,10 @@
* The default SW SPI pins are defined the respective pins files,
* but you can override or define them here.
*/
- //#define TMC_USE_SW_SPI
- //#define TMC_SW_MOSI -1
- //#define TMC_SW_MISO -1
- //#define TMC_SW_SCK -1
+#define TMC_USE_SW_SPI
+#define TMC_SW_MOSI PB5
+#define TMC_SW_MISO PB4
+#define TMC_SW_SCK PB3
/**
* Four TMC2209 drivers can use the same HW/SW serial port with hardware configured addresses.
@@ -2492,7 +2492,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]
@@ -2551,20 +2551,20 @@
*
* Comment *_STALL_SENSITIVITY to disable sensorless homing for that axis.
*/
- //#define SENSORLESS_HOMING // StallGuard capable drivers only
+ //#define SENSORLESS_HOMING // StallGuard capable drivers only
#if EITHER(SENSORLESS_HOMING, SENSORLESS_PROBING)
// TMC2209: 0...255. TMC2130: -64...63
- #define X_STALL_SENSITIVITY 8
+ #define X_STALL_SENSITIVITY -16
#define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY
- #define Y_STALL_SENSITIVITY 8
+ #define Y_STALL_SENSITIVITY -16
#define Y2_STALL_SENSITIVITY Y_STALL_SENSITIVITY
- //#define Z_STALL_SENSITIVITY 8
+ #define Z_STALL_SENSITIVITY -16
//#define Z2_STALL_SENSITIVITY Z_STALL_SENSITIVITY
//#define Z3_STALL_SENSITIVITY Z_STALL_SENSITIVITY
//#define Z4_STALL_SENSITIVITY Z_STALL_SENSITIVITY
- //#define SPI_ENDSTOPS // TMC2130 only
- //#define IMPROVE_HOMING_RELIABILITY
+ //#define SPI_ENDSTOPS // TMC2130 only
+ #define IMPROVE_HOMING_RELIABILITY
#endif
/**
@@ -2589,7 +2589,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/Firmware/Marlin-2.0.7.2-SKR-E3-DIP/platformio.ini b/Firmware/Marlin-2.0.7.2-SKR-E3-DIP/platformio.ini
index 627a458..c421fe1 100644
--- a/Firmware/Marlin-2.0.7.2-SKR-E3-DIP/platformio.ini
+++ b/Firmware/Marlin-2.0.7.2-SKR-E3-DIP/platformio.ini
@@ -18,7 +18,8 @@
[platformio]
src_dir = Marlin
boards_dir = buildroot/share/PlatformIO/boards
-default_envs = STM32F103RC_btt
+# Doesn't seem to be a _512K variant
+default_envs = STM32F103RE_btt
include_dir = Marlin
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment