MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.28k stars 19.24k forks source link

[BUG] Blank LCD on Ender 2 with SKR 1.3 board, with stock LCD #15624

Closed greppp closed 4 years ago

greppp commented 5 years ago

Hi, I have a Creality Ender 2, I just got an SKR 1.3 board, and after compiling Marlin 2.0 and putting it on the SD card, rebooting the board, the screen is lit (backlight) but blank.

I have nothing plugged on the board except a usb cable, the stock lcd screen (which works normally when i plug it on the stock creality ender 2 motherboard).

I am trying to understand where the problem comes from but it looks like it might be the configuration in Marlin?

Looking here : https://www.reddit.com/r/ender2/comments/cwxqra/pinout_for_ender2_lcd/ it looks like some people also have issue with this screen.

Thanks

Steps to Reproduce

  1. Succesfully compile marlin 2.0 with Ender 2 config
  2. Copy/paste bin file to sd card
  3. Put sd file in SKR 1.3 not populated except stock lcd screen plugged in EXP1

Expected behavior: See stuff on the screen

Actual behavior: Screen backlit but does not display anything

Additional Information

edwilliams16 commented 5 years ago

You'll need to do this if there's a possible problem with your configuration: Include a ZIP file containing your Configuration.h and Configuration_adv.h files.

greppp commented 5 years ago

@edwilliams16 thanks, i edited my initial post to add the zip.

greppp commented 5 years ago

Update : someone with the same setup than me ( SKR 1.3 + Ender 2) sent me a firmware.bin file and the screen works! The first time i put his firmware it didn't work and after going through the pdf guide it says one has to press the red button and wait 10sc for the changes to takes effect, and after waiting it worked.

greppp commented 5 years ago

Update 2 : I just tried my version and it doesn't work, blank screen again.

greppp commented 5 years ago

semi-related, but in https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/config/examples/Creality/Ender-2/Configuration.h (which i used) line 150, it says filament diameter is 3mm, which isn't true, the ender 2 uses 1.75mm. Are those config files reliable?

greppp commented 5 years ago

Update 3 : The user who sent me the binary file shared me his fork : https://github.com/xyyx/Marlin/tree/bugfix-2.0.x

I compiled it and now the screen works perfectly. It looks like he added a new entry in Configuration.h named #define ENDER2_DISPLAY on line #1943.

Then when I compile I get a lot of warnings from Marlin/src/pins/lpc1768/pins_BIGTREE_SKR_V1.3.h which i guess means that's where he defined the right pins for the ENDER2_DISPLAY?

 #if ENABLED(ENDER2_DISPLAY)
        #define BTN_EN1      P1_18
        #define BTN_EN2      P1_20
        #define DOGLCD_CS    P1_22
        #define DOGLCD_A0    P1_21
        #define DOGLCD_SCK   P1_30
        #define DOGLCD_MOSI  P1_23
        #define FORCE_SOFT_SPI
        #define LCD_BACKLIGHT_PIN -1
      #endif

I hope this helps to fix the problem in the official branch :)

boelle commented 5 years ago

@shitcreek could we extract something and make a quick (but stable) fix?

imcauseofdeath commented 5 years ago

Update 3 : The user who sent me the binary file shared me his fork : https://github.com/xyyx/Marlin/tree/bugfix-2.0.x

I compiled it and now the screen works perfectly. It looks like he added a new entry in Configuration.h named #define ENDER2_DISPLAY on line #1943.

Then when I compile I get a lot of warnings from Marlin/src/pins/lpc1768/pins_BIGTREE_SKR_V1.3.h which i guess means that's where he defined the right pins for the ENDER2_DISPLAY?

 #if ENABLED(ENDER2_DISPLAY)
        #define BTN_EN1      P1_18
        #define BTN_EN2      P1_20
        #define DOGLCD_CS    P1_22
        #define DOGLCD_A0    P1_21
        #define DOGLCD_SCK   P1_30
        #define DOGLCD_MOSI  P1_23
        #define FORCE_SOFT_SPI
        #define LCD_BACKLIGHT_PIN -1
      #endif

I hope this helps to fix the problem in the official branch :)

Does anyone know if it is possible to use this Ender 2 fix for the SKR Mini E3 board as well? I want to make sure it is possible before I try to track down everything this person has done to get it to work.

Also having another strange issue on my mini board for my Ender 2. Heating up my bed also heats the hotend without stopping the hotend. But only heating the hotend, only heats the hotend?? Idk.

