Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MKS Robin E3 extruder SPI bus conflicts #24889

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Marlin/src/pins/esp32/pins_ENWI_ESPNP.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
#define FAN2_PIN 135
#define FAN3_PIN 136

// #define FAN_SOFT_PWM_REQUIRED // check if needed
//#define FAN_SOFT_PWM_REQUIRED // check if needed

// Neopixel Rings
#define NEOPIXEL_PIN 14
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@
#elif MB(MKS_ROBIN_PRO)
#include "stm32f1/pins_MKS_ROBIN_PRO.h" // STM32F1 env:mks_robin_pro env:mks_robin_pro_maple
#elif MB(MKS_ROBIN_E3)
#include "stm32f1/pins_MKS_ROBIN_E3.h" // STM32F1 env:mks_robin_e3 env:mks_robin_e3_maple
#include "stm32f1/pins_MKS_ROBIN_E3.h" // STM32F1 env:mks_robin_e3
thinkyhead marked this conversation as resolved.
Show resolved Hide resolved
#elif MB(MKS_ROBIN_E3_V1_1)
#include "stm32f1/pins_MKS_ROBIN_E3_V1_1.h" // STM32F1 env:mks_robin_e3
#elif MB(MKS_ROBIN_E3D)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
// SD Card
//
#define SD_DETECT_PIN PC7
#define NO_SD_HOST_DRIVE // SD is only seen by the printer
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer

#define SDIO_SUPPORT // Extra added by Creality
#define SDIO_CLOCK 6000000 // In original source code overridden by Creality in sdio.h
Expand Down
48 changes: 28 additions & 20 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@
#define EXP2_05_PIN PB0
#define EXP2_06_PIN PB15
#define EXP2_07_PIN PC10
#define EXP2_08_PIN -1 // RESET
#define EXP2_08_PIN -1 // RESET

// "Ender-3 EXP1"
#define EXP3_01_PIN PC1
#define EXP3_02_PIN PC3
#define EXP3_03_PIN PB11
#define EXP3_04_PIN -1 // RESET
#define EXP3_04_PIN -1 // RESET
#define EXP3_05_PIN PB0
#define EXP3_06_PIN PA6
#define EXP3_07_PIN PA5
Expand Down Expand Up @@ -204,10 +204,10 @@
#define LCD_BACKLIGHT_PIN -1
#define LCD_RESET_PIN EXP1_05_PIN
#define NEOPIXEL_PIN EXP1_06_PIN
#define DOGLCD_MOSI EXP2_06_PIN
#define DOGLCD_SCK EXP2_02_PIN
#define FORCE_SOFT_SPI
#define SOFTWARE_SPI
#define DOGLCD_MOSI EXP2_06_PIN // SPI2_MOSI
#define DOGLCD_SCK EXP2_02_PIN // SPI2_SCK
//#define FORCE_SOFT_SPI
//#define SOFTWARE_SPI
//#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270

#else
Expand Down Expand Up @@ -249,17 +249,25 @@
//
// SD Card
//
#define SDCARD_CONNECTION ONBOARD
#define SPI_DEVICE 2
#define ONBOARD_SPI_DEVICE 2
#define SDSS SD_SS_PIN
#define ONBOARD_SD_CS_PIN SD_SS_PIN
#define SD_DETECT_PIN PC10 // EXP2_07_PIN
#define NO_SD_HOST_DRIVE

// TODO: This is the only way to set SPI for SD on STM32 (for now)
#define ENABLE_SPI2
#define SD_SCK_PIN EXP2_02_PIN
#define SD_MISO_PIN EXP2_01_PIN
#define SD_MOSI_PIN EXP2_06_PIN
#define SD_SS_PIN EXP2_04_PIN
// DEFAULT_SPI == 2 defines the following pins,
// used as overrides in HAL/STM32/spi_pins.h
//
//#define PIN_SPI_SS PB12
//#define PIN_SPI_MOSI PB15
//#define PIN_SPI_MISO PB14
//#define PIN_SPI_SCK PB13

//
// Onboard SDCARD uses these pins and is shared on EXP2 for LCDs
//
// SPI2_CS PA15
// SPI2_MOSI PB15
// SPI2_SCK PB13
// SPI2_MISO PB14
// SPI2_DET PC10

#if ENABLED(SDSUPPORT)
#define NO_SD_HOST_DRIVE
#define SDSS EXP2_04_PIN
#define SD_DETECT_PIN EXP2_07_PIN
#endif
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
#define SD_SCK_PIN PC10
#define SD_MISO_PIN PC11
#define SD_MOSI_PIN PC12
#define SD_DETECT_PIN PC4 // SD_DETECT_PIN doesn't work with NO_SD_HOST_DRIVE disabled
#define SD_DETECT_PIN PC4 // Doesn't work when ONBOARD and NO_SD_HOST_DRIVE disabled
#elif SD_CONNECTION_IS(LCD)
#define ENABLE_SPI1
#define SDSS EXP2_04_PIN
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
//
// Onboard SD card
//
// detect pin doesn't work when ONBOARD and NO_SD_HOST_DRIVE disabled
// Detect pin doesn't work when ONBOARD and NO_SD_HOST_DRIVE disabled
#if SD_CONNECTION_IS(ONBOARD)
#define ENABLE_SPI3
#define SD_SS_PIN -1
Expand Down
2 changes: 1 addition & 1 deletion ini/stm32f1.ini
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ board_build.encrypt_mks = Robin_e3.bin
board_build.offset = 0x5000
board_upload.offset_address = 0x08005000
build_flags = ${common_STM32F103RC_variant.build_flags}
-DTIMER_SERVO=TIM5 -DDEFAULT_SPI=3
-DTIMER_SERVO=TIM5 -DDEFAULT_SPI=2
build_unflags = ${common_STM32F103RC_variant.build_unflags}
-DUSBCON -DUSBD_USE_CDC
debug_tool = stlink
Expand Down