Olimex Support Forum

Microcontrollers => ESP32 => Topic started by: asoriano on April 23, 2020, 07:14:23 AM

Title: How to initialize the SD Card
Post by: asoriano on April 23, 2020, 07:14:23 AM
Trying to find documentation on how to initialize the SD Card in micropython and came across this site:

http://docs.micropython.org/en/latest/library/machine.SDCard.html.

I tried to follow directions but I'm getting errors. Any help is appreciated.

Thanks a lot!
Title: Re: How to initialize the SD Card
Post by: JohnS on April 23, 2020, 09:37:33 AM
You should probably tell us the errors!

John
Title: Re: How to initialize the SD Card
Post by: LubOlimex on April 23, 2020, 03:39:39 PM
Also what board do you have?
Title: Re: How to initialize the SD Card
Post by: asoriano on April 24, 2020, 01:51:07 AM
I have the ESP32-EVB.

This is the code I used.

>>> from machine import Pin, SDCard
>>> import os
>>> sd = machine.SDCard(slot=1, width=1, sck=Pin(14), miso=Pin(2), mosi=Pin(15))
>>> os.mount(sd, '/sd')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV
>>>

Thanks for any help.