Thanks!

Grrby commented 5 years ago

Hi, After planing around, my Ender2 display works with SKR MINI E3. I just copy solution from SKR 1.3 board and assigned proper stm32 pins. So I added ENDER2_DISPLAY to Marlin/src/pins/lpc1768/pins_BIGTREE_SKR_E3_DIP.h

`#if HAS_SPI_LCD
  #define BEEPER_PIN       PA15
  #define BTN_ENC          PB6

  #if ENABLED(CR10_STOCKDISPLAY)
    #define LCD_PINS_RS    PB8

    #define BTN_EN1        PA9
    #define BTN_EN2        PA10

    #define LCD_PINS_ENABLE PB7
    #define LCD_PINS_D4    PB9

  //#else
    //#error "Only CR10_STOCKDISPLAY is currently supported on the BIGTREE_SKR_E3_DIP."
  #endif
 /////////////////////////////////////////////////////////////////////////////////////////

      #if ENABLED(ENDER2_DISPLAY)
        #define BTN_EN1      PA9
        #define BTN_EN2      PA10
        #define DOGLCD_CS    PB8
        #define DOGLCD_A0    PB9
        #define DOGLCD_SCK   PA15
        #define DOGLCD_MOSI  PB7
        #define FORCE_SOFT_SPI
        #define LCD_BACKLIGHT_PIN -1
      #endif

  //#endif

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#endif // HAS_SPI_LCD`

I had problem with error marlin #error "Please select no more than one LCD controller option." during compilation comes from SanityCheck.h. I found a solution here https://github.com/MarlinFirmware/Marlin/issues/5545 and I disabled SanityCheck.h at `#if COUNT_LCD_24 > 1

error "Please select no more than one LCD controller option."

endif`

Maybe someone will find better and more elegant solution.

imcauseofdeath commented 5 years ago

Regarding the 2 display error, just uncomment one of the displays so you're only keeping one display marked as active. Right? Or is it something different. I haven't looked at the link given with your explanation.

Thank you for the info by the way. My biggest issue is still the fact my hotend and bed heat up when I try to preheat the bed only.

On Fri, Nov 1, 2019, 15:21 Grrby notifications@github.com wrote:

Hi, After planing around, my Ender2 display works with SKR MINI E3. I just copy solution from SKR 1.3 board and assigned proper stm32 pins. So I added ENDER2_DISPLAY to Marlin/src/pins/lpc1768/pins_BIGTREE_SKR_E3_DIP.h

`#if HAS_SPI_LCD

define BEEPER_PIN PA15

define BTN_ENC PB6

if ENABLED(CR10_STOCKDISPLAY)

define LCD_PINS_RS PB8

define BTN_EN1 PA9

define BTN_EN2 PA10

define LCD_PINS_ENABLE PB7

define LCD_PINS_D4 PB9

//#else //#error "Only CR10_STOCKDISPLAY is currently supported on the BIGTREE_SKR_E3_DIP."

endif

/////////////////////////////////////////////////////////////////////////////////////////

if ENABLED(ENDER2_DISPLAY)

#define BTN_EN1      PA9
#define BTN_EN2      PA10
#define DOGLCD_CS    PB8
#define DOGLCD_A0    PB9
#define DOGLCD_SCK   PA15
#define DOGLCD_MOSI  PB7
#define FORCE_SOFT_SPI
#define LCD_BACKLIGHT_PIN -1

endif

//#endif

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

endif // HAS_SPI_LCD`

I had problem with error marlin #error "Please select no more than one LCD controller option." during compilation comes from SanityCheck.h. I found a solution here https://github.com/MarlinFirmware/Marlin/issues/5545 http://url and I disabled SanityCheck.h at

if COUNT_LCD_24 > 1 #error "Please select no more than one LCD controller

option." #endif

Maybe someone will find better and more elegant solution.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/15624?email_source=notifications&email_token=AA5O2XQJKJFCBLOGO264CDTQRQ3PDA5CNFSM4JDIIYR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC3BWVQ#issuecomment-548805462, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5O2XQ5L7JAOTCMGFLXR4DQRQ3PDANCNFSM4JDIIYRQ .

Grrby commented 5 years ago

Actually I can't understand issue with this error because if I change display type to default CR10, error gone, even ENDER2_DISPLAY is on the SanityCheck.h display list. When I change display in Configuration.h to Ender2 I have error again.

/**
 * Make sure only one display is enabled
 */
#if 1 < 0 \
  + (ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) && DISABLED(IS_RRD_SC)) \
  + (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(IS_RRD_FG_SC)) \
  + (ENABLED(ULTRA_LCD) && DISABLED(IS_ULTRA_LCD)) \
  + (ENABLED(U8GLIB_SSD1306) && DISABLED(IS_U8GLIB_SSD1306)) \
  + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \
  + (ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(IS_RRW_KEYPAD)) \
  + (ENABLED(EXTENSIBLE_UI) && DISABLED(IS_EXTUI)) \
  + (ENABLED(ULTIPANEL) && DISABLED(IS_ULTIPANEL)) \
  + ENABLED(RADDS_DISPLAY) \
  + ENABLED(ULTIMAKERCONTROLLER) \
  + ENABLED(PANEL_ONE) \
  + ENABLED(G3D_PANEL) \
  + ENABLED(RIGIDBOT_PANEL) \
  + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
  + ENABLED(ZONESTAR_LCD) \
  + ENABLED(RA_CONTROL_PANEL) \
  + ENABLED(LCD_SAINSMART_I2C_1602) \
  + ENABLED(LCD_SAINSMART_I2C_2004) \
  + ENABLED(LCM1602) \
  + ENABLED(LCD_I2C_PANELOLU2) \
  + ENABLED(LCD_I2C_VIKI) \
  + ENABLED(SAV_3DLCD) \
  + ENABLED(FF_INTERFACEBOARD) \
  + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \
  + ENABLED(VIKI2) \
  + ENABLED(miniVIKI) \
  + ENABLED(MAKRPANEL) \
  + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  + ENABLED(BQ_LCD_SMART_CONTROLLER) \
  + ENABLED(CARTESIO_UI) \
  + ENABLED(LCD_FOR_MELZI) \
  + ENABLED(ULTI_CONTROLLER) \
  + ENABLED(MKS_MINI_12864) \
  + ENABLED(ENDER2_DISPLAY) \
  + ENABLED(FYSETC_MINI_12864_X_X) \
  + ENABLED(FYSETC_MINI_12864_1_2) \
  + ENABLED(FYSETC_MINI_12864_2_0) \
  + ENABLED(FYSETC_MINI_12864_2_1) \
  + ENABLED(CR10_STOCKDISPLAY) \
  + ENABLED(ANET_FULL_GRAPHICS_LCD) \
  + ENABLED(AZSMZ_12864) \
  + ENABLED(SILVER_GATE_GLCD_CONTROLLER) \
  + ENABLED(SAV_3DGLCD) \
  + ENABLED(OLED_PANEL_TINYBOY2) \
  + ENABLED(MKS_12864OLED) \
  + ENABLED(MKS_12864OLED_SSD1306) \
  + ENABLED(U8GLIB_SH1106_EINSTART) \
  + ENABLED(OVERLORD_OLED) \
  + ENABLED(DGUS_LCD) \
  + ENABLED(MALYAN_LCD) \
  + ENABLED(LULZBOT_TOUCH_UI) \
  + ENABLED(FSMC_GRAPHICAL_TFT)
  //#error "Please select no more than one LCD controller option."
  #if COUNT_LCD_24 > 1
    #error "Please select no more than one LCD controller option."
  #endif
#endif

About your issue with preheating, I have to check with my printer. I use fresh version of Marlin-bugfix-2.0.x and I have SKR MINI E3 DIP v1.0. What I noticed heating up is slightly slower then on original Melzi board.

imcauseofdeath commented 5 years ago

Heating is definitely a bit slower I have noticed. But yeah, my hotend heats up when I try to ONLY heat the bed. When I heat only the heat end, only the heat end heats up.

It's strange and I haven't figured it out.

On Fri, Nov 1, 2019, 23:44 Grrby notifications@github.com wrote:

Actually I can't understand issue with this error because if I change display type to default CR10, error gone, even ENDER2_DISPLAY is on the SanityCheck.h display list. When I change display in Configuration.h to Ender2 I have error again. About your issue with preheating, I have to check with my printer. I use fresh version of Marlin-bugfix-2.0.x and I have SKR MINI E3 DIP v1.0. What I noticed heating up is slightly slower then on original Melzi board.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/15624?email_source=notifications&email_token=AA5O2XSQE7I5K2OWTWH54XTQRSWLDA5CNFSM4JDIIYR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC4LBUY#issuecomment-548974803, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5O2XUG6DVRDA3G6ACQ6X3QRSWLDANCNFSM4JDIIYRQ .

