Set sd card mode and pins in official firmware

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Set sd card mode and pins in official firmware

Post by liudr » Fri Jul 27, 2018 4:03 pm

I am confused. I started with official firmware and quickly switched to loboris firmware. I can set sd card mode (SPI) and pins at will with this:

uos.sdconfig(uos.SDMODE_SPI, clk=5, mosi=18, miso=19, cs=15)

This MUST have been loboris firmware because I couldn't find this method under uos in the official firmware.

So my question is: does the standard firmware support setting SD card pins and/or mode? If the answer is NO, that would be quite unfortunate.

I found this related information:

https://github.com/micropython/micropyt ... /sdcard.py

Documentation/instruction is non-existent.

Must I switch to loboris firmware in order to get these basic features standard?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Set sd card mode and pins in official firmware

Post by pythoncoder » Sat Jul 28, 2018 7:08 am

Unfortunately documentation for the official ESP32 port is lacking. You should use the ESP8266 docs as a guide. SPI is set up using the machine module documented here.
Peter Hinch
Index to my micropython libraries.

User avatar
liudr
Posts: 211
Joined: Tue Oct 17, 2017 5:18 am

Re: Set sd card mode and pins in official firmware

Post by liudr » Tue Jul 31, 2018 3:40 am

Thanks Peter. I decided to switch to Loboris firmware for its easy support of sd card. Long story short, I got it working after some struggle.

Regarding SPI MicroPython module, is there any way to show properties such as baud rate or whether MSB or LSB was selected? There was only an init, which is like a setter, but no getter or direct access to these properties.

Post Reply