forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
CircuitPython version and board name
Adafruit CircuitPython 10.0.0-beta.0 on 2025-07-15; Adafruit Metro RP2350 with rp2350b
Code/REPL
import os, time, board, busio, sdcardio
try_adafruit_sdcard = True
mount_point = "/sd"
# pin definitions
sd_sck = board.SD_SCK # board.GP34 # "CLK"
sd_mosi = board.SD_MOSI # board.GP35 # "SI"
sd_miso = board.SD_MISO # board.GP36 # "SO"
sd_cs = board.SD_CS # board.GP39 # "CS"
# sd card setup
if try_adafruit_sdcard:
print("trying adafruit_sdcard")
import adafruit_sdcard, digitalio
sd_spi = busio.SPI(clock=sd_sck, MOSI=sd_mosi, MISO=sd_miso)
cs = digitalio.DigitalInOut(sd_cs)
sdcard = adafruit_sdcard.SDCard(sd_spi, cs)
else:
print("trying sdcardio")
sd_spi = busio.SPI(clock=sd_sck, MOSI=sd_mosi, MISO=sd_miso)
sdcard = sdcardio.SDCard(sd_spi, sd_cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, mount_point)
while True:
for filename in os.listdir(mount_point):
print("filename:",filename)
time.sleep(0.5)
Behavior
code.py output:
trying adafruit_sdcard
Traceback (most recent call last):
File "code.py", line 15, in <module>
ValueError: SD_SCK in use
Description
There seems to be no way to release the SD SPI pins being used.
Trying to do a minimal version of the SD Card Read Test in the Learn Guide results in "SD_SCK in use" error.
Additional information
No response