boelle commented 5 years ago

@greppp still having issues?

Grrby commented 5 years ago

For me problem is with Marlin2.0. For example, I compile everything without any warnings but when I comment MENU_HOLLOW_FRAME (what I like very much) I have a bunch of warning and display randomly shift few line up. Maybe there is some problem with my "Ender2 display solution". What is strange, after some random time display is blank but machine still working well. I saw similar issue with SKR 1.3

I don't have any problem with heating separately bed / nozzle in any configuration. Anyway heating up is so slow, mostly hotend.

greppp commented 5 years ago

@boelle i haven't had time to work further on it yet, just learned how to fork Marlin today. Haven't printed with it either. I will try to test everything in the next two weeks. Also user xyyx told me "Ender 2 with software SPI has one trouble. Sometimes display has garbage during printing. But nothing seriously"

imcauseofdeath commented 5 years ago

Actually I can't understand issue with this error because if I change display type to default CR10, error gone, even ENDER2_DISPLAY is on the SanityCheck.h display list. When I change display in Configuration.h to Ender2 I have error again.

/**
 * Make sure only one display is enabled
 */
#if 1 < 0 \
  + (ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) && DISABLED(IS_RRD_SC)) \
  + (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(IS_RRD_FG_SC)) \
  + (ENABLED(ULTRA_LCD) && DISABLED(IS_ULTRA_LCD)) \
  + (ENABLED(U8GLIB_SSD1306) && DISABLED(IS_U8GLIB_SSD1306)) \
  + (ENABLED(MINIPANEL) && DISABLED(MKS_MINI_12864)) \
  + (ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(IS_RRW_KEYPAD)) \
  + (ENABLED(EXTENSIBLE_UI) && DISABLED(IS_EXTUI)) \
  + (ENABLED(ULTIPANEL) && DISABLED(IS_ULTIPANEL)) \
  + ENABLED(RADDS_DISPLAY) \
  + ENABLED(ULTIMAKERCONTROLLER) \
  + ENABLED(PANEL_ONE) \
  + ENABLED(G3D_PANEL) \
  + ENABLED(RIGIDBOT_PANEL) \
  + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
  + ENABLED(ZONESTAR_LCD) \
  + ENABLED(RA_CONTROL_PANEL) \
  + ENABLED(LCD_SAINSMART_I2C_1602) \
  + ENABLED(LCD_SAINSMART_I2C_2004) \
  + ENABLED(LCM1602) \
  + ENABLED(LCD_I2C_PANELOLU2) \
  + ENABLED(LCD_I2C_VIKI) \
  + ENABLED(SAV_3DLCD) \
  + ENABLED(FF_INTERFACEBOARD) \
  + ENABLED(REPRAPWORLD_GRAPHICAL_LCD) \
  + ENABLED(VIKI2) \
  + ENABLED(miniVIKI) \
  + ENABLED(MAKRPANEL) \
  + ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
  + ENABLED(BQ_LCD_SMART_CONTROLLER) \
  + ENABLED(CARTESIO_UI) \
  + ENABLED(LCD_FOR_MELZI) \
  + ENABLED(ULTI_CONTROLLER) \
  + ENABLED(MKS_MINI_12864) \
  + ENABLED(ENDER2_DISPLAY) \
  + ENABLED(FYSETC_MINI_12864_X_X) \
  + ENABLED(FYSETC_MINI_12864_1_2) \
  + ENABLED(FYSETC_MINI_12864_2_0) \
  + ENABLED(FYSETC_MINI_12864_2_1) \
  + ENABLED(CR10_STOCKDISPLAY) \
  + ENABLED(ANET_FULL_GRAPHICS_LCD) \
  + ENABLED(AZSMZ_12864) \
  + ENABLED(SILVER_GATE_GLCD_CONTROLLER) \
  + ENABLED(SAV_3DGLCD) \
  + ENABLED(OLED_PANEL_TINYBOY2) \
  + ENABLED(MKS_12864OLED) \
  + ENABLED(MKS_12864OLED_SSD1306) \
  + ENABLED(U8GLIB_SH1106_EINSTART) \
  + ENABLED(OVERLORD_OLED) \
  + ENABLED(DGUS_LCD) \
  + ENABLED(MALYAN_LCD) \
  + ENABLED(LULZBOT_TOUCH_UI) \
  + ENABLED(FSMC_GRAPHICAL_TFT)
  //#error "Please select no more than one LCD controller option."
  #if COUNT_LCD_24 > 1
    #error "Please select no more than one LCD controller option."
  #endif
