Skip to content

TMC2209 on SKR E3 Turbo report incompatible driver #13

Description

@dzervas

I'm trying to get E3 Turbo to work, which has soldered TMC2209s but after writing a map and setting TRINAMIC_ENABLE 2209 I get via serial:

error:7
grblHAL: incompatible driver

The weird thing is that for a moment it worked but somehow didn't compile the trinamic code (no $338 setting available).

src/my_machine.h

/*
  my_machine.h - configuration for NXP LPC176x ARM processors

  Part of grblHAL

  Copyright (c) 2020-2021 Terje Io

  Grbl is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  Grbl is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
*/

// NOTE: Only one board may be enabled!
// If none is enabled pin mappings from generic_map.h will be used
//#define SMOOTHIEBOARD
//#define BOARD_RAMPS_16
//#define BOARD_BTT_SKR_13
//#define BOARD_BTT_SKR_14_TURBO
#define BOARD_BTT_SKR_E3_TURBO
//#define BOARD_MKS_SBASE_13
//#define BOARD_MY_MACHINE // Add my_machine_map.h before enabling this!

// Configuration
// Uncomment to enable, for some a value > 1 may be assigned, if so the default value is shown.

#define USB_SERIAL_CDC     1 // Comment out to use UART communication.
#define SDCARD_ENABLE      1 // Run gcode programs from SD card, requires sdcard plugin.
//#define TRINAMIC_ENABLE 2209 // Uncomment to enable Trinamic TMC2130 driver support. NOTE: Experimental for now, currently for SKR 1.x boards only
//#define TRINAMIC_ENABLE 2130 // Uncomment to enable Trinamic TMC2130 driver support. NOTE: Experimental for now, currently for SKR 1.x boards only
//#define TRINAMIC_ENABLE 5160 // Uncomment to enable Trinamic TMC5160 driver support. NOTE: Experimental for now, currently for SKR 1.x boards only
//#define LIMIT_MAX_ENABLE   1 // Uncomment to enable max limit input pins (when available)
#define EEPROM_ENABLE      1 // I2C EEPROM support. Set to 1 for 24LC16(2K), 2 (64 byte pages) or 3 (32 byte pages) for larger sizes. Requires eeprom plugin.
//#define EEPROM_IS_FRAM     1 // Uncomment when EEPROM is enabled and chip is FRAM, this to remove write delay.

// If the selected board map supports more than three motors ganging and/or auto-squaring
// of axes can be enabled here.
#define X_GANGED            1
#define X_AUTO_SQUARE       1
#define Y_GANGED            1
#define Y_AUTO_SQUARE       1
//#define Z_GANGED            1
//#define Z_AUTO_SQUARE       1
// For ganged axes the limit switch input (if available) can be configured to act as a max travel limit switch.
// NOTE: If board map already has max limit inputs defined this configuration will be ignored.
//#define X_GANGED_LIM_MAX    1
//#define Y_GANGED_LIM_MAX    1
//#define Z_GANGED_LIM_MAX    1

/*EOF*/
/*
  btt_skr_1.4_turbo_map.h - driver code for LPC176x processor, pin mappings compatible with BTT SKR v1.4 Turbo board

  Part of grblHAL

  Copyright (c) 2020-2021 Terje Io

  Grbl is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  Grbl is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
*/

// NOTE:
// P0.27, P0.28 are dedicated I2C pins without pull up/down.
// P0.29, P0.30 must have same direction as used for USB operation.

#if N_ABC_MOTORS > 2
#error "Axis configuration is not supported!"
#endif

#define BOARD_NAME "BTT SKR E3 Turbo"

#if TRINAMIC_ENABLE == 2130 || TRINAMIC_ENABLE == 5160 //|| TRINAMIC_ENABLE == 2209
#define HAS_BOARD_INIT
void board_init (void);
#endif

//#if EEPROM_ENABLE
//#error "This board cannot be used with current EEPROM code!"
//#endif

// Define step pulse output pins.
#define X_STEP_PN               1
#define X_STEP_PORT             port(X_STEP_PN)
#define X_STEP_PIN              4
#define Y_STEP_PN               1
#define Y_STEP_PORT             port(Y_STEP_PN)
#define Y_STEP_PIN              14
#define Z_STEP_PN               4
#define Z_STEP_PORT             port(Z_STEP_PN)
#define Z_STEP_PIN              29
#define STEP_OUTMODE            GPIO_BITBAND

// Define step direction output pins.
#define X_DIRECTION_PN          1
#define X_DIRECTION_PORT        port(X_DIRECTION_PN)
#define X_DIRECTION_PIN         8
#define Y_DIRECTION_PN          1
#define Y_DIRECTION_PORT        port(Y_DIRECTION_PN)
#define Y_DIRECTION_PIN         15
#define Z_DIRECTION_PN          4
#define Z_DIRECTION_PORT        port(Z_DIRECTION_PN)
#define Z_DIRECTION_PIN         28
#define DIRECTION_OUTMODE       GPIO_BITBAND

// Define stepper driver enable/disable output pin(s).
#define X_ENABLE_PN             1
#define X_ENABLE_PORT           port(X_ENABLE_PN)
#define X_ENABLE_PIN            0
#define Y_ENABLE_PN             1
#define Y_ENABLE_PORT           port(Y_ENABLE_PN)
#define Y_ENABLE_PIN            9
#define Z_ENABLE_PN             1
#define Z_ENABLE_PORT           port(Z_ENABLE_PN)
#define Z_ENABLE_PIN            16

// Define homing/hard limit switch input pins.
// NOTE: All limit bits (needs to be on same port)
#define LIMIT_PN                1
#define LIMIT_PORT              port(LIMIT_PN)
#define X_LIMIT_PIN             29
#define Y_LIMIT_PIN             28
#define Z_LIMIT_PIN             27
#define LIMITS_POLL_PORT        port(1) // NOTE: Port 1 is not interrupt capable, use polling instead!
#define LIMIT_INMODE            GPIO_BITBAND

// Define ganged axis or A axis step pulse and step direction output pins.
#if N_ABC_MOTORS > 0
#define M3_AVAILABLE
#define M3_STEP_PN              2
#define M3_STEP_PORT            port(M3_STEP_PN)
#define M3_STEP_PIN             6
#define M3_DIRECTION_PN         2
#define M3_DIRECTION_PORT       port(M3_DIRECTION_PN)
#define M3_DIRECTION_PIN        7
#define M3_LIMIT_PORT           port(LIMIT_PN)
#define M3_LIMIT_PIN            26
#define M3_ENABLE_PN            0
#define M3_ENABLE_PORT          port(M3_ENABLE_PN)
#define M3_ENABLE_PIN           4
#endif

// Define ganged axis or B axis step pulse and step direction output pins.
#if N_ABC_MOTORS == 2
#define M4_AVAILABLE
#define M4_STEP_PN              2
#define M4_STEP_PORT            port(M4_STEP_PN)
#define M4_STEP_PIN             1
#define M4_DIRECTION_PN         0
#define M4_DIRECTION_PORT       port(M4_DIRECTION_PN)
#define M4_DIRECTION_PIN        21
#define M4_LIMIT_PORT           port(LIMIT_PN)
#define M4_LIMIT_PIN            25
#define M4_ENABLE_PN            0
#define M4_ENABLE_PORT          port(M4_ENABLE_PN)
#define M4_ENABLE_PIN           21
#endif

// Define probe switch input pin.
#define PROBE_PN                1
#define PROBE_PORT              port(PROBE_PN)
#define PROBE_PIN               22

// Define spindle enable and spindle direction output pins.
#define SPINDLE_ENABLE_PN       1
#define SPINDLE_ENABLE_PORT     port(SPINDLE_ENABLE_PN)
#define SPINDLE_ENABLE_PIN      20
#define SPINDLE_DIRECTION_PN    1
#define SPINDLE_DIRECTION_PORT  port(SPINDLE_DIRECTION_PN)
#define SPINDLE_DIRECTION_PIN   21

