Page 1 of 1

SD Card over USB MCS

Posted: Thu Aug 13, 2020 12:04 am
by jamonda
Hi everybody.
According to the Pyboard D reference, the if an SD card is inserted, by default it will not be automatically mounted in the board’s filesystem but it will be exposed as a mass storage device if USB is used.
My SD Card doesn't show as a mass storage device, no matter it's mounted or not.
Why?

Re: SD Card over USB MCS

Posted: Fri Aug 14, 2020 5:40 am
by Stevo52
It might help if you post the code you are using? Do you get any error messages?

I have this in boot.py (probably in common use)...

import sys, uos, pyb

# If an SD is detected, mount it

Code: Select all

if pyb.SDCard().present():
   uos.mount(pyb.SDCard(), '/sd')
   sys.path[1:1] = ['/sd', 'sd/lib']
It works as expected when there is a card inserted.. however you may not see the sdcard appear on the device connected by USB, without using (and doing so might stop you seeing the pyboard D storage as /flash) :
pyb.usb_mode('VCP+MSC', msc=(pyb.SDCard(),))

There are combinations of of pyb.usb_mode command which could let you see multiple msc devices.