My circuit is:
I am attempting to use https://github.com/micropython/micropyt ... /sdcard.py this driver with the code:
I have two SD cards, one gives the error:import sdcard
import os
import utime
# Set the SPI controls for the ADC
spi_sck=machine.Pin(18)
spi_tx=machine.Pin(19)
spi_rx=machine.Pin(16)
spi=machine.SPI(0,baudrate=100000,sck=spi_sck, mosi=spi_tx, miso=spi_rx)
spi_SDCS = machine.Pin(13)
# Set the SPI values for the SD card
sd = sdcard.SDCard(spi, spi_SDCS)
os.mount(sd, "/SD")
print('Done')
Traceback (most recent call last):
File "<stdin>", line 17, in <module>
OSError: 19
the second gives:
Traceback (most recent call last):
File "<stdin>", line 14, in <module>
File "sdcard.py", line 48, in __init__
File "sdcard.py", line 81, in init_card
File "sdcard.py", line 129, in init_card_v2
OSError: timeout waiting for v2 card
I have attempted umount('/') before mounting (to '/' or '/SD') but that doesn't appear to fix anything.
I assume the second one at 32 GB is too big to read or something similar. Both are FAT32 formatted empty microSD cards (8GB and 32GB). The board appears to be talking to the SPI of the SD card reader correctly but the OS mounting seems to be the issue. Has anyone managed to add an external SD card reader and have any suggestions on what I might be doing wrong?