// Start of PWM & Stepper Enabled Spindle

// Define flood and mist coolant enable output pins.
#define COOLANT_FLOOD_PN        1
#define COOLANT_FLOOD_PORT      port(COOLANT_FLOOD_PN)
#define COOLANT_FLOOD_PIN       19

#define COOLANT_MIST_PN         1
#define COOLANT_MIST_PORT       port(COOLANT_MIST_PN)
#define COOLANT_MIST_PIN        30

// Define user-control CONTROLs (reset, feed hold, cycle start) input pins.
#define RESET_PORT_PN           0
#define RESET_PORT              port(RESET_PORT_PN)
#define RESET_PIN               18

#define FEED_HOLD_PN            0
#define FEED_HOLD_PORT          port(FEED_HOLD_PN)
#define FEED_HOLD_PIN           16

#define CYCLE_START_PN          0
#define CYCLE_START_PORT        port(CYCLE_START_PN)
#define CYCLE_START_PIN         15

#define CONTROL_INMODE          GPIO_BITBAND

#ifdef SPINDLE_PWM_PIN_2_4
#define SPINDLE_PWM_CHANNEL     PWM1_CH5    // MOSFET3 (P2.4)
#else
#define SPINDLE_PWM_CHANNEL     PWM1_CH6    // BED MOSFET (P2.5)
#endif
#define SPINDLE_PWM_USE_PRIMARY_PIN   false
#define SPINDLE_PWM_USE_SECONDARY_PIN true

#if SDCARD_ENABLE
#define SD_SPI_PORT             0
#define SD_CS_PN                0
#define SD_CS_PORT              port(SD_CS_PN)
#define SD_CS_PIN               6
#endif

#if TRINAMIC_ENABLE == 2130 || TRINAMIC_ENABLE == 5160

#define TRINAMIC_MOSI_PN        1
#define TRINAMIC_MOSI_PORT      port(TRINAMIC_MOSI_PN)
#define TRINAMIC_MOSI_PIN       17
#define TRINAMIC_MISO_PN        0
#define TRINAMIC_MISO_PORT      port(TRINAMIC_MISO_PN)
#define TRINAMIC_MISO_PIN       5
#define TRINAMIC_SCK_PN         0
#define TRINAMIC_SCK_PORT       port(TRINAMIC_SCK_PN)
#define TRINAMIC_SCK_PIN        4
#endif

#if TRINAMIC_ENABLE == 2130 || TRINAMIC_ENABLE == 5160 || TRINAMIC_ENABLE == 2209
#define MOTOR_CS_PN             1
#define MOTOR_CS_PORT           port(MOTOR_CS_PN)
#define MOTOR_CSX_PIN           1
#define MOTOR_CSY_PIN           10
#define MOTOR_CSZ_PIN           17
#ifdef M3_AVAILABLE
#define MOTOR_CSM3_PIN          5
#endif
#ifdef M4_AVAILABLE
#define MOTOR_CSM4_PIN          22
#endif

#endif


/**/

src/driver.h change to include my config

diff --git a/src/driver.h b/src/driver.h
index 20551f5..084cdce 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -81,6 +81,8 @@
   #include "btt_skr_1.3_map.h"
 #elif defined(BOARD_BTT_SKR_14_TURBO)
   #include "btt_skr_1.4_turbo_map.h"
+#elif defined(BOARD_BTT_SKR_E3_TURBO)
+  #include "btt_skr_e3_turbo_map.h"
 #elif defined(BOARD_MKS_SBASE_13)
   #include "mks_sbase_map.h"
 #elif defined(BOARD_MY_MACHINE)

Ideas? Maybe the EEPROM is corrupted? Can I reset it via an SD card file for example?

Contextual notes: I have both X & Y ganged (MPCNC)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions