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] SD Card issues (reboot) #24422

Closed
1 task done
haitham-alalimi opened this issue Jun 28, 2022 · 11 comments
Closed
1 task done

[BUG] SD Card issues (reboot) #24422

haitham-alalimi opened this issue Jun 28, 2022 · 11 comments

Comments

@haitham-alalimi
Copy link

haitham-alalimi commented Jun 28, 2022

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

Yes, and the problem still exists.

Bug Description

I installed the system 2.1 on the mks robin nano 1.2v board and made the necessary changes. The system worked perfectly, but when I inserted the sd card, it rebooted, then I increased and decreased the buadrate, but the benefit and then I did the option SDCARD_CONNECTION onboard and still the same problem.
Then I downloaded bugfix 2.1.x and the result was somewhat better when I insert and remove the sd card several times the files appear but the printing appears distorted and there is an offset when it rises a few layers

Bug Timeline

New bug

Expected behavior

Rebot

Actual behavior

No response

Steps to Reproduce

No response

Version of Marlin Firmware

2.1.x

Printer model

Creasee cs 30

Electronics

Mks robin nano v1.2

Add-ons

Inductive sensor

Bed Leveling

ABL Bilinear mesh

Your Slicer

Cura

Host Software

Cura

Don't forget to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.

Additional information & file uploads

٢٠٢٢٠٦٢٨_١٠٣٠١٠
Uploading ٢٠٢٢٠٦٢٨_١٠٢٩٣٧.jpg…

@haitham-alalimi
Copy link
Author

Configuration.h and Configuration_adv.h.
Marlin2.1.x.zip

@haitham-alalimi
Copy link
Author

@thinkyhead thinkyhead changed the title [BUG] (bug summary) [BUG] SD Card issues (reboot) Jun 29, 2022
@haitham-alalimi
Copy link
Author

What is the solution?

@GHGiampy
Copy link
Contributor

GHGiampy commented Jul 2, 2022

I see a lot of problems related to the current SD card implementation (at least with Ender 3/V2/Pro) from different opened issues:

  • Random reboots
  • Random layer shifts
  • Random freeze
  • Random failures in SDCard initialize

I was a little behind, in "old" bugfix-2.0.x branch (at 2022-02-22) and everything was working fine when I implemented the long filename on FAT and firmware upload via USB. Now, updating to the latest "new" bugfix-2.0.x I experienced problems such as:

  • M21 (Init SD card) random init errors.
  • M20 (List SD card) sometimes lists nothing.
  • M30 (Delete SD file) sometimes reports error and truncate the filesystrem chain, so the remaining files in the directory are deleted.
  • M28 (Start SD write) very often is unable to open the file to write to.
  • M29 (Stop SD write) not always save the file content.
  • Very often the serial output for SDCard commands stops responding.
  • The SDCard commands lags and are quite slow to execute, related to the february 2022 version.
  • Obviously the upload via USB is entirely broken.

I have seen code moved (watchdog, ...), forced baudrate switch (250000 vs 115200 in ProUI, is this really needed?) and some motors/HW calls into the SDCard functions (isn't a good practice) that could interfere, expecially if these functions share an I2C bus or an interrupt, but I don't know how it works at low level.

I apologize if i'm the only one with all those problems (because i'm also using Neopixel leds) but IMHO the current SDCard implementation is unuseful in this state, too unstable and inconsistent to read gcode files from. A rollback should be made to track down the problems and restore a stable implementation.

Meanwhile I reverted to the 2022-02-22 bugfix-2.0.x "old" branch and everything is working as it was, so this excludes the physical SDCard from the problem.
As soon as I have time I will try the bugfix-2.1.x branch.

@Simonlebucheron
Copy link

Here author of this issue, it seems to be very similar to this closed one and so be related to this current issue.

Investigation with @benlye suggested that that we cannot write to the SD card (create new files or delete old ones).

Meanwhile I reverted to the 2022-02-22 bugfix-2.0.x "old" branch and everything is working as it was, so this excludes the physical SDCard from the problem.

Moreover, as @GHGiampy suggested "a before and after" branch, we found that the tested plugin (firmware updater) did not work with Marlin 2.0.9.4 or above versions (bugfix_2.1.x included)
But, it works perfectly with Marlin 2.0.9.3

So, the management of the SD card might be not robust anymore since 2.0.9.4

Should we make a new issue or here is ok ?
We are stuck with our issue so, what can I do to help ?

Hardware : creality V4.2.2 board

@mriscoc
Copy link
Contributor

mriscoc commented Jul 8, 2022

To confirm, Marlin BFT was working ok with Bugfix 2.0 and started to fail with Bugfix 2.1, I will try to research and revert the SDIO commit to see if that fixes the bug.

@benlye
Copy link
Contributor

benlye commented Jul 8, 2022

And to be clear, Binary File Transfer fails because the protocol can't create the new file on the SD card.

At the same time the M30 command fails when trying to delete files on the SD card, so it seems like there is an underlying SDIO issue occurring, which is what appears to link the BFT problem to this issue.

@GHGiampy
Copy link
Contributor

GHGiampy commented Jul 8, 2022

I need to clean up my branches before doing an acceptable PR, meanwhile here is a smart patch as a starting point...
sdio.zip

@thinkyhead
Copy link
Member

I went ahead and put up a PR that can be tested with and patched up - link above. If it comes down to needing to have a whole different SDIO for STM32H743 versus others, just to keep things working as before, that's what we'll do.

@thisiskeithb
Copy link
Member

Please test/report findings in #24470

@github-actions
Copy link

github-actions bot commented Sep 7, 2022

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 Sep 7, 2022
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

7 participants