-
Notifications
You must be signed in to change notification settings - Fork 7.6k
SD library: Fix format #9034
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
SD library: Fix format #9034
Conversation
Pass correct work buffer size to f_mkfs
👋 Hello prplz, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
Nice catch @prplz! Thanks for the fix 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description of Change
SD card formatting in the SD library was broken by #6745. The work buffer for
f_mkfs
was moved from the stack to the heap, but the length argument was not updated, instead it currently passes the size of a pointer (32 bits).Tests scenarios
Before my change,
SD.begin
withformat_if_empty
set to true and an erased SD card will always fail with the error[sd_diskio.cpp:824] sdcard_mount(): f_mkfs failed: (17) LFN working buffer could not be allocated
.After my change
SD.begin
succeeds and creates a FAT filesystem on the card.