#endif

About your issue with preheating, I have to check with my printer. I use fresh version of Marlin-bugfix-2.0.x and I have SKR MINI E3 DIP v1.0. What I noticed heating up is slightly slower then on original Melzi board.

By the way, you have done PID tune for your hotend right?

imcauseofdeath commented 5 years ago

Regarding the 2 display error, just uncomment one of the displays so you're only keeping one display marked as active. Right? Or is it something different. I haven't looked at the link given with your explanation. Thank you for the info by the way. My biggest issue is still the fact my hotend and bed heat up when I try to preheat the bed only. On Fri, Nov 1, 2019, 15:21 Grrby @.***> wrote: Hi, After planing around, my Ender2 display works with SKR MINI E3. I just copy solution from SKR 1.3 board and assigned proper stm32 pins. So I added ENDER2_DISPLAY to Marlin/src/pins/lpc1768/pins_BIGTREE_SKR_E3_DIP.h #if HAS_SPI_LCD #define BEEPER_PIN PA15 #define BTN_ENC PB6 #if ENABLED(CR10_STOCKDISPLAY) #define LCD_PINS_RS PB8 #define BTN_EN1 PA9 #define BTN_EN2 PA10 #define LCD_PINS_ENABLE PB7 #define LCD_PINS_D4 PB9 //#else //#error "Only CR10_STOCKDISPLAY is currently supported on the BIGTREE_SKR_E3_DIP." #endif ///////////////////////////////////////////////////////////////////////////////////////// #if ENABLED(ENDER2_DISPLAY) #define BTN_EN1 PA9 #define BTN_EN2 PA10 #define DOGLCD_CS PB8 #define DOGLCD_A0 PB9 #define DOGLCD_SCK PA15 #define DOGLCD_MOSI PB7 #define FORCE_SOFT_SPI #define LCD_BACKLIGHT_PIN -1 #endif //#endif //////////////////////////////////////////////////////////////////////////////////////////////////////////////// #endif // HAS_SPI_LCD I had problem with error marlin #error "Please select no more than one LCD controller option." during compilation comes from SanityCheck.h. I found a solution here #5545 http://url and I disabled SanityCheck.h at #if COUNT_LCD_24 > 1 #error "Please select no more than one LCD controller option." #endif Maybe someone will find better and more elegant solution. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#15624?email_source=notifications&email_token=AA5O2XQJKJFCBLOGO264CDTQRQ3PDA5CNFSM4JDIIYR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC3BWVQ#issuecomment-548805462>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5O2XQ5L7JAOTCMGFLXR4DQRQ3PDANCNFSM4JDIIYRQ .

Regarding my issue with preheating the bed and the hotend also starts heating

I tested tonight with a voltmeters and as soon as I preheat the bed the hotend is also (obviously) receiving 11.6V same as the heat bed side. I had to make videos of this to send to BTT. Hoping for quick replacements, my Ender 2 is down until the new one comes in. Unfortunately I had already purchased a CR10 display before finding this thread also so I doubt I'll be testing the code from above. We'll see though.

Thanks again everyone.

Grrby commented 5 years ago

By the way, you have done PID tune for your hotend

Maybe I should but I didn't make any PID tuning. Prints looks good so I don't care :-)

I tested tonight with a voltmeters and as soon as I preheat the bed the hotend is also (obviously) receiving 11.6V same as the heat bed side.

This is obviously and maybe not means that your board is faulty. Are you using latest Marlin? Take close look at pins 39 and 40 of STM32, can be a shorts around those pins or near mosfets.

imcauseofdeath commented 5 years ago

You for sure should do PID tune. It keeps your hotend temperature from fluctuating too much and allows for faster heating. You can do an autotune and store the settings.

I am running 2.0.x bugfix. I'll try to check the pins. Just hoping that biqu stops making me go back and forth proving to them that something is faulty.

On Fri, Nov 8, 2019, 00:58 Grrby notifications@github.com wrote:

By the way, you have done PID tune for your hotend right? Maybe I should but I didn't make any PID tune. Prints looks good so I don't care :-)

