Skip to content

SoftSPI and sdcard on M5Stack Core2 #9184

Discussion options

You must be logged in to vote

@rgroener I managed to track down an SD adaptor.

I have tested sdcard.py on an ESP32 using hardware SPI(1), SPI(2) and SoftSPI.

MPY: soft reboot
MicroPython v1.19.1-278-g6dfb462ef on 2022-08-13; TinyPICO with ESP32-PICO-D4
Type "help()" for more information.
>>> import machine, sdcard, os
>>> spi = machine.SPI(2, sck=machine.Pin(5), mosi=machine.Pin(22), miso=machine.Pin(21))
>>> sd = sdcard.SDCard(spi, machine.Pin(18))
>>> os.mount(sd, '/sd')
>>> os.listdir('/sd')
['demo.txt']
>>> os.umount('/sd')

Changing to

spi = machine.SoftSPI(sck=machine.Pin(5), mosi=machine.Pin(22), miso=machine.Pin(21))

works fine for software SPI.

I have also tested with machine.SDCard, and that seems fine too.

M…

Replies: 6 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jimmo
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jimmo
Comment options

Comment options

You must be logged in to vote
1 reply
@jimmo
Comment options

Comment options

You must be logged in to vote
6 replies
@jimmo
Comment options

@rgroener
Comment options

@jimmo
Comment options

@rgroener
Comment options

@jimmo
Comment options

Answer selected by jimmo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants