Skip to content

support CIRCUITPY_SDCARD_USB in settings.toml#10996

Merged
tannewt merged 4 commits into
adafruit:mainfrom
dhalbert:settings.toml-sdcard-usb-setting
May 12, 2026
Merged

support CIRCUITPY_SDCARD_USB in settings.toml#10996
tannewt merged 4 commits into
adafruit:mainfrom
dhalbert:settings.toml-sdcard-usb-setting

Conversation

@dhalbert
Copy link
Copy Markdown
Collaborator

  • Implements a new setting in settings.toml: CIRCUITPY_SDCARD_USB.
    • if true (the default), presents a mounted SD card (auto or manually mounted) via USB MSC
    • if false, the SD card is not presented over USB.
  • Revises docs/environment.rst to bring it up to date and clarify how it works. Documents CIRCUITPY_SDCARD_USB as well.

Tested on a Fruit Jam, Metro ESP32-S3, and PyPortal.

@tannewt FYI:

I deleted the lines belowin tud_msc_test_unit_ready_cb, because they did not seem to be necessary. There are other places where automount_sd_card() is called which cause an SD card to be mounted, and I'm not sure why it's called here too.

#ifdef SDCARD_LUN
if (lun == SDCARD_LUN) {
automount_sd_card();
}
#endif

I tested this deletion on a Fruit Jam: the SD card is still mounted (when CIRCUITPY_SDCARD_USB is not false) when code.py runs, and also when there is not even a code.py to run. Let me know if you remember what use case this was covering that I missed.

Tagging @bablokb and @mikeysklar for interest re #10983, and also for testing if you would like to.

@dhalbert dhalbert changed the title supervisor/shared/usb/usb_msc_flash.c: support CIRCUITPY_SDCARD_USB i… support CIRCUITPY_SDCARD_USB in settings.toml May 11, 2026
…n settings.toml

Document CIRCUITPY_SDCARD_USB and rework settings.toml documentation
@dhalbert dhalbert force-pushed the settings.toml-sdcard-usb-setting branch from 3e171d2 to fea7505 Compare May 11, 2026 12:34
Copy link
Copy Markdown
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

One typo. Good otherwise.

Comment thread docs/environment.rst Outdated
@mikeysklar
Copy link
Copy Markdown

mikeysklar commented May 11, 2026

Works as advertised. Thank you.

Quick test on macOS and Ubuntu.

Board OS CIRCUITPY_SDCARD_USB = false Default (no setting)
Metro RP2040 Ubuntu 24.04 ✅ SD hidden ✅ SD visible
Metro RP2040 macOS ✅ SD hidden ✅ SD visible
Adafruit CircuitPython 10.3.0-alpha.1-12-gd1fd820a84-dirty on 2026-05-11; Adafruit Metro RP2040 with rp2040

@dhalbert dhalbert requested a review from tannewt May 12, 2026 14:52
Copy link
Copy Markdown
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thank you!

@tannewt tannewt merged commit 1d4dbfe into adafruit:main May 12, 2026
568 checks passed
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.

3 participants