I tested tonight with a voltmeters and as soon as I preheat the bed the hotend is also (obviously) receiving 11.6V same as the heat bed side. This is obviously and maybe not means that your board is faulty. Are you using latest Marlin? Take close look at pins 39 and 40 of STM32, can be a shorts around those pins or near mosfets.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/15624?email_source=notifications&email_token=AA5O2XT5W243CPMBH5J6RTDQSSTUBA5CNFSM4JDIIYR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDOH7QI#issuecomment-551321537, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5O2XU2CTMPLOZAG6LFIEDQSSTUBANCNFSM4JDIIYRQ .

TheAssassin commented 5 years ago

Could anyone provide a full, working Marlin source tree with which the Ender 2 display works? Randomly combining stuff I read here once made the display work for ~10 minutes before the printer froze mid-print, now I don't get it to work at all any more. A zip would be fine, I will identify the changes and once it works set up a Git repo. I have an SKR E3 DIP v1.0 with the STM32F103RE (not RC, RE has bigger flash size) on an Ender 2 with the stock display.

Grrby commented 5 years ago

Welcome

https://github.com/Grrby/Marlin

All files needed for SKR E3 DIP v1.0 and TMC2130 with latest Marlin-bugfix-2.0.x I have STM32F103RE as well but I compiled for STM32F103RC, so it's not enough room for full option like mesh bedleveling. I'll try to change to RE version. Important notice.

TheAssassin commented 5 years ago

Thanks @Grrby. I've already set up PlatformIO to build binaries for the RE chip, I plan to send those changes upstream once I know everything works. I used to compile for RC as well, I know it works, too.

I have TMC2208 drivers.

In fact I recently updated platformio to 4.1.0, but the board does seem to flash the firmware. (Note: my board came without a bootloader, I thankfully found a GitHub issue where someone provided their bootloader which I could flash with an ST-Link v2). But I'll downgrade for testing, thanks for the hint.

I'll check your configs, if they should happen to work, I'll publish everything soon-ish.

Grrby commented 5 years ago

To be clear, display works but not perfect. There is some field for improvement. Sometimes there is a few top/bottom lines shift and sometimes display going to be blank (printer still working). I don't know why. Anyway better then nothing or attaching additional display.

TheAssassin commented 5 years ago

@Grrby okay, I've started over, adapted your configs a bit to suit my printer, and the display is alive again. I'm going to check where there's differences to my old configs.

TheAssassin commented 5 years ago

Turns out my existing configuration worked as-is, all that broke the display is the upgrade of PlatformIO. Now this really shouldn't happen, but it's good we know about the issue now. Thanks @Grrby for the pointer.

Edit: Yeah, I also noticed those line shifts etc., all I was interested in was getting it to run at all again. I also noticed the print was interrupted once, since the board froze. I'd like to see these issues fixed as well. Please let me know what I can do to assist debugging.

Grrby commented 5 years ago

Hmmm, I hadn't any issue with print interruption. Printer work great. Only display sometimes going crazy.

TheAssassin commented 5 years ago

FWIW, a (1h) print finished just fine, and when I returned to the printer (~2 hours after start) the display is blank again. Weird.

Grrby commented 5 years ago

Same issue. I have to try comment #define BEEPER_PIN PA15 in pins definition file because pin PA15 is defined later as SPI Clock ( #define DOGLCD_SCK) I see that even for default display was some problems/bugs https://github.com/MarlinFirmware/Marlin/issues/15141

BTW Can you tell how to use STM32F103RE instead STM32F103RC ?

TheAssassin commented 5 years ago

You basically need two extra files in buildroot that define the chip's layout, and a new env in platformio.cfg. I'll quickly push my changes to a new GitHub repo. Give me a few minutes please.

TheAssassin commented 5 years ago

https://github.com/MarlinFirmware/Marlin/compare/bugfix-2.0.x...TheAssassin:fix-ender-2-display-skr-e3-dip

There you go!

TheAssassin commented 5 years ago

