sdcard.py fixes for SDXC cards #17039
-
This is my first post to GitHub, but I've been working with micropython for about 10 years. Recently, I have been writing some micropython based sdcard dataloggers for a CANbus project, mostly with rp2040 and rp2350 devices. I have been using the sdcard.py source file as a driver in my projects. Today I noticed that switching from my 32GB SanDisk Ultra SDHC which worked just fine to a 32GB SanDisk Ultra SDXC caused it to fail on initialization. Others have noticed the same thing caused by missing CRC7 such as issue #12687. But none of them resulted in the fix getting merged back upstream. Here is a trivial diff for sdcard.py which adds the CRC7 values needed to get it working with my SDXC card, while still appearing to work on the older cards I've tested it on. Just for completeness, I've added a commented out minimalist Python function to compute these CRC7 values. (A quick internet search didn't pull up any Python functions for this.) Here is a simple diff against today's git master branch: I figured I'd try to get the minimal changes merged upstream while more significant rewrites like the one in the linked thread above work their way through the process. Is this something I should do a pull request for? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I tried creating my first pull request for this here. Please let me know if I need to change anything. |
Beta Was this translation helpful? Give feedback.
-
I will close this to move the conversation to the PR request: Add CRC7 values for SDCard.cmd() function calls #992 |
Beta Was this translation helpful? Give feedback.
I will close this to move the conversation to the PR request: Add CRC7 values for SDCard.cmd() function calls #992