-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Problems with accessing SD CARD on ESP32-S3-GEEK board #10161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, I looked at the board definition and there seems to be mistakes in there: it instantiates the SPI bus of the SD card (also defined as
spi = board.SD_SPI()
cs = digitalio.DigitalInOut(board.SD_CS)
sd = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sd)
storage.mount(vfs, '/sd')
os.listdir('/sd') As for your ultimate goal of showing the SD card as mass storage, that's not gonna work over USB, it's not currently supported in Circuitpython. |
hello, i've tried the code the error now is:
line 19 of boot.py is "sd = adafruit_sdcard.SDCard(spi, cs)" i'm using adafruit_sdcard.mpy lib from adafruit-circuitpython-sd-9.x-mpy-3.3.25 |
thanks for the reply, i've modified the code to: ` CMD_PIN = 35 sd = sdioio.SDCard(clock=board.GP36, command=board.GP35, data=[board.GP37, board.GP33, board.GP38, board.GP34], frequency=25000000) the error is still the same: |
Oh yeah that would actually not work... circuitpython/ports/espressif/boards/waveshare_esp32_s3_geek/board.c Lines 34 to 42 in a0b482c
Therefore board.SD_SPI can't be used for the SD card, unlike I first thought, since it doesn't have the right pins anymore, despite the pins being busy. (And it doesn't have a MISO pin anymore). Plus the SD pins are unreachable at this point, you can't even deinit the SPI bus on them. I believe I have a fix for that: #10162 can you test it from the artifacts once it's built ? |
I'll also give the updated PR a test but for what it's worth the SDIO interface does seem to work on 9.2.5 import sdioio
import board
import storage
sd = sdioio.SDCard(clock=board.GP36,command=board.GP35,data=[board.GP37, board.GP33, board.GP38, board.GP34],frequency=25000000)
vfs=storage.VfsFat(sd)
storage.mount(vfs,'/sd') |
This works with the artifact..... |
thanks a lot this seems to work, at least i can now access the SD card! any ideas how to mount the /sd to be visible by the operating system like a normal mass storage / USB thumb drive? (this works with flash memory "/", but not "/sd or "sd")
this line "storage.remount('/sd', disable_concurrent_write_protection=True)" fails with "OSError: [Errno 22] Invalid argument". |
Nevermind, Neradoc reminded me that a power cycle is necessary to switch between SD and SDIO.... |
At present time remount() only works on "/". |
This should be fixed by #10164 |
CircuitPython version and board name
Code/REPL
Behavior
the error is always the same:
Adafruit CircuitPython 9.2.4 on 2025-01-29; Waveshare ESP32-S3-GEEK with ESP32S3
Board ID:waveshare_esp32_s3_geek
UID:C34872620D8B
boot.py output:
Traceback (most recent call last):
File "boot.py", line 15, in
ValueError: GP36 in use # always same error for all of the examples
Description
Hello,
This is my device:
https://www.waveshare.com/wiki/ESP32-S3-GEEK
I've installed python circuit from here: https://circuitpython.org/board/waveshare_esp32_s3_geek/
I'm trying to port one of the examples from C to python:
https://github.com/user-attachments/files/19285971/waveshare_usb_msc_wireless_disk_example.zip
However I'm currently stuck trying to make the sd card working, this is my boot.py (i've tried multiple approaches):
the error is always the same:
Adafruit CircuitPython 9.2.4 on 2025-01-29; Waveshare ESP32-S3-GEEK with ESP32S3
Board ID:waveshare_esp32_s3_geek
UID:C34872620D8B
boot.py output:
Traceback (most recent call last):
File "boot.py", line 15, in
ValueError: GP36 in use
I want to use the SD card and make it visible to the operating system as mass storage device. (it works in the example in C). Anyway am i missing something here? why this error happens?
Additional information
No response
The text was updated successfully, but these errors were encountered: