Skip to content

ESP32-S2 SD card mount fails with OSError [Errno 19] after successful SDCard initialization (CP 10.0.3) #10741

@jouellnyc

Description

@jouellnyc

CircuitPython version and board name

Board: ESP32-S2-DevKitC-1-N8R2 - this is a 'real' board from Espressif - with the nice looking box and everything :)

CircuitPython Version: 10.0.3

Code/REPL

Code to Reproduce:

pythonimport board
import busio
import sdcardio
import storage

spi = busio.SPI(board.IO36, MOSI=board.IO35, MISO=board.IO37)
cs = board.IO34
sd = sdcardio.SDCard(spi, cs, baudrate=250000)
print("SDCard initialized successfully")  # This works

vfs = storage.VfsFat(sd)  # Fails here with OSError: [Errno 19] No such device
storage.mount(vfs, "/sd")

Behavior

import board
import busio
import sdcardio
import storage
import os
import time

spi = busio.SPI(board.IO36, MOSI=board.IO35, MISO=board.IO37)
cs = board.IO34
sd = sdcardio.SDCard(spi, cs, baudrate=250000)
time.sleep(0.5) # Give it a moment
vfs = storage.VfsFat(sd)
storage.mount(vfs, "/sd")
print(os.listdir('/sd'))
Traceback (most recent call last):
File "", line 13, in
OSError: [Errno 19] No such device

Description

SD card initialization succeeds with sdcardio.SDCard() but mounting fails with OSError: [Errno 19] No such device when calling storage.VfsFat() or storage.mount().

Additional information

FW: adafruit-circuitpython-espressif_esp32s2_devkitc_1_n8r2-en_US-10.0.3.bin

Hardware:

Board: ESP32-S2-DevKitC-1-N8R2 (8MB flash, 2MB PSRAM)

SD card module: Standard SPI module (CS, SCK, MOSI, MISO, VCC, GND)
SD card: FAT32 formatted, works perfectly on Raspberry Pi Pico with CircuitPython
SD is a cheapy but it does work in my pc and pico
SD reader is https://www.amazon.com/dp/B07BJ2P6X6 hiletgo - also works on my pico with cp (Adafruit CircuitPython 10.0.3 on 2025-10-17; Raspberry Pi Pico with rp2040)

Pin Configuration:

CS: GPIO 34
SCK: GPIO 36
MOSI: GPIO 35
MISO: GPIO 37
(I have tried many many others as well)

Observations:

sdcardio.SDCard() succeeds without error
storage.VfsFat(sd) immediately fails with [Errno 19]

Issue persists across multiple pin combinations and baudrates (tested 100000-1000000)
Fresh firmware flash via esptool did not resolve the issue

Notes: Board reports only 3.7MB usable flash despite being N8R2 (8MB) variant - may be related?
i.e The board literally says XXN8R2 on the main silver chip but:

import os
stat = os.statvfs('/')
total_mb = (stat[0] * stat[2]) / (1024 * 1024)
print(f"Total flash: {total_mb:.1f} MB")
Total flash: 3.7 MB

Seems like I should see 8 MB of flash

My Flash step:

$ esptool --chip esp32s2 --port /dev/ttyACM0 --baud 460800 write-flash -z 0x0 /home/john/esp32/firmware/adafruit-circuitpython-espressif_esp32s2_devkitc_1_n8r2-en_US-10.0.3.bin 

esptool v5.1.0
Connected to ESP32-S2 on /dev/ttyACM0:
Chip type:          ESP32-S2R2 (revision v1.0)
Features:           Wi-Fi, Single Core, 240MHz, No Embedded Flash, Embedded PSRAM 2MB, ADC and temperature sensor calibration in BLK2 of eFuse V2
Crystal frequency:  40MHz
USB mode:           USB-OTG
MAC:                80:65:99:41:33:fe

Stub flasher running.
Changing baud rate to 460800...
Changed.

Configuring flash size...
Flash will be erased from 0x00000000 to 0x00193fff...
Wrote 1650816 bytes (1102527 compressed) at 0x00000000 in 10.9 seconds (1215.2 kbit/s).
Hash of data verified.

Hard resetting with a watchdog...

Related Issue?
#10268 - ESP32S2 fails to read files from mounted SD-card

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions