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

Lerdge S,X,K Board Support #18302

Merged
merged 80 commits into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from 73 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
e3e6482
Pre-requisites for TFT and touch screen support
jmz52 May 27, 2020
639b488
Add support for TFT and touch screen
jmz52 May 27, 2020
dd5f13c
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into tft_and_tou…
jmz52 Jun 1, 2020
ab4ed92
Update Sd2Card_sdio_stm32duino.cpp
thinkyhead Jun 2, 2020
3eada56
Update tft_spi.cpp
thinkyhead Jun 2, 2020
afe667d
No wrapper on headers
thinkyhead Jun 2, 2020
87c957f
Update xpt2046.cpp
thinkyhead Jun 2, 2020
a604a04
No wrappers on headers
thinkyhead Jun 2, 2020
1badfff
Update (c), indentation
thinkyhead Jun 2, 2020
3e25d86
Merge branch 'tft_and_touch_screen' of https://github.com/jmz52/Marli…
jmz52 Jun 2, 2020
dd1aa9a
Fix FSMC initialization for STM32F103Vx MCUs
jmz52 Jun 2, 2020
2d868a8
Add FSMC support for STM32F4xxVx and STM32F4xxZx MCUs
jmz52 Jun 3, 2020
7180660
Improve TFT initialization
jmz52 Jun 10, 2020
f0b03ac
Update Conditionals_LCD.h
thinkyhead Jun 11, 2020
a77b2dc
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into tft_and_tou…
jmz52 Jun 11, 2020
17f4a31
Implement TFT UI for ADVANCED_PAUSE_FEATURE
jmz52 Jun 11, 2020
e7f1b50
Various style adjustments
thinkyhead Jun 11, 2020
fa47c57
…etc…
thinkyhead Jun 11, 2020
fe80e23
Update tft_fsmc.cpp
thinkyhead Jun 12, 2020
ca1b9a9
Implement TFT UI for AUTO_BED_LEVELING_UBL
jmz52 Jun 14, 2020
a7ce846
Merge branch 'tft_and_touch_screen' of https://github.com/jmz52/Marli…
jmz52 Jun 14, 2020
2a9fe2e
STM32 bootloader and MKS encryption scripts
jmz52 Jun 14, 2020
df569e8
Fix compilation errors
jmz52 Jun 14, 2020
b3ff8ef
Basic Lerdge X Support.
xC0000005 Jun 14, 2020
d325d2b
apply formatting
thinkyhead Jun 16, 2020
2a832dd
env:LERDGEX inherits from common_stm32
thinkyhead Jun 16, 2020
8cfffa4
Add CI test
thinkyhead Jun 16, 2020
daaf0c1
Fix pin names
thinkyhead Jun 16, 2020
3e72721
Update LERDGEX-tests
thinkyhead Jun 16, 2020
737e737
Merge branch 'bugfix-2.0.x' into LerdgeXBasicSupport
thinkyhead Jun 16, 2020
9e44367
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into tft_and_tou…
jmz52 Jun 16, 2020
2d8f324
Add conditional and sanity checks
jmz52 Jun 17, 2020
3e90f1d
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into tft_and_tou…
jmz52 Jun 17, 2020
c0a24bb
Slow down FSMC to improve stability
jmz52 Jun 17, 2020
09c87fa
Add new build environment for MKS Robin
jmz52 Jun 17, 2020
eec5965
Restore Configuration.h
jmz52 Jun 17, 2020
8a7afa5
Fix flash size.
xC0000005 Jun 18, 2020
5705b65
Merge commit 'refs/pull/18302/head' of https://github.com/MarlinFirmw…
xC0000005 Jun 18, 2020
37864e0
Merge commit 'refs/pull/18130/head' of https://github.com/MarlinFirmw…
xC0000005 Jun 18, 2020
1b351bb
Get LCD working again.
xC0000005 Jun 18, 2020
d5c95a7
Save PIO changes.
xC0000005 Jun 18, 2020
532ed64
Merge pull request #4 from xC0000005/LCDPR
mapfde Jun 18, 2020
c22e12b
Add base for Lerdge S Pins.
xC0000005 Jun 18, 2020
8bdd225
Merge pull request #5 from xC0000005/LCDPR
mapfde Jun 18, 2020
cfe9992
Change Lerdge variant.
xC0000005 Jun 18, 2020
481bc98
Remove unused vtor define.
xC0000005 Jun 18, 2020
f14b6be
Lerdge-S pins and config
mapfde Jun 20, 2020
534c488
max6675 pins
mapfde Jun 20, 2020
8b6fb24
SPI flash pins
mapfde Jun 20, 2020
8d09576
cleanup and comments, second max6675
mapfde Jun 20, 2020
037ee90
Add Support for Lerdge S.
xC0000005 Jun 22, 2020
d1c18ba
Add env for Lerdge K.
xC0000005 Jun 22, 2020
5705e9e
Restore coniguration.h
xC0000005 Jun 22, 2020
0fd1e8a
Remove massive PR I didn't mean to add.
xC0000005 Jun 22, 2020
3916b28
Add base for Lerdge S Pins.
xC0000005 Jun 18, 2020
347035c
Update pins file.
xC0000005 Jun 22, 2020
d42c9b8
Merge branch 'bugfix-2.0.x' into LerdgeXBasicSupport
thinkyhead Jun 23, 2020
e18f6ee
keep
thinkyhead Jun 23, 2020
7f6f070
Format pins
thinkyhead Jun 23, 2020
524d819
Add thermistor activation.
xC0000005 Jun 23, 2020
831de25
Merge branch 'LerdgeXBasicSupport' of https://github.com/xC0000005/Ma…
xC0000005 Jun 23, 2020
99f84ac
Set pins to correct state.
xC0000005 Jun 23, 2020
a14ccbc
Update temperature pins.
xC0000005 Jun 23, 2020
2792b29
Sigh.
xC0000005 Jun 23, 2020
74fdafe
Double sigh.
xC0000005 Jun 23, 2020
ce45b57
triple sigh
thinkyhead Jun 23, 2020
edeb1c0
Update pins_LERDGE_K.h
thinkyhead Jun 23, 2020
830b0b6
Update pins_LERDGE_S.h
thinkyhead Jun 23, 2020
86064bf
Update pins_LERDGE_X.h
thinkyhead Jun 23, 2020
58c64c1
Update comment to explain pin status.
xC0000005 Jun 24, 2020
0d7e848
Update pins_LERDGE_S.h
thinkyhead Jun 26, 2020
f8ecdb8
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bf2_fix_ler…
thinkyhead Jun 26, 2020
cbddb57
Updated tests location
thinkyhead Jun 26, 2020
99dc0cd
Unified stm32 bootloader support
jmz52 Jun 27, 2020
c0033ca
Work on pins.
xC0000005 Jun 28, 2020
228605b
Merge pull request #11 from jmz52/LerdgeXBasicSupport
xC0000005 Jun 28, 2020
2467fa1
Merge branch 'LerdgeXBasicSupport' of https://github.com/xC0000005/Ma…
xC0000005 Jun 28, 2020
bfe33db
Update pins_LERDGE_K.h
thinkyhead Jul 6, 2020
8931769
Update pins_LERDGE_X.h
thinkyhead Jul 6, 2020
3709bc2
Simpler print
thinkyhead Jul 6, 2020
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
1 change: 1 addition & 0 deletions .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
- rumba32
- mks_robin_pro
- STM32F103RET6_creality
- LERDGEX

