I've got my adapter connected to the HSPI bus, but using Pin(32) for CS.
Here's the whole of my code:
Code: Select all
''' SD card test'''
import os
import machine
my_sd = machine.SDCard(slot=3, width=1, cd=None, wp=None, sck=machine.Pin(14), miso=machine.Pin(12), mosi=machine.Pin(13), cs=machine.Pin(32), freq = 10000000)
#my_sd = machine.SDCard(slot=3)
print("Print(my_sd) returns: ",my_sd)
os.mount(my_sd, "/sd")
Code: Select all
Print(my_sd) returns: <SDCard>
E (1373) sdmmc_sd: sdmmc_init_sd_if_cond: send_if_cond (1) returned 0x108
Traceback (most recent call last):
File "main.py", line 10, in <module>
OSError: 16
MicroPython v1.18 on 2022-01-17; ESP32 module with ESP32
I thought maybe something was wrong with the specific microSD card I'm using, but I get the same error with no card connected.
I thought maybe my microSD adapter is bad, so I tried with it unplugged. Same error.
I thought maybe the board wiring was bad, so I unplugged the ESP32 board and am runnign with nothing connected. Same error message.
I thought maybe my Pin32 CS is causing a problem, so I just used my_sd = machine.SDCard(slot=3). Same error message.
I tried "slot=2", Same error message
I tried my_sd = machine.SDCard() # all defaults. Now I get a different error message:
Code: Select all
E (959) sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107