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 gets corrupted after a print. #62

Closed
DeivaSR opened this issue Dec 2, 2020 · 9 comments
Closed

[BUG] SD card gets corrupted after a print. #62

DeivaSR opened this issue Dec 2, 2020 · 9 comments

Comments

@DeivaSR
Copy link

DeivaSR commented Dec 2, 2020

I am currently running the Community Firmware Release 4 Alpha (v2.0.7.1). I also have the latest touch screen firmware installed.

Using a SanDisk Ultra MicroSD HC 16GB card (see photo). SD card is formatted as FAT32, with Allocation Size of 4096.

These are the steps that I used to reproduce the issue. It is reproducible for me.

  1. Insert the SD card into the Windows 10 PC
  2. Copy the sliced gcode file which is stored/saved of the PC hard disk to the SD card
  3. Eject the SD card before removing the SD card from the PC
  4. Insert SD card into CR-6 SE
  5. Perform auto-leveling using the touch screen
  6. Heat up the bed for PLA (using touch screen)
  7. Once heated up, select file to print and begin print.
  8. Print completes successfully, and message is displayed on the touch screen with the button "Finish Print". (from this point on, I recorded a video - https://youtu.be/b2nk_uuOr68 )
  9. Tap the "Finish Print" button. Screen goes to printer's main screen.
  10. Switch off the power to the printer (using switch).
  11. After 10 seconds, switch the printer on
  12. As boot boot screen comes up, message pops up:

Action Required
Printer stopped unexpectedly.
Resume previous print?
dwin technology
Resume Cancel (buttons displayed on screen)

  1. Since print succeeded earlier, tap Cancel (recorded video stops here)
  2. Attempting to print the same file again causes the printer to freeze - screen freezes, and print head does not move either. Only way out is to power cycle the printer.
  3. Remove the card from the printer and insert it into the Windows PC
  4. After the card is read and recognised by the OS, Windows Explorer pops up.
  5. There is a file by the name of PLR in the SD card (this file was not there when it was inserted to the PC in step (1). The file size is 188 bytes (see pic) and the file's timestamp is 1/1/2000 (which is surely something that does not seem like is caused by Windows)
  6. Attempting to open/read the file using Notepad results in the message "The file or directory \PLR is corrupt and unreadable. Please run the Chkdsk utility."
  7. At this point, the SD card has to be fixed using the Chkdsk utility, or else no files will be able to be written to the SD card.

This issue is reproducible even after formatting the SD card or using a different SD card.
It is not a showstopper. To workaround this, follow the steps below:

  1. After each print completes, the printer has to be power cycled and when the Action Required message pops up, tap Cancel
  2. Pull out SD card, insert into PC
  3. Perform Chkdsk
  4. Delete the PLR file
  5. And you are good to copy the next gcode file to the SD card for the next print.
    Anyone else seen this problem? And should I files this in github?
    Screenshots attached.

Printer_Info

SD_Card

PLR File

[Edit] [4-Dec-2020]
Workaround: These are the steps that can be followed to workaround the issue

  1. Insert the SD card into the Windows 10 PC
  2. Copy the sliced gcode file which is stored/saved of the PC hard disk to the SD card
  3. Eject the SD card before removing the SD card from the PC
  4. Insert SD card into CR-6 SE
  5. Perform auto-leveling using the touch screen
  6. Heat up the bed for PLA (using touch screen)
  7. Once heated up, select file to print and begin print.
  8. Print completes successfully, and message is displayed on the touch screen with the button "Finish Print". (from this point on, I recorded a video - https://youtu.be/b2nk_uuOr68 )
  9. Tap the "Finish Print" button. Screen goes to printer's main screen. (Note: Tested by skipping this step after a print completes, going straight to Step 10)
  10. Remove the SD card from the printer
  11. Insert SD card in a Windows PC
  12. Perform a fix of the SD card using Chkdsk (or if windows prompts that there is an error, select the the Fix/Repair option.
  13. Eject the SD card from WIndows before removing the SD card from the PC
  14. Insert the SD card into the printer
  15. Power cycle the printer
  16. Printer boots up cleanly, i.e. the "Action Required Printer stopped unexpectedly." is not displayed.

Fix_Card

@Sebazzz
Copy link
Collaborator

Sebazzz commented Dec 2, 2020

Can you try this build and check if it improves things: https://github.com/CR6Community/Marlin/files/5619260/firmware-20201201-000916.zip

@DeivaSR
Copy link
Author

DeivaSR commented Dec 3, 2020

Can you try this build and check if it improves things: https://github.com/CR6Community/Marlin/files/5619260/firmware-20201201-000916.zip

I tried this build today. Seems like the SD card corruption is still taking place. Exactly the same as what was reported in the initial bug report.

@Sebazzz
Copy link
Collaborator

Sebazzz commented Dec 3, 2020

Sorry, I can't reproduce it. Still assuming for now it doesn't happen on stock hardware.
For now I suggest disabling power loss recovery.

@CR6Community/developers Any idea?

@JonBradbury
Copy link
Collaborator

JonBradbury commented Dec 3, 2020 via email

@Sebazzz
Copy link
Collaborator

Sebazzz commented Dec 3, 2020

@JonBradbury That would make sense if this is Creality-based, but in this case pretty much everything has been written by us or replaced by a default Marlin implementation and in this case power loss recovery is default Marlin. Perhaps @InsanityAutomation has any idea, he is a bit closer to the fire.

@DeivaSR
Copy link
Author

DeivaSR commented Dec 4, 2020

@Sebazzz @JonBradbury Could it be possible that, in some cases (e.g. in my case), after printing completes successfully, the file handle to the PLR file that is being written to the SD card is not closed (thus the PLR file remaining in the SD Card), resulting in the corruption?

I found that when Windows prompts that the SD card has some errors, and I perform a Scan and Fix, the PLR file gets removed by Windows during the fix process. Once I have fixed the SD Card and reinsert it to the printer, performing a power cycle will go through without the "Action required... Printer stopped unexpectedly message"

I will add more info to the bug report on what I mentioned above.

p.s. I am running this on stock hardware.

@InsanityAutomation
Copy link

PLR by nature is abusive to sd cards. The function with a continually open write handle defeats the internal wear leveling of the card. It causes shakey cards to fail very quickly and easily. Limiting writes with a z-change limit is critical in mitigation.

@Sebazzz
Copy link
Collaborator

Sebazzz commented Dec 4, 2020

Could it be possible that, in some cases (e.g. in my case), after printing completes successfully, the file handle to the PLR file that is being written to the SD card is not closed (thus the PLR file remaining in the SD Card), resulting in the corruption?

Well, the fact is that the CR-6 touch screen firmware has no option to "release media". But... I have never used that either on other printers and yanked that card out of it without consideration (and without issues) 😀

@DeivaSR: Can you test this:

  1. Print like in your issue described
  2. Before removing the card from your printer, issue gcode M22 from a serial terminal.

@Sebazzz
Copy link
Collaborator

Sebazzz commented Dec 10, 2020

Closed due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants