adafruit feather rp2040 usb host + adalogger wing, no sd card OSError

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
mweisbr
 
Posts: 16
Joined: Fri Feb 22, 2019 9:40 am

adafruit feather rp2040 usb host + adalogger wing, no sd card OSError

Post by mweisbr »

Hello

I am trying to access a sd card with the adafruit feather rp2040 usb host microcontroller (http://adafru.it/2922) and the adafruit adalogger featherwing rtc+sd (http://adafru.it/5723) to store sensor values on it. However, I can not get the sd card to be identified (OSError: no sd card). I have tried three different sd cards, formatted them with the sd card memory formatter. I have also tried two adalogger wings with the same result. I also tested all cs pins (5,9,10,13,25) in the code. I hope someone can help me. Here is my test code

Code: Select all

# Bibliotheken
import os
import storage
import board
import busio
import digitalio
import sdcardio
import time
import microcontroller
import displayio
import terminalio

spi = board.SPI()
cs = board.D5
sdcard = sdcardio.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")

# Start Logging
print("Logging temperature to filesystem")

# Log Time 
log_time = 2
last_log_time = -1

# Loop
while True:
    
    try:
        now = time.monotonic()
        if now >= last_log_time + log_time:
            with open("/sd/test.txt", "a") as f:
                t = microcontroller.cpu.temperature
                print("Temperature = %0.1f" % t)
                f.write("%0.1f\n" % t)
                last_log_time = now
    
    except Exception as e:
        print("Error:\n", str(e))
        print("Resetting microcontroller in 5 seconds")
        time.sleep(5)
        microcontroller.reset()
Thanks!

User avatar
mweisbr
 
Posts: 16
Joined: Fri Feb 22, 2019 9:40 am

Re: adafruit feather rp2040 usb host + adalogger wing, no sd card OSError

Post by mweisbr »

i just tested the code with the normal feather rp2040 without usb host and everything works there

User avatar
alpierce
 
Posts: 207
Joined: Mon May 13, 2013 2:44 am

Re: adafruit feather rp2040 usb host + adalogger wing, no sd card OSError

Post by alpierce »

There are slight differences in the pinouts of the Feather RP2040 and the Feather RP2040 USB Host. The RP2040 GPIOs are mapped to the feather pins differently. Study the “Pretty Pins” diagrams to see the differences and check that against the pins you use in your code. That may be the source of the problem.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”