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

Improve MKS Robin support #19333

Merged
merged 46 commits into from
Jan 7, 2021
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
25b627e
Update pins_MKS_ROBIN.h
Robin-DUBREUIL Sep 10, 2020
a79cbb9
Update pins_MKS_ROBIN.h
Robin-DUBREUIL Sep 10, 2020
4603812
Update pins_MKS_ROBIN.h
Robin-DUBREUIL Sep 10, 2020
f0edf90
Apply auto-format
thinkyhead Sep 10, 2020
ec4da8e
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/19333
thinkyhead Sep 10, 2020
06a6bc8
0xFF
thinkyhead Sep 11, 2020
3267e48
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/19333
thinkyhead Oct 8, 2020
1237a63
Use 0xFF (not 'ff') for byte transfer
thinkyhead Oct 8, 2020
531b402
Move TFT_320x240 pin entries
thinkyhead Oct 8, 2020
5864dd3
Catch undefined SPI_DEVICE
thinkyhead Oct 8, 2020
1e51e45
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/19333
thinkyhead Oct 8, 2020
590076b
Don't fall back to BL24CXX
thinkyhead Oct 8, 2020
52b7721
Allow touch calibration override
thinkyhead Oct 8, 2020
1f0be57
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/19333
thinkyhead Oct 8, 2020
8817ba4
Merge branch 'bugfix-2.0.x' into patch-1
thinkyhead Oct 13, 2020
3c2f121
Merge branch 'bugfix-2.0.x' into patch-1
thinkyhead Oct 16, 2020
ac0dfa7
Update pins_MKS_ROBIN.h
thinkyhead Oct 16, 2020
f845833
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/19333
thinkyhead Oct 23, 2020
7ed6851
Disable TFT_ILI9328 in the pins file
thinkyhead Oct 23, 2020
839298e
Fix a TFT define
thinkyhead Oct 23, 2020
447ce65
Update pins_MKS_ROBIN.h
Robin-DUBREUIL Nov 10, 2020
9c5c3ee
Update pins_MKS_ROBIN.h
Robin-DUBREUIL Nov 10, 2020
ae2eacd
Update pins_MKS_ROBIN.h
Robin-DUBREUIL Nov 10, 2020
d934d2d
Update pins_MKS_ROBIN.h
Robin-DUBREUIL Sep 10, 2020
24e88de
Update pins_MKS_ROBIN.h
Robin-DUBREUIL Sep 10, 2020
5624257
Update pins_MKS_ROBIN.h
Robin-DUBREUIL Sep 10, 2020
3d5802f
Apply auto-format
thinkyhead Sep 10, 2020
8bd5ade
Move TFT_320x240 pin entries
thinkyhead Oct 8, 2020
db77533
Catch undefined SPI_DEVICE
thinkyhead Oct 8, 2020
ddb7fc4
Don't fall back to BL24CXX
thinkyhead Oct 8, 2020
d7c816e
Update pins_MKS_ROBIN.h
thinkyhead Oct 16, 2020
6d5ab56
Disable TFT_ILI9328 in the pins file
thinkyhead Oct 23, 2020
717e6d4
Fix a TFT define
thinkyhead Oct 23, 2020
c76b17a
Update pins_MKS_ROBIN.h
Robin-DUBREUIL Nov 10, 2020
366807a
Update pins_MKS_ROBIN.h
Robin-DUBREUIL Nov 10, 2020
7cee7b7
Align better with upstream changes
sjasonsmith Dec 12, 2020
2eb769c
Rearrange and cleanup
sjasonsmith Dec 12, 2020
569332e
Merge remote-tracking branch 'TheCodeExorcist/patch-1' into PRR/19333…
sjasonsmith Dec 12, 2020
e842cd4
Fix failed tests
sjasonsmith Dec 12, 2020
683a6dc
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/19333
thinkyhead Dec 22, 2020
883ea5e
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into PRR/19333_p…
sjasonsmith Jan 1, 2021
0d227ac
Remove ONBOARD SD from Robin
sjasonsmith Jan 1, 2021
42c1496
outdated spi configs
rhapsodyv Jan 4, 2021
8628b41
outdated TFT changes
rhapsodyv Jan 4, 2021
dfdaa88
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/19333
thinkyhead Jan 7, 2021
067d5be
Revert W25Qxx.cpp changes
thinkyhead Jan 7, 2021
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
122 changes: 91 additions & 31 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,20 @@
#define DISABLE_JTAG

//
// Enable SD EEPROM to prevent infinite boot loop
// EEPROM
//
#ifdef ARDUINO_ARCH_STM32
#define FLASH_EEPROM_EMULATION
#if NO_EEPROM_SELECTED
#ifdef ARDUINO_ARCH_STM32
#define FLASH_EEPROM_EMULATION
#else
#define SDCARD_EEPROM_EMULATION
#endif
#endif

#if ENABLED(FLASH_EEPROM_EMULATION)
#define EEPROM_PAGE_SIZE (0x800U) // 2KB
#define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
#define MARLIN_EEPROM_SIZE (EEPROM_PAGE_SIZE)
#else
#define SDCARD_EEPROM_EMULATION
#endif

//
Expand Down Expand Up @@ -102,27 +107,56 @@
#define TEMP_BED_PIN PC0 // TB1

//
// Heaters / Fans
// Heaters
//
#define HEATER_0_PIN PC7 // HEATER1
#define HEATER_1_PIN PA6 // HEATER2
#define HEATER_BED_PIN PC6 // HOT BED

//
// Fan
//
#define FAN_PIN PA7 // FAN

/**
* Note: MKS Robin board is using SPI2 interface. Make sure your stm32duino library is configured accordingly
*/
//
// Thermocouples
//
//#define MAX6675_SS_PIN PE5 // TC1 - CS1
//#define MAX6675_SS_PIN PE6 // TC2 - CS2

//
// Filament runout sensor
//
#define FIL_RUNOUT_PIN PF11 // MT_DET

//
// Power loss detection
//
#define POWER_LOSS_PIN PA2 // PW_DET

//
// Power supply control
//
#define PS_ON_PIN PA3 // PW_OFF
#define FIL_RUNOUT_PIN PF11 // MT_DET

//
// Piezzoelectric speaker
//
#define BEEPER_PIN PC13

//
// Activity LED
//
#define LED_PIN PB2

//
// ESP12-S Wi-Fi module
//
#define WIFI_IO0_PIN PG1

//
// LCD screen
//
#if HAS_FSMC_TFT
/**
* Note: MKS Robin TFT screens use various TFT controllers
Expand Down Expand Up @@ -151,6 +185,7 @@

#define TOUCH_BUTTONS_HW_SPI
#define TOUCH_BUTTONS_HW_SPI_DEVICE 2
#define TFT_BUFFER_SIZE 14400
#endif

#if NEED_TOUCH_PINS
Expand All @@ -161,6 +196,7 @@
#define TOUCH_INT_PIN -1
#endif

// SPI2 is shared by LCD touch driver and flash
// SPI1(PA7) & SPI3(PB5) not available
#define SPI_DEVICE 2

Expand Down Expand Up @@ -193,31 +229,55 @@
#define SD_DETECT_PIN -1
#endif

//
// Trinamic TMC2208/2209 UART
//
#if HAS_TMC_UART
/**
* TMC2208/TMC2209 stepper drivers
* This board does not have dedicated TMC UART pins. Custom wiring is needed.
* You may uncomment one of the options below, or add it to your Configuration.h.
*
* When using up to four TMC2209 drivers, hardware serial is recommented on
* MSerial0 or MSerial1.
*
* Hardware serial communication ports.
* If undefined software serial is used according to the pins below
* When using TMC2208 or more than four drivers, SoftwareSerial will be needed,
* to provide dedicated pins for each drier.
*/
//#define X_HARDWARE_SERIAL MSerial1
//#define Y_HARDWARE_SERIAL MSerial1
//#define Z_HARDWARE_SERIAL MSerial1
//#define E0_HARDWARE_SERIAL MSerial1
//#define E1_HARDWARE_SERIAL MSerial1

// Unused servo pins may be repurposed with SoftwareSerialM
//#define X_SERIAL_TX_PIN PF8 // SERVO3_PIN -- XS2 - 6
//#define Y_SERIAL_TX_PIN PF9 // SERVO2_PIN -- XS2 - 5
//#define Z_SERIAL_TX_PIN PA1 // SERVO1_PIN -- XS1 - 6
//#define E0_SERIAL_TX_PIN PC3 // SERVO0_PIN -- XS1 - 5
//#define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
//#define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
//#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
//#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN

// Reduce baud rate for software serial reliability
#if HAS_TMC_SW_SERIAL

//#define TMC_HARDWARE_SERIAL
#if ENABLED(TMC_HARDWARE_SERIAL)
#define X_HARDWARE_SERIAL MSerial0
#define X2_HARDWARE_SERIAL MSerial0
#define Y_HARDWARE_SERIAL MSerial0
#define Y2_HARDWARE_SERIAL MSerial0
#define Z_HARDWARE_SERIAL MSerial0
#define Z2_HARDWARE_SERIAL MSerial0
#define E0_HARDWARE_SERIAL MSerial0
#define E1_HARDWARE_SERIAL MSerial0
#endif

//#define TMC_SOFTWARE_SERIAL
#if ENABLED(TMC_SOFTWARE_SERIAL)
sjasonsmith marked this conversation as resolved.
Show resolved Hide resolved
#define X_SERIAL_TX_PIN PF8 // SERVO3_PIN -- XS2 - 6
#define Y_SERIAL_TX_PIN PF9 // SERVO2_PIN -- XS2 - 5
#define Z_SERIAL_TX_PIN PA1 // SERVO1_PIN -- XS1 - 6
#define E0_SERIAL_TX_PIN PC3 // SERVO0_PIN -- XS1 - 5
#define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
#define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
#define TMC_BAUD_RATE 19200
#endif
#endif

//
// W25Q64 64Mb (8MB) SPI flash
//
#define HAS_SPI_FLASH 1
#if HAS_SPI_FLASH
#define SPI_FLASH_SIZE 0x800000 // 8MB
#define W25QXX_CS_PIN PG9
#define W25QXX_MOSI_PIN PB15
#define W25QXX_MISO_PIN PB14
#define W25QXX_SCK_PIN PB13
#endif