← index #11000Issue #4722
Related · high · value 1.052
QUERY · ISSUE

docs: machine.SDCard: clarify, which SPI device is used

openby sebert007opened 2023-03-10updated 2025-11-06
docs

I am using this code here:

    sd = machine.SDCard(slot=SD_SLOT,
                        width=SD_WIDTH,
                        sck=SD_SCK_PIN,
                        mosi=SD_MOSI_PIN,
                        miso=SD_MISO_PIN,
                        cs=SD_CS,
                        freq=SD_FREQ)

However it's not clear, which hardware SPI device is used.

I am using the ESP32-S3 (quad SPIRAM). It seems that SPI id=2 is used.

Is it possible to clarify this on the documentation? Or even let the user specify a parameter?

CANDIDATE · ISSUE

sdcard esp32 does not work TTGO T8 V1.8

closedby newbie71opened 2019-04-25updated 2024-09-09
port-esp32

Hi,

i am using a TTGO T8 V1.8 devboard which has an onboard card reader. i installed the newest micropyhton Version on the board.

The Board has on the bottom side following description:
SD
D2=12
D3=13
CMD=15
CLK=14
D0=2
D1=4

i used the following Code to use the SD-Card:

import machine, sdcard, os
from machine import Pin, SPI
spisd = machine.SPI(2, baudrate=10000000, polarity=0, phase=0, sck=machine.Pin(14), miso=machine.Pin(2), mosi=machine.Pin(15))
sd = sdcard.SDCard(spisd, machine.Pin(13))
vfs = os.VfsFat(sd)
os.mount(vfs, "/sd")

When the esp32 starts i get the following error:

WebREPL daemon started on ws://XXX.XXX.XXX.XXX:8266
Started webrepl in normal mode
I (8681) gpio: GPIO[15]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (8681) gpio: GPIO[2]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (8681) gpio: GPIO[14]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (8961) gpio: GPIO[15]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pullown: 0| Intr:0
I (8961) gpio: GPIO[2]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (8961) gpio: GPIO[14]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
Traceback (most recent call last):
File "main.py", line 6, in <module>
OSError: [Errno 19] ENODEV
MicroPython v1.10 on 2019-01-25; ESP32 module with ESP32
Type "help()" for more information.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied