Skip to content

macos support for msc #532

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

Closed
wants to merge 1 commit into from
Closed

Conversation

mikeysklar
Copy link

@mikeysklar mikeysklar commented May 27, 2025

Changing from multi-block to single block worked for macOS and Ubuntu. This is a minimal change of only a few lines. Without it I was only able to access the drives through Ubuntu as they would quickly unmount on macOS.

Works with both on board flash and microSD using a Metro RP2040 running this updated version of msc_external_flash_sdcard.ino.

Troubleshooting details #455

Changing from multi-block writes to single block worked for macos and ubuntu. I was able to mount read and write both flash and microSD using a Metro RP2040.
@mikeysklar
Copy link
Author

@hathach please let me know if this works for you or you would like to see further testing.

@ladyada ladyada requested a review from hathach May 27, 2025 14:24
Copy link
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thaak you for your PR. Yeah, I am actually able to reproduce the issue with macos. That seems that reading multiple blocks taking too long and macos isn't happy with that. I also notice that there is a new SdFat v2.3 https://github.com/greiman/SdFat/releases/tag/2.3.0 upstream that specifically add the SDIO support for rp2, let me try to update to see if that would help first. Otherwise, I think we can merge this

@hathach
Copy link
Member

hathach commented May 30, 2025

Update: I have bumped up SdFat to 2.3.0 for SDIO support, but the issue still exists, I am troubleshooting further.

PS: it got write10 failed on macos, but working just fine with Linux (debia12).

@hathach
Copy link
Member

hathach commented May 30, 2025

More Update: I found the root cause, making the PR for that real soon. I need to bump up sdfat v2.3.0 for sdio support first, since it is much quicker using 4 data line than standard spi. However SdFat v2.3.0 include some changes that we need to update other core (nrf52) first.

@mikeysklar
Copy link
Author

Awesome! I'll do a few benchmarks of the current speed which does feel pokey. Then I can comepare those with the upcoming SDIO PR.

@hathach
Copy link
Member

hathach commented May 30, 2025

this is my benchmark adafruit/SdFat#32 in short 3x read speed. Here is the "correct" fix for macos issue #533 . In short the example attempt to dump the sdcard drive to serial cause the conflict with host. I think it either

  • cause transport conflict spi/sdio
  • corrupt cached sector which lead to fail to write_sector.

the "fix" completely remove the sdcard contents dump. a better fix would be marking the SDcard as not ready (return false in TEST_UNIT_READY) while performming self-reading, but that would maybe take a bit of time. I will do it later if needed.

@hathach hathach closed this in #533 May 31, 2025
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

Successfully merging this pull request may close these issues.

2 participants