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

[BUG] LCD freezes/very sluggish after upgrade if SD card is left in the mainboard (continues #24301) #24306

Closed
2 of 4 tasks
ucirello opened this issue Jun 7, 2022 · 28 comments

Comments

@ucirello
Copy link

ucirello commented Jun 7, 2022

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

With 3e9fb34 still, the LCD freezes, or at least gets very sluggish.

It worked fine with 2.0.9.3.

Bug Timeline

Since 15b6159 it is broken. 3e9fb34 did not fix.

Expected behavior

I expected the LCD to render quickly and be able to navigate through all menus. Turning the knob clockwise or counter-clockwise would immediately change feed rate.

Actual behavior

Depending on the boot sequence it will either freeze completely, or be very sluggish.

The info screen renders in more than 15s per half.

The wheel button seems to not be able to open the main menu.

Turning the knob clockwise or counter-clockwise would immediately change feed rate affects the feed rate, but it takes a long time for the number to update.

Steps to Reproduce

  1. Compile bugfix-2.1 (3e9fb34) with the given configuration files.
  2. Use a LPC1769 board (tested with MKS sgenl v2) with a RepRap Full Graphical Display and flash the firmware.
  3. LCD freezes.

Version of Marlin Firmware

bugfix-2.1 (3e9fb34)

Printer model

Modded Ender 3

Electronics

MKS SGENL v2, Discount Full Graphic Smart Controller

Add-ons

EZNEO, EZABL, UART based serial connection

Bed Leveling

ABL Bilinear mesh

Your Slicer

Cura

Host Software

No response

Other things to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.
  • Log output from the host. (M111 S247 for maximum logging.)
  • Images or videos demonstrating the problem, if it helps to make it clear.
  • A G-Code file that exposes the problem, if not affecting all G-code.

Additional information & file uploads

image (photo taken this morning)

configs.zip

image

@ucirello
Copy link
Author

ucirello commented Jun 7, 2022

Also related to #24298

@ne0nex
Copy link

ne0nex commented Jun 7, 2022

Interestingly, this is the opposite that I'm having happen on my SKR1.3 board in #24293

If an SD card is not inserted (and power loss recovery is set to on) at boot, the machine gets into this same state.

@ucirello
Copy link
Author

ucirello commented Jun 7, 2022

I think part of the problem is now that there are two SD slots. One in the mainboard, and another in the display. This behavior only happens when the SD is in the mainboard's slot. I didn't try in the LCD slots to see what happens.

@ne0nex
Copy link

ne0nex commented Jun 7, 2022

Interesting. My display doesn't have an SD slot. I only have the on-board.

@DavisIan22
Copy link

I have the same issue. I actually thought I fried my board last night when I upgraded to 2.1. I installed an inductive probe and accidentally sent 24v through my z endstop pin on my SKR E3 Turbo. I downgraded to 2.0.9.3 and the screen works just fine now.

@linuxsense
Copy link

I had a similar issue with my SKR 1.4 Turbo but it also prevented Octoprint from communicating in a timely fashion with 2.1. I disabled SD support and that build works fine.

@willngton
Copy link

Exactly same issue with MKS Robin (KP3S)

Would work fine if boot without SD Card in.

marlin_21_mks_robin_kp3s.mp4

@ellensp
Copy link
Contributor

ellensp commented Jun 8, 2022

I cannot replicate this on a btt skr 1.3 with ucirello configs (with motherboard updated)
or on a btt skr 1.4 turbo with ucirello configs (with motherboard updated)
Using current Marlin bugfix 2.1.x

Tried all 4 physical combinations of sdcard and powered on.

onboard    | in LCD  | status
--------------------------------
empty      | empty   | no issues
empty      | sdcard  | no issues
sdcard     | empty   | no issues
sdcard     | sdcard  | no issues

@DavisIan22
Copy link

I am not on the Marlin Bugfix 2.1.x. I am on Release 2.1

@ellensp
Copy link
Contributor

ellensp commented Jun 8, 2022

@Doubledeucedavis Release (2.1.zip) is a snapshot in time. It generally does not get updated after it is made.
It does not have patch #24302 installed

You need to use either Marlin 2.1.x https://github.com/MarlinFirmware/Marlin/archive/refs/heads/2.1.x.zip
or bugfix 2.1.x https://github.com/MarlinFirmware/Marlin/archive/refs/heads/bugfix-2.1.x.zip
or apply the patch yourself to the release code

@ellensp
Copy link
Contributor

ellensp commented Jun 8, 2022

Played some more...

On a skr 1.4 with a RepRap Full Graphical Display, If I put a empty Micro SDCARD TO SDCARD adapter into the lcd sdcard slot this will make it fail.
Ie the card detect IO line says there is SD card inserted, but it is unreadable (in this case because it is not present)

The 128x64 screen does (eventually) say "Media Init Fail" and the serial log shows "echo: No SD card" over and over, and the display is all slow.

@willngton I do notice that your display also says "Media Init Fail"

@ucirello Can you give your display enough time to fully render and check if you also have a "Media Init Fail" message?

So perhaps this issue is that Marlin is not failing gracefully when the sdcard will not mount but is detected as present.

@mametaro999
Copy link

I have the same issue on Kingroon KP3 (original MKS Robin mini board).

I compared source tree between build 2.0.9.3 and 2.1.0.0 and found \Marlin-bugfix-2.1.x\Marlin\src\HAL\STM32\sdio.cpp was changed to use CMSIS library.
Then I tried to roll back this file to 2.0.9.3 in 2.1.0.0 source and confirmed this issue was gone with old source code to use old STM32 library.
So I think sdio.cpp may be incomplete for STM32F1 board support, if moving it to use CMSIS library.
Thanks.

@ellensp
Copy link
Contributor

ellensp commented Jun 8, 2022

@mametaro999 that could certainly trigger the error im seeing on stm32, but not on lpc1768

@ucirello
Copy link
Author

ucirello commented Jun 8, 2022

@ellensp

@ucirello Can you give your display enough time to fully render and check if you also have a "Media Init Fail" message?

Yes, I get a "Media Init Fail" after several seconds.

@ucirello
Copy link
Author

ucirello commented Jun 8, 2022

@ellensp when I use cardreader.cpp from 04d0d94, it seems to work.

@DavisIan22
Copy link

After about 10 minutes, I get a "Media init Fail". I upgraded my firmware to 2.1.x (bugfix) last night and now the issue is gone. I did not disable SD Support or anything and used my normal auto bed leveling configuration and I have no issues now.

@ellensp
Copy link
Contributor

ellensp commented Jun 10, 2022

The PR should fix this case of slow updating displays. #24319
It wont address the underlying issue of not being able to mount the sdcard. It just handles that condition in a much nicer way.

@CraCaNN
Copy link

CraCaNN commented Jun 20, 2022

I had a similar issue on my SKR mini V2 where the screen would take ages to load but I solved it by using the maple build environment (STMF103RE_btt_USB_maple (512K)) instead of the standard build environment (I used STM32F103RE_btt_USB (512K)). I have no idea why this makes a difference.

Also yes maple is now deprecated but it works for me.

@dburr
Copy link

dburr commented Jun 21, 2022

MKS Robin nano v1.2 with MKS TFT35
Seeing a problem similar to @willngton - if I boot up with an SD card inserted, the mainboard bootloops. However if I boot without an SD card inserted, the machine comes up fine, albeit with a somewhat sluggish LCD. If I then plug in an SD card and run a print, the print runs for a while but then it fails (either reboots or just plain locks up.) Have tried both 2.1 as well as bugfix-2.1.x as of 20220618.

@thisiskeithb
Copy link
Member

thisiskeithb commented Jun 21, 2022

#24319 has been merged (with some changes after it was initially submitted) so please try the latest bugfix-2.1.x and report back.

@thisiskeithb
Copy link
Member

To answer my own suggestion above:

With the following basic config running the current bugfix-2.1.x (1a79537), I get "Media Init Fail", but no LCD sluggishness.

#define MOTHERBOARD BOARD_MKS_SGEN_L_V2
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
#define SDCARD_CONNECTION LCD

Changing SDCARD_CONNECTION LCD to SDCARD_CONNECTION ONBOARD works, but obviously the LCD-based SD slot isn't enabled/in use.

@ucirello
Copy link
Author

Changing SDCARD_CONNECTION LCD to SDCARD_CONNECTION ONBOARD works, but obviously the LCD-based SD slot isn't enabled/in use.

That tracks with my own experience here.

@thisiskeithb
Copy link
Member

Some more testing/swapping in another LCD:

#define REPRAP_DISCOUNT_SMART_CONTROLLER (2004 character LCD) works fine with #define SDCARD_CONNECTION LCD.

@thinkyhead
Copy link
Member

Please test the bugfix-2.1.x branch to see where it stands. If the problem has been resolved then we can close this issue. If the issue isn't resolved yet, then we should investigate further — and possibly revert the media handling code to an earlier state.

@thisiskeithb
Copy link
Member

Please test the bugfix-2.1.x branch to see where it stands. If the problem has been resolved then we can close this issue. If the issue isn't resolved yet, then we should investigate further

Still quite broken on several builds here using 132c37a with various boards & LCD combos, particularly the "mini" 12864 LCDs with Neopixels or standard 12864 full graphic LCDs / TFTs with the classic UI that refuse to finish booting with an SD card inserted.

"Media Init Failed" is still the most common issue, but I'm also still seeing slow/sluggish LCD refresh rates.

and possibly revert the media handling code to an earlier state.

Yes, please. Before the next tagged release 🙂

@ucirello
Copy link
Author

ucirello commented Jul 6, 2022

It works boots with the configuration below at 132c37a:
Configuration.h

#define MOTHERBOARD BOARD_MKS_SGEN_L_V2
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
#define SDSUPPORT

Configuration_adv.h

#define SDCARD_CONNECTION LCD

platformio.ini

[platformio]
#...
default_envs = LPC1769

two small notes:

1 - It does seem that the beep on start is taking longer when the card is not present.
2 - when I hit Change Media it never indicates whether is unmounted or not. When I pull the SD card off the LCD 12864 display, it hangs for a couple of seconds, and only then it shows in the menu "No Media"

(I didn't have time to hook this configuration back to the printer to test it out with a full print cycle)

@thisiskeithb
Copy link
Member

This may be a solution: #22898 (comment)

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests