Skip to content

support CIRCUITPY_SDCARD_USB in settings.toml#10996

Open
dhalbert wants to merge 2 commits into
adafruit:mainfrom
dhalbert:settings.toml-sdcard-usb-setting
Open

support CIRCUITPY_SDCARD_USB in settings.toml#10996
dhalbert wants to merge 2 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
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
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