I am experiencing issues with using the SD card on a SparkFun Thing Plus - RP2040 board. I am utilizing the “no-OS-FatFS-SD-SDIO-SPI-RPi-Pico” library. The example code provided in the library’s “examples/simple” directory works flawlessly with my Pico module and a standard SD card module when only the standard SPI pins are connected(same connections as Thing Plus). However, I am encountering problems when attempting to use the same setup with the Thing Plus board. I am receiving the error “f_mount error: The physical drive cannot work (3)”. Could there be something I am overlooking? Thank you.
You’ll need to change the pin # assignments in the config file to match the Thing Plus SD pins (go to SD card section) and then re-attempt
Thank you for the response. I had already done it in “hw_config.c” as follows:
static spi_t spi = {
.hw_inst = spi1, // RP2040 SPI component
.sck_gpio = 14, // GPIO number (not Pico pin number)
.mosi_gpio = 15,
.miso_gpio = 12,
.baud_rate = 1000 * 1000// Actual frequency: 10416666.
};
static sd_spi_if_t spi_if = {
.spi = &spi, // Pointer to the SPI driving this card
.ss_gpio = 9 // The SPI slave select GPIO for this SD card
};
static sd_card_t sd_card = {
.card_detected_true = false,
.type = SD_IF_SPI,
.spi_if_p = &spi_if // Pointer to the SPI interface driving this card
};
Based on this:
Is there a typo in the baud rate line? The default config has 12 * 1000 * 1000; maybe that’ll help?
I tried many values, including this one, but unfortunately, I didn’t get any different results. I tried setting the pins to pull-up in software, but it didn’t help. Should I try SDIO?
Yea, I’d say try a different SD library of some kind and see if that helps