Yet again, started a print, then weird 10%-of-screen-shifted-to-bottom, now after ~30 minutes screen is blank (but it's still printing from the SD card just fine).

Could this be a kind of timing/clock issue caused by us using software simulated SPI?

TheAssassin commented 5 years ago

Here's an example of what "shifted" means on my printer:

broken_display_output

Perhaps it helps finding the cause of the issue.

Grrby commented 5 years ago

@TheAssassin Thank you! It is exactly the same problem. Is some way it's good that we can reproduce this issue.
Maybe problem caused by software SPI but from the other hand, default display is drive in the same way. My way of adapting Ender2 display is just copy/paste of solution from SKR V1.3 (LPC1768).

I've found something related https://github.com/MarlinFirmware/Marlin/issues/13550

TheAssassin commented 5 years ago

Maybe problem caused by software SPI but from the other hand, default display is drive in the same way.

Are you sure it's driven through software SPI? Can you provide a reference? (I wonder how Creality did it in the original firmware...)

I wonder whether SKR 1.3 owners have the same problem. After all, they're both ARM Cortex M3 based. I also wonder why software SPI is needed at all; STM32 chips have a hardware SPI bus. But I guess there's a reason, even if it's just that that bus is used by other functionality or incompatible wiring or anything...

Grrby commented 5 years ago

Are you sure it's driven through software SPI? Can you provide a reference? (I wonder how Creality did it in the original firmware...)

I'm sure. Just take a look at STM32F103RC datasheet and/or SKR mini E3 schematic. STM32 in LQFP64 has two hardware SPI. One in use for r/w SD (SPI1) and second one (SPI3) is used for TMC drivers,. You can read from board schematic which pins are used for LCD (TX1, RX1, SCL1, SDA1 etc). No hardware SPI on any LCD, CR10 or anything else are connected by software SPI .

Update. I was wrong about two hardware SPI of STM32F103RC LQFP64. There is SPI2 but those pins are used for stepper drivers. Anyway, my general statement about software SPI is true.

TheAssassin commented 4 years ago

While playing with a few settings, I noticed an SPI related section. It doesn't explicitly mention software SPI nor does it mention displays, however, as far as I can see, both the SD card and the display are controlled over software SPI on the S3 DIP.

/**
 * SD CARD: SPI SPEED
 *
 * Enable one of the following items for a slower SPI transfer speed.
 * This may be required to resolve "volume init" errors.
 */
#define SPI_SPEED SPI_HALF_SPEED
//#define SPI_SPEED SPI_QUARTER_SPEED
//#define SPI_SPEED SPI_EIGHTH_SPEED

Cutting the speed in half changes the behavior. Now, I haven't seen any shifting, instead the contrast has dropped after a while to a really low value. I'd call that progress, since I can still control the printer this way. (Edited the picture a bit to make it look somewhat like on the printer).

out

I'll try reducing the SPI speed for the next prints. Also I'll re-check later whether the display goes blank again. But my best guess now is that this problem is:

Edit: Oh, and I noticed another problem. The Z height is set to some weird values, clearly not the 0.2 steps I set in my slicer. Right now we're at 2.84, in the screenshot at 1.88. Has anyone seen anything similar? (I'm printing from SD right now, I don't think this bug existed when printing with OctoPrint, I remember some nice calibration cubes, but I might be wrong, I'll test that later.)

Update (+22 min): I had to abort the print a few minutes ago, this weird layer height problem caused a serious overextrusion and the nozzle was hitting the rough surface all the time. Now, the display went blank again.

Grrby commented 4 years ago

All your "new" problems is a consequence of changing SD SPI speed I guess. I've changed SPI_SPEED from 0 (fast) to 2 (slow) at u8g_com_stm32duino_swspi.cpp but without success, maybe a little bit better.

TheAssassin commented 4 years ago

The layer height thingy is not a "new" problem, it's always been there when printing from SD.

Grrby commented 4 years ago

I don't observe this behavior. Info on the scree following my slicer settings (I use Ideamaker 3.5 Beta and Cura 4.3.0) BTW Looks like I've solved display problem :-) I'm still testing but after ~1h of operation I don't have display issue.

Grrby commented 4 years ago

Final solution for Ender2 display on SKR Mini E3 Forgot about everything from my previous posts. All what you need is to add new pins definition to pins_BIGTREE_SKR_E3_DIP.h (or pins_BIGTREE_SKR_MINI_E3.h if have this one)