# Put lengthy tests last

Expand Down
11 changes: 6 additions & 5 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,12 @@
#define BOARD_BTT_BTT002_V1_0 4211 // BigTreeTech BTT002 v1.0 (STM32F407VG)
#define BOARD_BTT_GTR_V1_0 4212 // BigTreeTech GTR v1.0 (STM32F407IGT)
#define BOARD_LERDGE_K 4213 // Lerdge K (STM32F407ZG)
#define BOARD_LERDGE_X 4214 // Lerdge X (STM32F407VE)
#define BOARD_VAKE403D 4215 // VAkE 403D (STM32F446VET6)
#define BOARD_FYSETC_S6 4216 // FYSETC S6 board
#define BOARD_FLYF407ZG 4217 // FLYF407ZG board (STM32F407ZG)
#define BOARD_MKS_ROBIN2 4218 // MKS_ROBIN2 (STM32F407ZE)
#define BOARD_LERDGE_S 4214 // Lerdge S (STM32F407VE)
#define BOARD_LERDGE_X 4215 // Lerdge X (STM32F407VE)
#define BOARD_VAKE403D 4216 // VAkE 403D (STM32F446VET6)
#define BOARD_FYSETC_S6 4217 // FYSETC S6 board
#define BOARD_FLYF407ZG 4218 // FLYF407ZG board (STM32F407ZG)
#define BOARD_MKS_ROBIN2 4219 // MKS_ROBIN2 (STM32F407ZE)

