#Hi I m trying to get an Adafruit SPI
1 messages ยท Page 1 of 1 (latest)
This is the device I'm using: https://learn.adafruit.com/adafruit-spi-flash-sd-card?view=all
And the 'List Files' code is here: https://learn.adafruit.com/micropython-hardware-sd-cards/tdicola-circuitpython#list-files-2976357
When storage.mount(vfs, "/sd") is used this is the error output I see:
`
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Files on filesystem:
Looking in /
Traceback (most recent call last):
File "code.py", line 63, in <module>
File "code.py", line 37, in print_directory
OSError: [Errno 2] No such file/directory
`
And when its commented out:
`
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Files on filesystem:
Looking in /
boot_out.txt Size: 125 by
System Volume Information/ Size: 0 by
Looking in //System Volume Information
IndexerVolumeGuid Size: 76 by
WPSettings.dat Size: 12 by
lib/ Size: 0 by
Looking in //lib
adafruit_bmp280.py.old Size: 19.1 KB
adafruit_ticks.py.old Size: 4.6 KB
adafruit_bme280/ Size: 0 by
Looking in //lib/adafruit_bme280
advanced.py Size: 13.7 KB
basic.py Size: 16.4 KB
init.py Size: 0 by
advanced.mpy Size: 2.6 KB
basic.mpy Size: 3.7 KB
protocol.mpy Size: 713 by
asyncio/ Size: 0 by
Looking in //lib/asyncio
core.mpy Size: 3.4 KB
event.mpy Size: 665 by
funcs.mpy Size: 703 by
`
etc, etc
Any idea why trying to mount the sd card to "/sd" on the pico would cause the 'No such file/directory" error?
I'm assuming that the mount command will create the directory if it doesn't exist (or if it even needs to). I've tried creating the 'sd' folder manually, but then the error is 'file exists'.
One thing worth mentioning is I don't have the full library bundle on the Pico as I need the space for mp3s (which is why I'm trying to get the SD card working ๐ ). I was starting to wonder if I'm missing some dependency... I think I'll clear up some space and copy over the whole bundle and see if that makes any difference.
Scrach that... the whole bundle doesn't fit on a Pico...
Also just tried an external SD card and getting the same result.
Tried sdcardio and same issue ๐
sd_cs = board.GP13
spi_clk = board.GP10
spi_mosi = board.GP11
spi_miso = board.GP12
spi = busio.SPI(spi_clk, spi_mosi, spi_miso)
sdcard = sdcardio.SDCard(spi, sd_cs)
vfs = storage.VfsFat(sdcard)
# storage.mount(vfs, "/sd") # Uncomment this and get "No such file/directory" error
Seems like I can us os.listdir and os.makedir to see the content of the SD card... so I think its working, but the example code isn't ๐คทโโ๏ธ