THINK PLUS RP2040 - SD CARD ERROR (cross post)

This is a cross-post from the Rapberry Pi forum, I’m hoping someone here can help with this issue. I’m having an issue with the Thing Plus RP2040 mounting the SD card. The error is “OSError: no SD card”. I know I’m missing something basic.

Trouble shooting steps I’ve tried so far:

  • Tried 3 different cards: 64MB (new), 4GB (used), 32GB (new)

  • Confirmed read and write to all cards using a card reader on my computer

  • Formatted (and re-formatted) to FAT

  • Purchased a new RP2040 board to ensure it wasn’t a bad board

  • Circuit python: 9.0.3, 9.0.4, 9.2(beta), 8.1, and 8.27

  • All three cards eject smoothly and normally.
  • This doesn’t seem to be a common problem, so it’s probably something simple.

    Any insight would be appreciated! I’m testing using the following three lines, error or line 3.

    import board
    import sdcardio
    sd = sdcardio.SDCard(board.SPI(), board.SD_CS)  #error here
    

    One other thing I have found is that dropping to REPL mode, I can confirm the “sdcardio” built in library:

    >>> help("modules")
    __future__        bitops            micropython       synthio
    __main__          board             msgpack           sys
    _asyncio          builtins          neopixel_write    terminalio
    _bleio            busio             nvm               time
    _pixelmap         collections       onewireio         touchio
    adafruit_bus_device                 countio           os                traceback
    adafruit_bus_device.i2c_device      digitalio         paralleldisplay   ulab
    adafruit_bus_device.spi_device      displayio         pulseio           ulab.numpy
    adafruit_pixelbuf errno             pwmio             ulab.numpy.fft
    aesio             floppyio          qrio              ulab.numpy.linalg
    alarm             fontio            rainbowio         ulab.scipy
    analogbufio       framebufferio     random            ulab.scipy.linalg
    analogio          gc                re                ulab.scipy.optimize
    array             getpass           rgbmatrix         ulab.scipy.signal
    atexit            gifio             rotaryio          ulab.scipy.special
    audiobusio        i2cperipheral     rp2pio            ulab.utils
    audiocore         i2ctarget         rtc               usb_cdc
    audiomixer        imagecapture      sdcardio          usb_hid
    audiomp3          io                select            usb_midi
    audiopwmio        json              sharpdisplay      uselect
    binascii          keypad            storage           vectorio
    bitbangio         math              struct            watchdog
    bitmaptools       microcontroller   supervisor        zlib
    Plus any modules on the filesystem
    >>>
    

    That board requires anything that’s on the SD card to be formatted as a UF2 file; check out the hookup guide’s notes https://learn.sparkfun.com/tutorials/rp … bootloader (also has a link to the bootrom code https://github.com/raspberrypi/pico-bootrom)

    Aren’t the UF2 files for flashing the board to a version of Circuit Python? I’ve already done this with several versions of Circuit Python. Once the board is flashed, the files on the board are python (.py or .mpy) files.

    I’ve also now tried several formatting options with both FAT and exFAT on the cards. But this feels like a problem with the card, not the code.

    Note I get the same error using the adafruit_sdcard library. Looking at that soure code, you can see the _R1_IDLE_STATE is not getting set after 5 attempts. I bumped it up to 50 to make sure there wasn’t a timeout issue.

    The link for that code is here: https://docs.circuitpython.org/projects … dcard.html

            with self._spi as card:
                # CMD0: init card; should return _R1_IDLE_STATE (allow 5 attempts)
                for _ in range(5):
                    if self._cmd(card, 0, 0, 0x95) == _R1_IDLE_STATE:
                        break
                else:
                    raise OSError("no SD card")
    

    Any help would be greatly appreciated!