No such device, circutpython

im trying to call a sd card via circutpython but it just returns
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Filename:scott.wav
Traceback (most recent call last):
File “code.py”, line 13, in
OSError: [Errno 19] No such device

It looks like it isn’t detecting the sdcard holder, so either A) it isn’t wired up properly or B) the software is looking for it on the wrong pins. Can you post a photo of your setup and the code you’re using? (If you put three backticks ` before and after your code the forum formats it to be more readable).

I believe @PokeyManatee4 is using some sample code from Adding CircuitPython support for PICO dv

The filename should be entered as /sd/scott.wav

i Will asap , i just woke up

I am using a pimoroni vga demo board

I don’t believe there is official CircuitPython firmware for the VGA Demo Base, but if you flashed the PICO with either the DVI Demo Base firmware or just the standard PICO firmware, you can probably get the audio and SD card to work, you’ll just have to use the correct pins.

Looking at the reference documents, it looks like you should use GP27 for the BIT_CLOCK, GP26 for WORD_SELECT and GP28 for DATA.

i.e.:

audiobusio.I2SOut(board.GP27, board.GP28, board.GP26)

It also looks to me like the SD card is wired the same on both the VGA and DVI boards so if you’re using the DVI firmware the sample code should work or if you’re using the standard PICO firmware then you should replace the SD card pin names with the generic pin names.
i.e.:

spi = bitbangio.SPI(board.GP5,board.GP18,board.GP19)
cs = digitalio.DigitalInOut(board.GP22)
sd = adafruit_sdcard.SDCard(spi,cs)

i flashed it with the dvi firmware, i know there isnt support for it but i did get audio working

sd card:same error
it seems to throw this error at storage.mount(vfs,‘/sd’)

You might try creating the /sd folder before attempting the mount. I didn’t think the change was in yet but the mount command is going to require the folder to exist soon.

Add

import os
os.mkdir('/sd')

before the storage.mount.

If that doesn’t work, try a different SD card and/or make sure it’s formatted as FAT16 or FAT32.

new error while running that snippet
OSError: [Errno 30] Read-only filesystem

Probably the simplest thing would be to just create the /sd folder on the CIRCUITPY drive from you host computer (PC/Linux/Mac) and remove the code snippet that tried to create the folder.

If adding the folder doesn’t resolve the issue, then you can delete it again from the host computer.

ive tried this multiple times
OSError: [Errno 17] File exists

Okay, that’s what should happen assuming the change hasn’t been merged yet, which I didn’t really think it had. Go ahead and delete the /sd folder.

My best guess at this point is that the SD card is somehow incompatible. Can you try another one? Ideally 4G to 32G in size and if possible freshly formatted with a FAT partition.

Just for testing purposes I’ve had success mounting SD cards with Raspbian Linux for a Raspberry Pi. The BOOT partition on those SD cards are typically a relatively small FAT partition. You don’t need (and probably don’t want) to format that for the test mount.

the current one is 256mb rn

I think technically that should work, but I’ve seen issues with individual SD cards that appear to work with other devices but won’t mount via CircuitPython.

its not branded but i changed the sd card(128gb one), it worked

1 Like

It’s also possible that the I missed something and the VGA Demo base is different the the DVI Base. I don’t have one to test with.

i dont see the sd card dir on the sys.path

The mounted drive shouldn’t automatically be added to sys.path but if you put your scott.wav file on it, then enter /sd/scott.wav at the filename prompt, the script should find it and play it.