Skip to content

Commit

Permalink
fix extruder spi bus conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensp committed Oct 17, 2022
1 parent 5809bdd commit b2aa0d0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
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
#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
42 changes: 24 additions & 18 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h
Original file line number Diff line number Diff line change
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,23 @@
//
// 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
//
// #define PIN_SPI_SS PB12
// #define PIN_SPI_MOSI PB15
// #define PIN_SPI_MISO PB14
// #define PIN_SPI_SCK PB13
//
// Onboard SDCARD uses thes pins and is shared on EXP2 for LCD's
//
// 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 // PA15
#define SD_DETECT_PIN EXP2_07_PIN // PC10
#endif
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

0 comments on commit b2aa0d0

Please sign in to comment.