MKS-Robin icon indicating copy to clipboard operation
MKS-Robin copied to clipboard

MKS-Robin2 with TMC2208 compile error

Open aknalee opened this issue 6 years ago • 2 comments

Compiling with VS code and PlatformIO

I set the -----------(platformio.ini) [env:mks_robin2] platform = [email protected]

-----------(configuration.h) #define Y_DRIVER_TYPE TMC2208

then I got the error below.. please help me!!

Marlin\src\HAL\HAL_STM32../../inc/SanityCheck.h:1958:4: error: #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL_(RX|TX)PIN." #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL(RX|TX)PIN." ^~~~~ In file included from Marlin\src\HAL\HAL_STM32../../inc/MarlinConfig.h:37:0, from Marlin\src\HAL\HAL_STM32\HAL_Servo_STM32.cpp:25: Marlin\src\HAL\HAL_STM32../../inc/SanityCheck.h:1958:4: error: #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL(RX|TX)PIN." #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL(RX|TX)PIN." ^~~~~ In file included from Marlin\src\HAL\HAL_STM32../../inc/MarlinConfig.h:37:0, from Marlin\src\HAL\HAL_STM32\HAL_spi_STM32.cpp:26: Marlin\src\HAL\HAL_STM32../../inc/SanityCheck.h:1958:4: error: #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL(RX|TX)PIN." #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL(RX|TX)PIN." ^~~~~ In file included from Marlin\src\HAL\HAL_STM32../../inc/MarlinConfig.h:37:0, from Marlin\src\HAL\HAL_STM32\fastio_STM32.cpp:25: Marlin\src\HAL\HAL_STM32../../inc/SanityCheck.h:1958:4: error: #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL(RX|TX)PIN." #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL(RX|TX)PIN." ^~~~~ In file included from Marlin\src\HAL\HAL_STM32../../inc/MarlinConfig.h:37:0, from Marlin\src\HAL\HAL_STM32\HAL_timers_STM32.h:25, from Marlin\src\HAL\HAL_STM32\HAL.h:99, from Marlin\src\HAL\HAL_STM32\HAL_timers_STM32.cpp:25: Marlin\src\HAL\HAL_STM32../../inc/SanityCheck.h:1958:4: error: #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL(RX|TX)PIN." #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL(RX|TX)PIN." ^~~~~ In file included from Marlin\src\HAL\HAL_STM32../../inc/MarlinConfig.h:37:0, from Marlin\src\HAL\HAL_STM32\persistent_store_impl.cpp:25: Marlin\src\HAL\HAL_STM32../../inc/SanityCheck.h:1958:4: error: #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL(RX|TX)PIN." #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL(RX|TX)PIN." ^~~~~ In file included from Marlin\src\HAL\HAL_STM32../../inc/MarlinConfig.h:37:0, from Marlin\src\HAL\HAL_STM32\watchdog_STM32.cpp:25: Marlin\src\HAL\HAL_STM32../../inc/SanityCheck.h:1958:4: error: #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL(RX|TX)PIN." #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL(RX|TX)PIN." ^~~~~ In file included from Marlin\src\HAL\shared../../inc/MarlinConfig.h:37:0, from Marlin\src\HAL\shared\HAL_spi_L6470.cpp:28: Marlin\src\HAL\shared../../inc/SanityCheck.h:1958:4: error: #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL(RX|TX)PIN." #error "TMC2208 or TMC2209 on Y requires Y_HARDWARE_SERIAL or Y_SERIAL(RX|TX)_PIN."

aknalee avatar Sep 06 '19 23:09 aknalee

Since you have defined Y-AXIS to use TMC2208, you need to add the following pin definitions in the pins_MKS_ROBIN.h file:  #if HAS_TMC220x   /**    * TMC2208/TMC2209 stepper drivers    *    * Hardware serial communication ports.    * If undefined software serial is used according to the pins below    */   //#define X_HARDWARE_SERIAL Serial   //#define X2_HARDWARE_SERIAL Serial1   //#define Y_HARDWARE_SERIAL Serial1   //#define Y2_HARDWARE_SERIAL Serial1   //#define Z_HARDWARE_SERIAL Serial1   //#define Z2_HARDWARE_SERIAL Serial1   //#define E0_HARDWARE_SERIAL Serial1   //#define E1_HARDWARE_SERIAL Serial1   //#define E2_HARDWARE_SERIAL Serial1   //#define E3_HARDWARE_SERIAL Serial1   //#define E4_HARDWARE_SERIAL Serial1

  //   // Software serial   //   #define X_SERIAL_TX_PIN ***   #define X_SERIAL_RX_PIN ***

  #define Y_SERIAL_TX_PIN ***   #define Y_SERIAL_RX_PIN ***

  #define Z_SERIAL_TX_PIN ***   #define Z_SERIAL_RX_PIN ***

  #define E0_SERIAL_TX_PIN ***   #define E0_SERIAL_RX_PIN ***

  #define E1_SERIAL_TX_PIN ***   #define E1_SERIAL_RX_PIN *** #endif

*** Represents your pin, such as PF1... You can refer to the MKS Robin schematic and select the appropriate extension pin. MKS Robin Hardware: https://github.com/makerbase-mks/MKS-Robin/tree/master/MKS%20Robin/Hardware

makerbase-mks avatar Oct 11 '19 07:10 makerbase-mks

@makerbase-mks How about you go into your own repository and check how your recommendations apply your own design ? Neither Robin nor Robin2 support TMC UART. The UART_PDN pin of the driver connects to the socket' SLP line which goes nowhere. End of story.

pavlov-s avatar Jun 18 '20 08:06 pavlov-s