//
// ARM Cortex M7
Expand Down
10 changes: 9 additions & 1 deletion Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1596,12 +1596,20 @@ void Temperature::init() {
#if MB(RUMBA)
// Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector
#define _AD(N) ANY(HEATER_##N##_USES_AD595, HEATER_##N##_USES_AD8495)
#if _AD(0) || _AD(1) || _AD(2) || _AD(BED) || _AD(CHAMBER)
#if _AD(0) || _AD(1) || _AD(2) || _AD(BED) || _AD(CHAMBER)
MCUCR = _BV(JTD);
MCUCR = _BV(JTD);
#endif
#endif

// Thermistor activation by MCU pin
#if PIN_EXISTS(TEMP_0_TR_ENABLE_PIN)
OUT_WRITE(TEMP_0_TR_ENABLE_PIN, ENABLED(HEATER_0_USES_MAX6675));
#endif
#if PIN_EXISTS(TEMP_1_TR_ENABLE_PIN)
OUT_WRITE(TEMP_1_TR_ENABLE_PIN, ENABLED(HEATER_1_USES_MAX6675));
#endif

#if BOTH(PIDTEMP, PID_EXTRUSION_SCALING)
last_e_position = 0;
#endif
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,10 @@
#include "stm32f4/pins_BTT_BTT002_V1_0.h" // STM32F4 env:BIGTREE_BTT002
#elif MB(LERDGE_K)
#include "stm32f4/pins_LERDGE_K.h" // STM32F4 env:STM32F4
#elif MB(LERDGE_S)
#include "stm32f4/pins_LERDGE_S.h" // STM32F4 env:LERDGE_S
#elif MB(LERDGE_X)
#include "stm32f4/pins_LERDGE_X.h" // STM32F4 env:STM32F4
#include "stm32f4/pins_LERDGE_X.h" // STM32F4 env:LERDGE_X
#elif MB(VAKE403D)
#include "stm32f4/pins_VAKE403D.h" // STM32F4 env:STM32F4
#elif MB(FYSETC_S6)
Expand Down
21 changes: 6 additions & 15 deletions Marlin/src/pins/stm32f4/pins_LERDGE_K.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@
#define TEMP_1_PIN PC2 // Analog Input
#define TEMP_BED_PIN PC0 // Analog Input

// Lergde-S can choose thermocouple/thermistor mode in software.
// For use with thermistors, these pins must be OUT/LOW.

#define TEMP_0_TR_ENABLE_PIN PF10
#define TEMP_1_TR_ENABLE_PIN PF9

//
// Heaters / Fans
//
Expand Down Expand Up @@ -168,18 +174,3 @@
#define BTN_EN1 PE3
#define BTN_EN2 PE4
#define BTN_ENC PE2

//
// ST7920 Delays
//
#if HAS_GRAPHICAL_LCD
#ifndef BOARD_ST7920_DELAY_1
#define BOARD_ST7920_DELAY_1 DELAY_NS(96)
#endif
#ifndef BOARD_ST7920_DELAY_2
#define BOARD_ST7920_DELAY_2 DELAY_NS(48)
#endif
#ifndef BOARD_ST7920_DELAY_3
#define BOARD_ST7920_DELAY_3 DELAY_NS(715)
#endif
#endif
207 changes: 207 additions & 0 deletions Marlin/src/pins/stm32f4/pins_LERDGE_S.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once

#if !defined(STM32F4) && !defined(STM32F4xx)
#error "Oops! Select an STM32F4 board in 'Tools > Board.'"
#elif HOTENDS > 2 || E_STEPPERS > 2
#error "LERDGE S supports up to 2 hotends / E-steppers."
#endif

#define BOARD_INFO_NAME "Lerdge S"
#define DEFAULT_MACHINE_NAME "LERDGE"

#define STEP_TIMER 4
#define TEMP_TIMER 2

//#define I2C_EEPROM

//
// Servos
//
#define SERVO0_PIN PD12 //confirmed
//#define SERVO1_PIN -1

//
// Limit Switches
//
#define X_MIN_PIN PG9 //confirmed
#define Y_MIN_PIN PG10 //confirmed
#define Z_MIN_PIN PG11 //confirmed

#define X_MAX_PIN PG12 //confirmed
#define Y_MAX_PIN PG13 //confirmed
#define Z_MAX_PIN PG14 //confirmed

//
// Filament runout
//
#define FIL_RUNOUT_PIN PC5 //confirmed

//
// Z Probe (when not Z_MIN_PIN)
//
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN PG8 //confirmed
#endif

//
// Steppers
//
#define X_STEP_PIN PF7 //confirmed
#define X_DIR_PIN PF8 //confirmed
#define X_ENABLE_PIN PF6 //confirmed

#define Y_STEP_PIN PF10 //confirmed
#define Y_DIR_PIN PF11 //confirmed
#define Y_ENABLE_PIN PF9 //confirmed

#define Z_STEP_PIN PF13 //confirmed
#define Z_DIR_PIN PF14 //confirmed
#define Z_ENABLE_PIN PF12 //confirmed

#define E0_STEP_PIN PG0 //confirmed
#define E0_DIR_PIN PG1 //confirmed
#define E0_ENABLE_PIN PF15 //confirmed

#define E1_STEP_PIN PG3 //confirmed
#define E1_DIR_PIN PG4 //confirmed
#define E1_ENABLE_PIN PG2 //confirmed

//
// Temperature Sensors
//
#define TEMP_0_PIN PC0 // See below for activation of thermistor readings
#define TEMP_1_PIN PC1 // See below for activation of thermistor readings
#define TEMP_BED_PIN PC3 //confirmed

// Lergde-S can choose thermocouple/thermistor mode in software.
// For use with thermistors, these pins must be OUT/LOW.
#define TEMP_0_TR_ENABLE_PIN PF3
#define TEMP_1_TR_ENABLE_PIN PF4

// MAX6675 Cold-Junction-Compensated K-Thermocouple to Digital Converter (0°C to +1024°C)
// https://datasheets.maximintegrated.com/en/ds/MAX6675.pdf

#define MAX6675_SCK_PIN PB3 // max6675 datasheet: SCK pin, found with multimeter, not tested
#define MAX6675_DO_PIN PB4 // max6675 datasheet: SO pin, found with multimeter, not tested
#define MAX6675_SS_PIN PC4 // max6675 datasheet: /CS pin, found with multimeter, not tested and likely wrong

// Expansion board with second max6675
// Warning: Some boards leave the slot unpopulated.

//#define MAX6675_SCK2_PIN PB3 // max6675 datasheet: SCK pin, found with multimeter, not tested
//#define MAX6675_DO2_PIN PB4 // max6675 datasheet: SO pin, found with multimeter, not tested
//#define MAX6675_SS2_PIN PF1 // max6675 datasheet: /CS pin, found with multimeter, not tested

//
// Heaters / Fans
//
#define HEATER_0_PIN PA0 //confirmed
#define HEATER_1_PIN PA1 //confirmed
#define HEATER_BED_PIN PA3 //confirmed

#define FAN_PIN PA15 // heater 0 fan 1 //confirmed
#define FAN1_PIN PB10 // heater 1 fan 2 //confirmed
#define FAN2_PIN PF5 // heater 0 fan 2 and heater 1 fan 1 (two sockets, switched together) //confirmed

#ifndef E0_AUTO_FAN_PIN
#define E0_AUTO_FAN_PIN PF5
#endif

//
// Prusa i3 MK2 Multi Material Multiplexer Support
//
//#define E_MUX0_PIN -1
//#define E_MUX1_PIN -1

//
// LED / Lighting
//
//Lerdge-S board has two LED connectors (this is the one on the mainboard)
#define CASE_LIGHT_PIN PC7 //confirmed

//on the dual extrusion addon board is a RGB connector
#define RGB_LED_R_PIN PC7 // Shared with the mainboard LED light connector (CASE_LIGHT_PIN), confirmed
#define RGB_LED_G_PIN PB0 //confirmed
#define RGB_LED_B_PIN PB1 //confirmed

//
// Misc. Functions
//
#define SDSS PC11 // SD is working using SDIO, not sure if this definition is needed?
#define LED_PIN PC6 // Mainboard soldered green LED, confirmed
#define PS_ON_PIN PB2 // Board has a power module connector, confirmed
#define KILL_PIN -1 // There is no reset button on the LCD
#define POWER_LOSS_PIN -1 // PB2 could be used for this as well

//
// SD support
//
#define SDIO_SUPPORT

#define SCK_PIN PC12 //confirmed working
#define MISO_PIN PC8 //confirmed working
#define MOSI_PIN PD2 //confirmed working
#define SS_PIN PC11 //confirmed working

#define SD_DETECT_PIN PG15 //confirmed

//
// Persistent Storage
// If no option is selected below the SD Card will be used
// (this section modelled after pins_LONGER3D_LK.h)
// Warning: Not tested yet! Pins traced with multimeter, mistakes are possible
//#define SPI_EEPROM

#if ENABLED(SPI_EEPROM)
// Lerdge has an SPI EEPROM Winbond W25Q128 (128Mbits) https://www.pjrc.com/teensy/W25Q128FV.pdf
#define SPI_CHAN_EEPROM1 1
#define SPI_EEPROM1_CS PB12 // datasheet: /CS pin, found with multimeter, not tested
#define EEPROM_SCK PB13 // datasheet: CLK pin, found with multimeter, not tested
#define EEPROM_MISO PB14 // datasheet: DO pin, found with multimeter, not tested
#define EEPROM_MOSI PB15 // datasheet: DI pin, found with multimeter, not tested
#define EEPROM_PAGE_SIZE 0x1000U // 4KB (from datasheet)
#define MARLIN_EEPROM_SIZE 16UL * (EEPROM_PAGE_SIZE) // Limit to 64KB for now...
#else
#define MARLIN_EEPROM_SIZE 0x800U // On SD, Limit to 2KB, require this amount of RAM
#endif

//
// LCD / Controller
//

// The LCD is initialized in FSMC mode
#define BEEPER_PIN PD13 //confirmed

#define BTN_EN1 PC14 //confirmed
#define BTN_EN2 PC15 //confirmed
#define BTN_ENC PC13 //confirmed

#define TFT_RESET_PIN PD6 // unchecked, unsure how to test
#define TFT_BACKLIGHT_PIN PD3 //confirmed (well, this pin switches the LCD off, but I cannot see if it is only the backlight)

#define TFT_CS_PIN PD7 // TFT works
#define TFT_RS_PIN PD11 // TFT works

// There is touch, but calibration is off
#define TOUCH_CS_PIN PB6
#define TOUCH_SCK_PIN PB3
#define TOUCH_MOSI_PIN PB5
#define TOUCH_MISO_PIN PB4
Loading