Micro SD Card

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
Raed
Posts: 4
Joined: Sun Sep 29, 2019 4:10 am

Micro SD Card

Post by Raed » Sun Sep 29, 2019 4:16 am

Hello All
This is my first post on the forum and hope, any one used machine.SDCard on ESP32-WROOM-32 board, I am using OLIMEX ESP32-EVB, and not getting anywhere.

Regards

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Micro SD Card

Post by Roberthh » Sun Sep 29, 2019 6:29 am

You have to use the proper GPIO pins. Looking at the schematics of the board, a mount script could be something like:

Code: Select all

import machine, sdcard, os
sd = sdcard.SDCard(machine.SPI(1, sck=machine.Pin(6), mosi=machine.Pin(11),
                   miso=machine.Pin(7)), machine.Pin(10))
os.mount(sd, "/sd")
os.listdir("/sd")

Raed
Posts: 4
Joined: Sun Sep 29, 2019 4:10 am

Re: Micro SD Card

Post by Raed » Sun Sep 29, 2019 6:22 pm

Dear Roberthh
I checked my board, it is in compliance with machine.SDCard slot=1 width=4.

Please see http://docs.micropython.org/en/latest/l ... DCard.html

Regards

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Micro SD Card

Post by Roberthh » Sun Sep 29, 2019 6:31 pm

So it works? Comparing the documentation and the schematics on the net, it looks more like slot=0, width=4.

Raed
Posts: 4
Joined: Sun Sep 29, 2019 4:10 am

Re: Micro SD Card

Post by Raed » Tue Oct 01, 2019 4:50 am

I found this https://github.com/espressif/arduino-esp32/issues/495

seems not only me suffering, if you look closer there is a miss match, on the module they names slot 0 pins, but on the SDMMC part of the schematic they only wired D0 of slot 1.

Seems the schematic provided is not the one used to make the pcb

So I must try slot=1, width=1 but I am on a busness trip now I will try and update later.

I am doing a PCB for slot=1, width=4 once I get I will also post the results

Raed
Posts: 4
Joined: Sun Sep 29, 2019 4:10 am

Re: Micro SD Card

Post by Raed » Wed Nov 20, 2019 9:16 am

Hi
I made the PCB, and I am getting the following, any idea???

>>> import uos
>>> import machine
>>> uos.mount(machine.SDCard(slot=1,width=4), "/sd")
[0;32mI (31850) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 [0m
[0;31mE (31850) sdmmc_io: sdmmc_io_reset: unexpected return: 0x108[0m
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: 16
>>>

Dash
Posts: 1
Joined: Sat May 07, 2022 11:48 pm

Re: Micro SD Card

Post by Dash » Sat May 07, 2022 11:54 pm

I have a similar issue
https://github.com/Xinyuan-LilyGO/LilyG ... 2/issues/9

Appearently the pin they say is connected to the as card doesn’t exist it’s the IO14
You can even see it on theire github page.linked below 👇
Can anyone check the schematic and tell me if they see all the pins?


https://github.com/Xinyuan-LilyGO/LilyG ... 2/issues/9

Post Reply