Using Adafruit PiCowbell Adalogger for Pico - MicroSD, RTC & STEMMA QT

Continuing on with my temperature logging project as mentioned here, I have my Raspberry Pi Pico connected to an Adafruit PiCowbell Adalogger for Pico - MicroSD, RTC & STEMMA QT, and I’m having trouble with the sdcard slot in the PiCowbell.

Adafruit’s page for the PiCowbell is using CircuitPython, and it’s a whole different set of libraries to mess about with, so I was hoping to use the Makerverse Micro SD Adapter - MicroPython Guide and Data Logging

I have the basic test code from that tutorial modified to use the Adalogger’s pinouts for its SDCard:

from machine import SPI, Pin
import sdcard, uos

spi = SPI(0,sck=Pin(18), mosi=Pin(19), miso=Pin(16))
cs = Pin(17)
sd = sdcard.SDCard(spi, cs)

uos.mount(sd, '/sd')
print(uos.listdir('/sd'))

Which is running happily up until it tries to mount the card:

MPY: soft reboot
Traceback (most recent call last):
  File "<stdin>", line 8, in <module>
OSError: [Errno 19] ENODEV

Just wondering if anyone who has used the PiCowbell datalogger in a micropython project and gotten the sdcard working might be able to share some working code?

2 Likes

I did find this post where someone was askinig for help with the same error code, and they fixed their issue by switching to a fat32 formatted 32GB SDcard. I was using a 64GB sdcard, so I re-formatted a 16GB sdcard as fat32 and stored a single empty file on it called “success”, but I still get the ENODEV error.

1 Like

Well, I found an older 2GB SDCard, and that is working! SDCard compatibility is a mess!

2 Likes

What a trap!
I’m not too familiar with CircuitPython so I do wonder how well the Makerverse driver (vanilla MicroPython) works on a Pico running CircuitPython.

16GB does feel like a safer size in general - i start hearing alarm bells when I consider an embedded microcontroller project using a 64GB uSD card.

Glad you’re back on track, and thanks for taking the time to document your findings! It helps everybody in the end :slight_smile:

Yep, nothing more annoying that finding a post with the exact same question as you have and finding there’s no definite answer!

For anyone trying to use this board in Micropython, there’s code for all the features in this project

2 Likes