#if ENABLED(CR10_STOCKDISPLAY)
    #define LCD_PINS_RS    PB8

    #define BTN_EN1        PA9
    #define BTN_EN2        PA10

    #define LCD_PINS_ENABLE PB7
    #define LCD_PINS_D4    PB9

  //#else
    //#error "Only CR10_STOCKDISPLAY is currently supported on the BIGTREE_SKR_E3_DIP."
  #endif
 /////////////////////////////////////////////////////////////////////////////////////////
 /**ENDER2 MINIDISPLAY
 *                   _____
 *               5V | · · | GND
 *      (MOSI) PB7  | · · | PB8  (LCD_RS)
 *    (LCD_A0) PB9  | · · | PA10 (BTN_EN2)
 *            RESET | · · | PA9  (BTN_EN1)
 *   (BTN_ENC) PB6  | · · | PA15 (SCK)
 *                   -----
 *                    EXP1
 */

      #if ENABLED(MKS_MINI_12864)
        #define BTN_EN1      PA9
        #define BTN_EN2      PA10
        #define DOGLCD_CS    PB8
        #define DOGLCD_A0    PB9
        #define DOGLCD_SCK   PA15
        #define DOGLCD_MOSI  PB7
        #define FORCE_SOFT_SPI
        #define LCD_BACKLIGHT_PIN -1
      #endif

  //#endif

Next at Configuration.h, comment //#define CR10_STOCKDISPLAY and uncomment #define MKS_MINI_12864

That's all. Display works perfect.

TheAssassin commented 4 years ago

Interesting. I can't see which pin caused the trouble (I suspect it's CD_RS, but that's just a guess right now). Thanks. I'll try it on vanilla Marlin, and if it works will send a PR.

Edit: seems to work, however I always have to set the LCD contrast on startup. I'll check if I can just change it in the config.

Grrby commented 4 years ago

I've tested this solution all day and no display issue. On Marlin 2.0 and Melzi board MKS_MINI_12864 is used. So decided to test is, I've just added pins decision which I already defined before. I didn't modified contrast or anything else lcd related.

I'm new to Github and I'm still learning how to use is, so please do whatever is helpful for other user. Ender2 is a bit forgotten in Ender3 era, but I'm sure lot of people still use it. Upgrading the board is one of the best upgrade. I have both of those printers but I like Ender 2 very much and this is my workhorse. My Ender3 waiting for swapping the board, I bought SKR Mini E3 V1.2 and happy that STM32F103RC has unexpected 512kB

TheAssassin commented 4 years ago

Yeah, I love my Ender 2, it's my portable printer. If my bed wasn't so warped already in the corner on the upper left, I'd use it much more often. Defining a default contrast in Configuration.h removes that contrast option. I like a contrast of 150.

TheAssassin commented 4 years ago

You have the SKR E3 Mini, right? I'm adding the pins definition for this board as well, and I need a tester. When I prepare the PR, you can just clone that branch then, put your Configuration.h and Configuration_adv.h in, build and test. Would you like to do that?

Grrby commented 4 years ago

Sure. Yes, I have SKR Mini E3 V1.2. Still in the box :-). My plan is to use on my Ender3 but I can do some test before. BTW BIGTREETECH just started to sell TFT35 E3 V3.0, super cool "dual" display for ender3. I don't know if is allowed to put link here to Ali.

TheAssassin commented 4 years ago

Sure, why not? I already thought about adding one, but then I thought I should rather add a TFT24, as it's more compact. However, now that the default display works again, that'll do for now. Most interesting for me however is printing directly from a USB stick. Micro SD cards are super annoying.

Grrby commented 4 years ago

Micro SD is an nightmare. I have original encloser on my Ender2 and SKR board is bit shorter then Melzi, so now I need tweezers to remove SD. I'm going to cutout a base for better access.

https://pl.aliexpress.com/item/4000349509983.html I just don't understand what means Limited Price and Original Price (price is different ofc but I can't realize is there any difference in product)

TheAssassin commented 4 years ago

You probably saw that I already laser cut a new case out of HDF/Hardboard at a local FabLab. I have tons of old small USB2 pen drives, which I want to use there.

ender2_custom_enclosure_front

(I forgot the cutout in the front and had to do it with a crappy saw, today I filed it a bit bigger on the right to allow me to grab the micro SD more easily with two fingers.)

Grrby commented 4 years ago

You integrated video projector as well :-)

TheAssassin commented 4 years ago

Not quite, just a 12V on/off switch. The flash just makes it look strange.

ender2_custom_enclosure_front_2

The stock Ender 2 board had two pins for a power switch, now I had to wire the main power to this front switch. Pretty annoying, actually.

Edit: just noticed I had adaptive layer height switched on, so it wasn't a printer problem. Strange, I don't remember switching it on in Cura, must've done so accidentally.