diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index dea1a4e176..7ebbcd0066 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -105,6 +105,7 @@ jobs: - FYSETC_S6 - LERDGEK - LERDGEX + - mks_robin_pro2 - Opulo_Lumen_REV3 - rumba32 - STM32F401RC_creality diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index f77bf7afeb..78630051b6 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2629,10 +2629,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #if ENABLED(TFT_GENERIC) && NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI) #error "TFT_GENERIC requires either TFT_INTERFACE_FSMC or TFT_INTERFACE_SPI interface." -#endif - -#if BOTH(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI) - #error "Please enable only one of TFT_INTERFACE_SPI or TFT_INTERFACE_SPI." +#elif BOTH(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI) + #error "Please enable only one of TFT_INTERFACE_FSMC or TFT_INTERFACE_SPI." #endif #if defined(LCD_SCREEN_ROTATE) && LCD_SCREEN_ROTATE != 0 && LCD_SCREEN_ROTATE != 90 && LCD_SCREEN_ROTATE != 180 && LCD_SCREEN_ROTATE != 270 diff --git a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp index 94c3517e3a..be4682f68f 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp @@ -138,7 +138,10 @@ void tft_lvgl_init() { uint16_t usb_flash_loop = 1000; #if ENABLED(MULTI_VOLUME) && !HAS_SD_HOST_DRIVE SET_INPUT_PULLUP(SD_DETECT_PIN); - card.changeMedia(IS_SD_INSERTED() ? &card.media_driver_sdcard : &card.media_driver_usbFlash); + if (IS_SD_INSERTED()) + card.changeMedia(&card.media_driver_sdcard); + else + card.changeMedia(&card.media_driver_usbFlash); #endif do { card.media_driver_usbFlash.idle(); diff --git a/Marlin/src/pins/gd32f1/pins_TRIGORILLA_V006.h b/Marlin/src/pins/gd32f1/pins_TRIGORILLA_V006.h index ee4376c50a..abdd35f058 100644 --- a/Marlin/src/pins/gd32f1/pins_TRIGORILLA_V006.h +++ b/Marlin/src/pins/gd32f1/pins_TRIGORILLA_V006.h @@ -122,7 +122,7 @@ // // SPI // - #define SPI_DEVICE -1 + #define SPI_DEVICE -1 // Maple #define SCK_PIN -1 #define MISO_PIN -1 #define MOSI_PIN -1 diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h index 950eb8d88f..4f32304dde 100644 --- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h +++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h @@ -381,8 +381,8 @@ #define TFT_CS_PIN 49 #define TFT_DC_PIN 43 #define TFT_SCK_PIN SD_SCK_PIN - #define TFT_MOSI_PIN SD_MOSI_PIN #define TFT_MISO_PIN SD_MISO_PIN + #define TFT_MOSI_PIN SD_MOSI_PIN #define LCD_USE_DMA_SPI #define BTN_EN1 40 @@ -396,12 +396,12 @@ #define SPI_FLASH #if ENABLED(SPI_FLASH) - #define SPI_DEVICE 1 + #define SPI_DEVICE 1 // Maple #define SPI_FLASH_SIZE 0x1000000 // 16MB #define SPI_FLASH_CS_PIN 31 - #define SPI_FLASH_MOSI_PIN SD_MOSI_PIN - #define SPI_FLASH_MISO_PIN SD_MISO_PIN #define SPI_FLASH_SCK_PIN SD_SCK_PIN + #define SPI_FLASH_MISO_PIN SD_MISO_PIN + #define SPI_FLASH_MOSI_PIN SD_MOSI_PIN #endif #define TFT_BUFFER_SIZE 0xFFFF diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h index 44a98e5af7..851eee8296 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h @@ -273,7 +273,7 @@ #endif #if SD_CONNECTION_IS(LCD) - #define SPI_DEVICE 3 + #define SPI_DEVICE 3 // Maple #define SD_DETECT_PIN EXP2_07_PIN #define SD_SCK_PIN EXP2_02_PIN #define SD_MISO_PIN EXP2_01_PIN diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_common.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_common.h index 22f78350cf..7452562c83 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_common.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_common.h @@ -113,18 +113,18 @@ #define FIL_RUNOUT_PIN PA15 // MT_DET #endif -// SPI Flash +// +// SPI Flash (SPI 2) +// #define SPI_FLASH #if ENABLED(SPI_FLASH) #define SPI_FLASH_SIZE 0x200000 // 2MB + #define SPI_FLASH_CS_PIN PB12 + #define SPI_FLASH_SCK_PIN PB13 + #define SPI_FLASH_MISO_PIN PB14 + #define SPI_FLASH_MOSI_PIN PB15 #endif -// SPI 2 -#define SPI_FLASH_CS_PIN PB12 -#define SPI_FLASH_MOSI_PIN PB15 -#define SPI_FLASH_MISO_PIN PB14 -#define SPI_FLASH_SCK_PIN PB13 - // // TFT with FSMC interface // @@ -160,7 +160,7 @@ // SPI1(PA7)=LCD & SPI3(PB5)=STUFF, are not available // so SPI2 is required. -#define SPI_DEVICE 2 +#define SPI_DEVICE 2 // Maple #define SD_SCK_PIN PB13 #define SD_MISO_PIN PB14 #define SD_MOSI_PIN PB15 diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index fd6609f0fc..bdfe24cad0 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -60,22 +60,26 @@ // // SPI -// Note: FLSun Hispeed (clone MKS_Robin_miniV2) board is using SPI2 interface. +// +#define SPI_DEVICE 2 // Maple + +// +// SD Card SPI // #define SD_SCK_PIN PB13 // SPI2 #define SD_MISO_PIN PB14 // SPI2 #define SD_MOSI_PIN PB15 // SPI2 -#define SPI_DEVICE 2 +// // SPI Flash +// #define SPI_FLASH #if ENABLED(SPI_FLASH) - // SPI 2 - #define SPI_FLASH_CS_PIN PB12 // SPI2_NSS / Flash chip-select - #define SPI_FLASH_MOSI_PIN PB15 - #define SPI_FLASH_MISO_PIN PB14 - #define SPI_FLASH_SCK_PIN PB13 #define SPI_FLASH_SIZE 0x1000000 // 16MB + #define SPI_FLASH_CS_PIN PB12 // SPI2_NSS / Flash chip-select + #define SPI_FLASH_SCK_PIN PB13 + #define SPI_FLASH_MISO_PIN PB14 + #define SPI_FLASH_MOSI_PIN PB15 #endif // diff --git a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h index e723845a2a..f7ef25419f 100644 --- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h @@ -152,7 +152,7 @@ // #if HAS_WIRED_LCD - #define SPI_DEVICE 2 + #define SPI_DEVICE 2 // Maple #define SD_SS_PIN EXP2_04_PIN #define SD_SCK_PIN EXP2_02_PIN #define SD_MISO_PIN EXP2_01_PIN diff --git a/Marlin/src/pins/stm32f1/pins_KEDI_CONTROLLER_V1_2.h b/Marlin/src/pins/stm32f1/pins_KEDI_CONTROLLER_V1_2.h index 9ea36e2f25..494af83f59 100644 --- a/Marlin/src/pins/stm32f1/pins_KEDI_CONTROLLER_V1_2.h +++ b/Marlin/src/pins/stm32f1/pins_KEDI_CONTROLLER_V1_2.h @@ -280,7 +280,7 @@ #endif #if SD_CONNECTION_IS(LCD) - #define SPI_DEVICE 3 + #define SPI_DEVICE 3 // Maple #define SD_DETECT_PIN EXP2_04_PIN #define SD_SCK_PIN EXP2_09_PIN #define SD_MISO_PIN EXP2_10_PIN diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index 168317d8b5..d4f0ea7fd2 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -35,18 +35,18 @@ #define BOARD_NO_NATIVE_USB -//#define DISABLE_DEBUG // We still want to debug with STLINK... -#define DISABLE_JTAG // We free the jtag pins (PA15) but keep STLINK - // Release PB4 (STEP_X_PIN) from JTAG NRST role. +//#define DISABLE_DEBUG // Allow debug with STLINK... +#define DISABLE_JTAG // We free the JTAG pins (PA15) but keep STLINK + // Release PB4 (STEP_X_PIN) from JTAG NRST role. // // Limit Switches // -#define X_MIN_PIN PC1 // pin 16 -#define X_MAX_PIN PC0 // pin 15 (Filament sensor on Alfawise setup) -#define Y_MIN_PIN PC15 // pin 9 -#define Y_MAX_PIN PC14 // pin 8 (Unused in stock Alfawise setup) -#define Z_MIN_PIN PE6 // pin 5 Standard Endstop or Z_Probe endstop function -#define Z_MAX_PIN PE5 // pin 4 (Unused in stock Alfawise setup) +#define X_MIN_PIN PC1 +#define X_MAX_PIN PC0 // (Filament sensor on Alfawise setup) +#define Y_MIN_PIN PC15 +#define Y_MAX_PIN PC14 // (Unused in stock Alfawise setup) +#define Z_MIN_PIN PE6 // Standard Endstop or Z_Probe endstop function +#define Z_MAX_PIN PE5 // (Unused in stock Alfawise setup) // May be used for BLTouch Servo function on older variants (<= V08) #define ONBOARD_ENDSTOPPULLUPS @@ -60,35 +60,35 @@ // // Steppers // -#define X_ENABLE_PIN PB5 // pin 91 -#define X_STEP_PIN PB4 // pin 90 -#define X_DIR_PIN PB3 // pin 89 +#define X_ENABLE_PIN PB5 +#define X_STEP_PIN PB4 +#define X_DIR_PIN PB3 -#define Y_ENABLE_PIN PB8 // pin 95 -#define Y_STEP_PIN PB7 // pin 93 -#define Y_DIR_PIN PB6 // pin 92 +#define Y_ENABLE_PIN PB8 +#define Y_STEP_PIN PB7 +#define Y_DIR_PIN PB6 -#define Z_ENABLE_PIN PE1 // pin 98 -#define Z_STEP_PIN PE0 // pin 97 -#define Z_DIR_PIN PB9 // pin 96 +#define Z_ENABLE_PIN PE1 +#define Z_STEP_PIN PE0 +#define Z_DIR_PIN PB9 -#define E0_ENABLE_PIN PE4 // pin 3 -#define E0_STEP_PIN PE3 // pin 2 -#define E0_DIR_PIN PE2 // pin 1 +#define E0_ENABLE_PIN PE4 +#define E0_STEP_PIN PE3 +#define E0_DIR_PIN PE2 // // Temperature Sensors // -#define TEMP_0_PIN PA0 // pin 23 (Nozzle 100K/3950 thermistor) -#define TEMP_BED_PIN PA1 // pin 24 (Hot Bed 100K/3950 thermistor) +#define TEMP_0_PIN PA0 // (Nozzle 100K/3950 thermistor) +#define TEMP_BED_PIN PA1 // (Hot Bed 100K/3950 thermistor) // // Heaters / Fans // -#define HEATER_0_PIN PD3 // pin 84 (Nozzle Heat Mosfet) -#define HEATER_BED_PIN PA8 // pin 67 (Hot Bed Mosfet) +#define HEATER_0_PIN PD3 // (Nozzle Heat Mosfet) +#define HEATER_BED_PIN PA8 // (Hot Bed Mosfet) -#define FAN0_PIN PA15 // pin 77 (4cm Fan) +#define FAN0_PIN PA15 // (4cm Fan) #if TERN(MAPLE_STM32F1, ENABLED(FAN_SOFT_PWM), ENABLED(FAST_PWM_FAN)) && FAN_MIN_PWM < 5 // Required to avoid issues with heating or STLink #error "FAN_MIN_PWM must be 5 or higher." // Fan will not start in 1-30 range @@ -104,10 +104,10 @@ #endif #endif -//#define BEEPER_PIN PD13 // pin 60 (Servo PWM output 5V/GND on Board V0G+) made for BL-Touch sensor +//#define BEEPER_PIN PD13 // (Servo PWM output 5V/GND on Board V0G+) made for BL-Touch sensor // Can drive a PC Buzzer, if connected between PWM and 5V pins -#define LED_PIN PC2 // pin 17 +#define LED_PIN PC2 // Longer3D board mosfets are passing by default // Avoid nozzle heat and fan start before serial init @@ -136,14 +136,14 @@ // #if HAS_FSMC_TFT #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT - #define FSMC_CS_PIN PD7 // pin 88 = FSMC_NE1 - #define FSMC_RS_PIN PD11 // pin 58 A16 Register. Only one address needed + #define FSMC_CS_PIN PD7 // FSMC_NE1 + #define FSMC_RS_PIN PD11 // A16 Register. Only one address needed #define TFT_CS_PIN FSMC_CS_PIN #define TFT_RS_PIN FSMC_RS_PIN - #define TFT_RESET_PIN PC4 // pin 33 - #define TFT_BACKLIGHT_PIN PD12 // pin 59 + #define TFT_RESET_PIN PC4 + #define TFT_BACKLIGHT_PIN PD12 #define TFT_BACKLIGHT_PWM 150 // Brightness with alt. TIM4 chan 1 (1-255) #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h @@ -168,11 +168,11 @@ * declared below. */ #if NEED_TOUCH_PINS - #define TOUCH_CS_PIN PB12 // pin 51 SPI2_NSS - #define TOUCH_SCK_PIN PB13 // pin 52 - #define TOUCH_MOSI_PIN PB14 // pin 53 (Inverted MOSI/MISO = No HW SPI2) - #define TOUCH_MISO_PIN PB15 // pin 54 - #define TOUCH_INT_PIN PC6 // pin 63 (PenIRQ coming from ADS7843) + #define TOUCH_CS_PIN PB12 // SPI2_NSS + #define TOUCH_SCK_PIN PB13 + #define TOUCH_MISO_PIN PB15 // (Swapped MOSI/MISO = No HW SPI2) + #define TOUCH_MOSI_PIN PB14 + #define TOUCH_INT_PIN PC6 // (PenIRQ coming from ADS7843) #endif // @@ -181,25 +181,25 @@ // #if NO_EEPROM_SELECTED //#define SPI_EEPROM - //#define SPI_FLASH // need MARLIN_DEV_MODE for M993/M994 EEPROM backup tests + //#define SPI_FLASH // Use MARLIN_DEV_MODE for M993/M994 EEPROM backup tests #define FLASH_EEPROM_EMULATION #endif #if ENABLED(SPI_EEPROM) // SPI1 EEPROM Winbond W25Q64 (8MB/64Mbits) #define SPI_CHAN_EEPROM1 1 - #define SPI_EEPROM1_CS_PIN PC5 // pin 34 - #define EEPROM_SCK_PIN BOARD_SPI1_SCK_PIN // PA5 pin 30 - #define EEPROM_MISO_PIN BOARD_SPI1_MISO_PIN // PA6 pin 31 - #define EEPROM_MOSI_PIN BOARD_SPI1_MOSI_PIN // PA7 pin 32 + #define SPI_EEPROM1_CS_PIN PC5 + #define EEPROM_SCK_PIN BOARD_SPI1_SCK_PIN // PA5 + #define EEPROM_MISO_PIN BOARD_SPI1_MISO_PIN // PA6 + #define EEPROM_MOSI_PIN BOARD_SPI1_MOSI_PIN // PA7 #define EEPROM_PAGE_SIZE 0x1000U // 4K (from datasheet) - #define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // Limit to 64K for now... + #define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // Limit to 64K for now... #elif ENABLED(SPI_FLASH) - #define SPI_FLASH_SIZE 0x40000U // limit to 256K (M993 will reboot with 512) + #define SPI_FLASH_SIZE 0x40000U // Limit to 256K (M993 will reboot with 512) #define SPI_FLASH_CS_PIN PC5 - #define SPI_FLASH_MOSI_PIN PA7 - #define SPI_FLASH_MISO_PIN PA6 #define SPI_FLASH_SCK_PIN PA5 + #define SPI_FLASH_MISO_PIN PA6 + #define SPI_FLASH_MOSI_PIN PA7 #elif ENABLED(FLASH_EEPROM_EMULATION) // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h) #define EEPROM_PAGE_SIZE (0x800U) // 2K diff --git a/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h b/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h index a7fc323ba0..c86552ba12 100644 --- a/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h @@ -58,7 +58,7 @@ #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif -#define SPI_DEVICE 2 +#define SPI_DEVICE 2 // Maple // // Limit Switches diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h index e53ffa008b..d456974e9e 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h @@ -195,7 +195,7 @@ // SPI2 is shared by LCD touch driver and flash // SPI1(PA7) & SPI3(PB5) not available -#define SPI_DEVICE 2 +#define SPI_DEVICE 2 // Maple #define ONBOARD_SDIO #define SDIO_CLOCK 4500000 @@ -274,7 +274,7 @@ #if ENABLED(SPI_FLASH) #define SPI_FLASH_SIZE 0x800000 // 8MB #define SPI_FLASH_CS_PIN PG9 - #define SPI_FLASH_MOSI_PIN PB15 - #define SPI_FLASH_MISO_PIN PB14 #define SPI_FLASH_SCK_PIN PB13 + #define SPI_FLASH_MISO_PIN PB14 + #define SPI_FLASH_MOSI_PIN PB15 #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index 5cf209e533..6892655e46 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -58,9 +58,9 @@ #endif // -// Note: MKS Robin board is using SPI2 interface. +// SPI // -#define SPI_DEVICE 2 +#define SPI_DEVICE 2 // Maple // // Servos @@ -382,9 +382,9 @@ #if ENABLED(SPI_FLASH) #define SPI_FLASH_SIZE 0x1000000 // 16MB #define SPI_FLASH_CS_PIN PB12 - #define SPI_FLASH_MOSI_PIN PB15 - #define SPI_FLASH_MISO_PIN PB14 #define SPI_FLASH_SCK_PIN PB13 + #define SPI_FLASH_MISO_PIN PB14 + #define SPI_FLASH_MOSI_PIN PB15 #endif #ifndef BEEPER_PIN diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h index f257ea3bbb..a8583e92d7 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -253,7 +253,7 @@ // SD Card // #define SDCARD_CONNECTION ONBOARD -#define SPI_DEVICE 2 +#define SPI_DEVICE 2 // Maple #define ONBOARD_SPI_DEVICE 2 #define SDSS SD_SS_PIN #define ONBOARD_SD_CS_PIN SD_SS_PIN diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h index af4e121100..53f31c2784 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h @@ -156,7 +156,7 @@ // // SPI // -#define SPI_DEVICE 2 +#define SPI_DEVICE 2 // Maple #define SD_SCK_PIN PB13 #define SD_MISO_PIN PB14 #define SD_MOSI_PIN PB15 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h index 6835ec3b56..0651bcebf2 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE3.h @@ -152,7 +152,7 @@ // // SPI // -#define SPI_DEVICE 2 +#define SPI_DEVICE 2 // Maple #define SD_SCK_PIN PB13 #define SD_MISO_PIN PB14 #define SD_MOSI_PIN PB15 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index 3a50465a9a..372da38c62 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -50,7 +50,7 @@ #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif -#define SPI_DEVICE 2 +#define SPI_DEVICE 2 // Maple // // Servos @@ -199,7 +199,7 @@ #if ENABLED(SPI_FLASH) #define SPI_FLASH_SIZE 0x1000000 // 16MB #define SPI_FLASH_CS_PIN PB12 // Flash chip-select - #define SPI_FLASH_MOSI_PIN PB15 - #define SPI_FLASH_MISO_PIN PB14 #define SPI_FLASH_SCK_PIN PB13 + #define SPI_FLASH_MISO_PIN PB14 + #define SPI_FLASH_MOSI_PIN PB15 #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index d92ea01aa3..956e9dc72e 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -60,9 +60,9 @@ #endif // -// Note: MKS Robin board is using SPI2 interface. +// SPI // -#define SPI_DEVICE 2 +#define SPI_DEVICE 2 // Maple // // Servos @@ -384,9 +384,9 @@ #if ENABLED(SPI_FLASH) #define SPI_FLASH_SIZE 0x1000000 // 16MB #define SPI_FLASH_CS_PIN PB12 - #define SPI_FLASH_MOSI_PIN PB15 - #define SPI_FLASH_MISO_PIN PB14 #define SPI_FLASH_SCK_PIN PB13 + #define SPI_FLASH_MISO_PIN PB14 + #define SPI_FLASH_MOSI_PIN PB15 #endif #ifndef BEEPER_PIN diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h index a329b8a4bb..69eee63007 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_common.h @@ -49,7 +49,7 @@ #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2K #endif -#define SPI_DEVICE 2 +#define SPI_DEVICE 2 // Maple // // Servos @@ -210,7 +210,7 @@ #if ENABLED(SPI_FLASH) #define SPI_FLASH_SIZE 0x1000000 // 16MB #define SPI_FLASH_CS_PIN PB12 - #define SPI_FLASH_MOSI_PIN PB15 - #define SPI_FLASH_MISO_PIN PB14 #define SPI_FLASH_SCK_PIN PB13 + #define SPI_FLASH_MISO_PIN PB14 + #define SPI_FLASH_MOSI_PIN PB15 #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h index 922caa556e..114c224b1e 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h @@ -41,9 +41,9 @@ #define DISABLE_DEBUG // -// Note: MKS Robin board is using SPI2 interface. +// SPI // -#define SPI_DEVICE 2 +#define SPI_DEVICE 2 // Maple // // Servos @@ -167,9 +167,9 @@ #define HEATER_BED_PIN PA0 // +HOT-BED- #define FAN0_PIN PB1 // +FAN- -/** - * Note: MKS Robin Pro board is using SPI2 interface. Make sure your stm32duino library is configured accordingly - */ +// +// Note: Using SPI2 interface. Make sure stm32duino is configured accordingly +// //#define TEMP_0_CS_PIN PE5 // TC1 - CS1 //#define TEMP_0_CS_PIN PF11 // TC2 - CS2 @@ -308,7 +308,7 @@ #if ENABLED(SPI_FLASH) #define SPI_FLASH_SIZE 0x1000000 // 16MB #define SPI_FLASH_CS_PIN PB12 // Flash chip-select - #define SPI_FLASH_MOSI_PIN PB15 - #define SPI_FLASH_MISO_PIN PB14 #define SPI_FLASH_SCK_PIN PB13 + #define SPI_FLASH_MISO_PIN PB14 + #define SPI_FLASH_MOSI_PIN PB15 #endif diff --git a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h index ff2bf5fd8e..d6a5ef3c17 100644 --- a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h @@ -184,7 +184,7 @@ #endif // SPI1(PA7) & SPI3(PB5) not available -#define SPI_DEVICE 2 +#define SPI_DEVICE 2 // Maple #if ENABLED(ONBOARD_SDIO) #define SD_SCK_PIN PB13 // SPI2 ok diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index 01f2b00b58..04c4009529 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -213,8 +213,8 @@ // // 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 @@ -227,13 +227,12 @@ #define SPI_FLASH #if ENABLED(SPI_FLASH) - #define SPI_FLASH - #define SPI_DEVICE 2 - #define SPI_FLASH_SIZE 0x1000000 + #define SPI_DEVICE 2 // Maple + #define SPI_FLASH_SIZE 0x1000000 // 16MB #define SPI_FLASH_CS_PIN PB12 - #define SPI_FLASH_MOSI_PIN PC3 - #define SPI_FLASH_MISO_PIN PC2 #define SPI_FLASH_SCK_PIN PB13 + #define SPI_FLASH_MISO_PIN PC2 + #define SPI_FLASH_MOSI_PIN PC3 #endif /** diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h index 952a8e1ec0..60fe6fa66d 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -271,19 +271,19 @@ #endif */ -// -// LCD / Controller #define SPI_FLASH -#define SPI_FLASH -#define SPI_DEVICE 2 -#define SPI_FLASH_SIZE 0x1000000 #if ENABLED(SPI_FLASH) + #define SPI_DEVICE 2 // Maple + #define SPI_FLASH_SIZE 0x1000000 // 16MB #define SPI_FLASH_CS_PIN PB12 - #define SPI_FLASH_MOSI_PIN PB15 - #define SPI_FLASH_MISO_PIN PB14 #define SPI_FLASH_SCK_PIN PB13 + #define SPI_FLASH_MISO_PIN PB14 + #define SPI_FLASH_MOSI_PIN PB15 #endif +// +// LCD / Controller +// #if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) #ifndef TOUCH_CALIBRATION_X #define TOUCH_CALIBRATION_X -17253 diff --git a/Marlin/src/pins/stm32f4/pins_TRONXY_V10.h b/Marlin/src/pins/stm32f4/pins_TRONXY_V10.h index d5752e43dc..dbf8ddc5d5 100644 --- a/Marlin/src/pins/stm32f4/pins_TRONXY_V10.h +++ b/Marlin/src/pins/stm32f4/pins_TRONXY_V10.h @@ -73,9 +73,9 @@ #if ENABLED(SPI_FLASH) #define SPI_FLASH_SIZE 0x200000 // 2MB #define SPI_FLASH_CS_PIN PG15 // SPI2 - #define SPI_FLASH_MOSI_PIN PB5 - #define SPI_FLASH_MISO_PIN PB4 #define SPI_FLASH_SCK_PIN PB3 + #define SPI_FLASH_MISO_PIN PB4 + #define SPI_FLASH_MOSI_PIN PB5 #endif // diff --git a/buildroot/share/PlatformIO/scripts/download_mks_assets.py b/buildroot/share/PlatformIO/scripts/download_mks_assets.py index 661fb2e438..0186f59896 100644 --- a/buildroot/share/PlatformIO/scripts/download_mks_assets.py +++ b/buildroot/share/PlatformIO/scripts/download_mks_assets.py @@ -14,7 +14,7 @@ if pioutil.is_pio_build(): assets_path = Path(env.Dictionary("PROJECT_BUILD_DIR"), env.Dictionary("PIOENV"), "assets") def download_mks_assets(): - print("Downloading MKS Assets") + print("Downloading MKS Assets for TFT_LVGL_UI") r = requests.get(url, stream=True) # the user may have a very clean workspace, # so create the PROJECT_LIBDEPS_DIR directory if not exits @@ -25,7 +25,7 @@ if pioutil.is_pio_build(): fd.write(chunk) def copy_mks_assets(): - print("Copying MKS Assets") + print("Copying MKS Assets for TFT_LVGL_UI") output_path = Path(tempfile.mkdtemp()) zip_obj = zipfile.ZipFile(zip_path, 'r') zip_obj.extractall(output_path) diff --git a/buildroot/tests/mks_robin_pro2 b/buildroot/tests/mks_robin_pro2 new file mode 100755 index 0000000000..3919437433 --- /dev/null +++ b/buildroot/tests/mks_robin_pro2 @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# +# Build tests for mks_robin_pro2 (STM32F407VE) +# + +# exit on first failure +set -e + +# +# Robin Pro v2 with LVGL TFT +# +restore_configs +opt_set MOTHERBOARD BOARD_MKS_ROBIN_PRO_V2 SERIAL_PORT 1 +opt_enable SDSUPPORT USB_FLASH_DRIVE_SUPPORT USE_OTG_USB_HOST MULTI_VOLUME \ + TFT_GENERIC TFT_INTERFACE_SPI TFT_RES_480x320 TFT_LVGL_UI TOUCH_SCREEN \ + BLTOUCH Z_SAFE_HOMING LCD_BED_TRAMMING BED_TRAMMING_USE_PROBE +exec_test $1 $2 "MKS Robin Pro v2 | TFT_LVGL_UI | SD/FD Multi-Volume" "$3" + +# cleanup +restore_configs