-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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] Tracked down STM32F1 SD Card problems #24450
Comments
Duplicate of #24422 |
Please submit a PR so these fixes can be reviewed. |
I remember that about an year ago I fixed all sdio issues in stm32, tested it with lots of different boards and setups. I remember that the sdio was unreliable, randomly halting or stoping to read. Now we have this complete rewrite of sdio code. I don’t know if it was widely tested, but the proper fix probably will demand lots of test to get everything stable again. |
This is not a duplicate, the problem arises from a M28 attempt the fails every time. |
We don't need multiple open issues for the same "SD card issues". Leaving a comment in the other issue is perfectly fine. |
That's what I'm thinking, too. A complete rewrite of delicate core part in a platform that can't be tested (as stated from the author of the PR) shouldn't be done blinded. |
I opened this new issue to give more info and the bug timeline. |
Again, we don't need multiple issues opened for the same "SD card issues" bug. Just leave a comment in the original bug report. |
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. |
Did you test the latest
bugfix-2.1.x
code?Yes, and the problem still exists.
Bug Description
As noticed here #24422 (comment) , different issues related to the SD Card was spotted in the last days. I found that the problems start from this commit eda61a2 with the
sdio.cpp
file cleanup (or better a rewrite).I was able to strip down this commit and the related bootloop fix (c9b97b8) and build the tip of bugfix-2.1.x with the restored SD Card functionalities.
I'm a completely noob in DMA management, but from the code I can see that the new implementation never switches the direction from MEMORY_TO_PERIPH, while the old implementation does the switch based on a read or write operation.
I suspect that this could be the problem or a starting point to look at.
It is worth noting that some people experienced layer shifts, random freeze/reboot and print breaks when using (read) SD Card, so this could be related.
This rewrite should be reviewed from someone with STM32F1 skilled in DMA management, which I'm not, or at least reverted back for the STM32F1 part due to high risk of problems (like power loss recovery which writes to the SD card).
Bug Timeline
eda61a2
Expected behavior
To write to the SD Card and have a reliable filesystem (also for read).
Actual behavior
Can't write to SD Card and as soon as try to write to the SD Card, this silently fails without response, then any further serial/sd card Mxx command are ignored and the FAT table is truncated.
In this stage the only operation that one can do to resume the SD Card is a power cycle.
Steps to Reproduce
M28 testfile.gcode
to write a file on SDCard.Version of Marlin Firmware
bugfix-2.1.x
Printer model
Ender 3 V2
Electronics
Stock V4.2.2
Add-ons
Neopixel leds
Bed Leveling
No response
Your Slicer
No response
Host Software
Configuration.zip
No response
Don't forget to include
Configuration.h
andConfiguration_adv.h
.Additional information & file uploads
LONG_FILENAME_WRITE_SUPPORT
,BINARY_FILE_TRANSFER
andCUSTOM_FIRMWARE_UPLOAD
enabledThe text was updated successfully, but these errors were encountered: