Mount SD card at filesystem init so macOS can see it via USB MSC#10963
Open
mikeysklar wants to merge 1 commit intoadafruit:mainfrom
Open
Mount SD card at filesystem init so macOS can see it via USB MSC#10963mikeysklar wants to merge 1 commit intoadafruit:mainfrom
mikeysklar wants to merge 1 commit intoadafruit:mainfrom
Conversation
The lazy automount in tud_msc_test_unit_ready_cb can lose races with macOS's USB MSC probe timing -- the host asks whether LUN 1 is ready before the card has finished mounting, sees NOT_READY, and may give up before trying again. Mounting during filesystem_init ensures the SD card is live by the time USB enumerates, so the first probe succeeds. Affects boards that define DEFAULT_SD_CARD_DETECT; behavior on boards without an auto-mount path is unchanged.
30b3221 to
518db8a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The SD card is currently mounted lazily when macOS sends the first TEST UNIT READY. That can lose a race: macOS sees NOT_READY, gives up, and never retries. Mounting at
filesystem_init(right aftersdcardio_init) means the card is live before USB enumerates.Tested
Host OSes: macOS 26.x (Apple Silicon M2), Ubuntu 24.04 (kernel 6.17). Linux was fine before and is still fine.
test code
Related