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: 1894
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: 1894
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
>>>

Post Reply