Skip to content

ESP32-S3 SDCard OSError: 16 #1015

Closed
Closed
@kaixin168sxz

Description

@kaixin168sxz

English(machine translation):
Hi!
Problem:
I can't use the SD card on the ESP32-S3, and I get the error OSError: 16, but it works fine on the ESP32-NodeMCU.
Device:

  • ESP32-S3-N16R8 (ESP32-S3-DevKitC-1)
  • Kingston MicroSD HC 16GB

Pins:

  • sck -> 14
  • mosi -> 13
  • miso -> 12
  • cs -> 1

Checked:

I ran the following code in Thonny:

from machine import Pin, SDCard
import os

sd = SDCard(slot=2, sck=Pin(14), mosi=Pin(13), miso=Pin(12), cs=Pin(1), freq=10000000)

vfs=os.VfsFat(sd)
os.mount(vfs, "/sd")

But Thonny output this error:

MPY: soft reboot
Traceback (most recent call last):
  File "<stdin>", line 55, in <module>
OSError: 16

Any idea on how to solve this?

中文:
Hi!
问题:
ESP32-S3上无法使用SD卡,得到错误OSError: 16,但在ESP32-NodeMCU中测试正常
设备:

  • ESP32-S3-N16R8 (ESP32-S3-DevKitC-1)
  • Kingston MicroSD HC 16GB

引脚:

  • sck -> 14
  • mosi -> 13
  • miso -> 12
  • cs -> 1

已查询:

我在Thonny中运行了如下代码:

from machine import Pin, SDCard
import os

sd = SDCard(slot=2, sck=Pin(14), mosi=Pin(13), miso=Pin(12), cs=Pin(1), freq=10000000)

vfs=os.VfsFat(sd)
os.mount(vfs, "/sd")

但是Thonny输出了这个报错:

MPY: soft reboot
Traceback (most recent call last):
  File "<stdin>", line 55, in <module>
OSError: 16

请问我该如何解决这个问题?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions