Using Circuitpython on my first project, I followed this guide: https://learn.adafruit.com/micropython-hardware-sd-cards/tdicola-circuitpython
Here's my code, and below that the error messages.
import os
import board
import time
from adafruit_onewire.bus import OneWireBus
import adafruit_ds18x20
import analogio
import busio
import digitalio
import storage
import adafruit_sdcard
import adafruit_max31855
SD_CS = board.D44
# Next create the SPI bus and a digital output for the microSD card's
# chip select line (be sure to select the right pin name or number for your wiring)
spi = busio.SPI(board.D45, MOSI=board.D43, MISO=board.D42)
cs = digitalio.DigitalInOut(SD_CS)
sdcard = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
** line 19 is: sdcard = adafruit_sdcard.SDCard(spi, cs)
Traceback (most recent call last):
File "code.py", line 19, in <module>
File "adafruit_sdcard.py", line 116, in __init__
File "adafruit_sdcard.py", line 177, in _init_card
File "adafruit_sdcard.py", line 145, in _init_card
OSError: no SD card
I'm using a FAT32 formatted 32GB uSD card, formatted with SD Card Formatter. It's a cheap card, and the only one out of 5 that I confirmed works completely in my PC via a USB adapter. 2 other cards in the 5-pack worked in the PC, but were fried after trying them in the Teensy with this code.
Here's my code, and below that the error messages.
import os
import board
import time
from adafruit_onewire.bus import OneWireBus
import adafruit_ds18x20
import analogio
import busio
import digitalio
import storage
import adafruit_sdcard
import adafruit_max31855
SD_CS = board.D44
# Next create the SPI bus and a digital output for the microSD card's
# chip select line (be sure to select the right pin name or number for your wiring)
spi = busio.SPI(board.D45, MOSI=board.D43, MISO=board.D42)
cs = digitalio.DigitalInOut(SD_CS)
sdcard = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
** line 19 is: sdcard = adafruit_sdcard.SDCard(spi, cs)
Traceback (most recent call last):
File "code.py", line 19, in <module>
File "adafruit_sdcard.py", line 116, in __init__
File "adafruit_sdcard.py", line 177, in _init_card
File "adafruit_sdcard.py", line 145, in _init_card
OSError: no SD card
I'm using a FAT32 formatted 32GB uSD card, formatted with SD Card Formatter. It's a cheap card, and the only one out of 5 that I confirmed works completely in my PC via a USB adapter. 2 other cards in the 5-pack worked in the PC, but were fried after trying them in the Teensy with this code.
Last edited: