I can't get the SD card / SD card reader to work. What am I doing wrong?

Parts and library

Arduino Uno WiFi Rev. 2

Amazon.com: HiLetgo 5pcs Micro SD TF Card Adater Reader Module 6Pin SPI Interface Driver Module with chip Level Conversion for Arduino UNO R3 MEGA 2560 Due : Electronics

Amazon.com: Amazon Basics microSDXC Memory Card with Full Size Adapter, A2, U3, Read Speed up to 100 MB/s, 64 GB, Pack of 2, Black/Customized : Electronics. Yes, I am (now) aware that SDXC cards are not compatible with the built-in SD library, which is why I am trying to use the following library.

SdFat - Arduino Reference

(More info)



Output from 'QuickStart' example sketch

MISO: 33

MOSI: 32

SCK: 34

SS: 22

Be sure to edit DISABLE_CHIP_SELECT if you have

a second SPI device. For example, with the Ethernet

shield, DISABLE_CHIP_SELECT should be set to 10

to disable the Ethernet controller.

SD chip select is the key hardware option.

Common values are:

Arduino Ethernet shield, pin 4

Sparkfun SD shield, pin 8

Adafruit SD shields and modules, pin 10

Enter the chip select pin number:

I pick 8.

Assuming the SD is the only SPI device.

Edit DISABLE_CHIP_SELECT to disable another device.

SD initialization failed.

Do not reformat the card!

Is the card correctly inserted?

Is chipSelect set to the correct value?

Does another SPI device need to be disabled?

Is there a wiring/soldering problem?

errorCode: 0x1, errorData: 0x0

Output from 'SdFormatter' example sketch

Assuming the SD is the only SPI device.

Edit DISABLE_CS_PIN to disable an SPI device.

Assuming the SD chip select pin is: 22

Edit SD_CS_PIN to change the SD chip select pin.

Type any character to start

...

This program can erase and/or format SD/SDHC/SDXC cards.

Erase uses the card's fast flash erase command.

Flash erase sets all data to 0X00 for most cards

and 0XFF for a few vendor's cards.

Cards up to 2 GiB (GiB = 2^30 bytes) will be formated FAT16.

Cards larger than 2 GiB and up to 32 GiB will be formatted

FAT32. Cards larger than 32 GiB will be formatted exFAT.

Warning, all data on the card will be erased.

Enter 'Y' to continue:

I press 'Y'.

error: card init failed.

No card, wrong chip select pin, or wiring error?

SD errorCode: SD_CARD_ERROR_CMD0 = 0x1

SD errorData = 0x0

Further notes

I've even tried changing the SPI clock speed.

try a 1gb card

SD cards have a 32gb limit. You can only use DOS 8.3 file and directory names.
The SD cards do not have a RESET signal. You should power cycle to restart after downloading.
Single duponts aren't really good for gang wiring. An M-F dupont ribbon cable will work better. When dupont sockets twist on the pins, the internals of the connector gets sprung, and the connection becomes iffy.


The 3D printed shrouds hold the connectors in a group for easy insertion, superior retention, and no twisting.
SD card is in vertical 3d print plastic mount at left, with access hole in rear apron, for changing the card without having to open the project case.

Are you try to use these pin numbers with Uno?

Taking a look at the pinout, those numbers are (for*) the corresponding interrupts. I don't know how to modify the sketch in order to change those numbers: using 'find' to search for them in the sketch doesn't turn up any results.

I've tried inputting '35' as the chip select pin number, which didn't work.

*Not sure about the proper terminology.

Why do you use interrupt numbers instead of pin numbers?
The maximum pin number of the Uno is 22, using the number like 35 is a pointless.

Pin number is a nearest digit to the pin on a pinout diagram, the pin with INT 35 has a number 8.
Also fo SPI pins - instead of
MISO: 33
MOSI: 32
SCK: 34
you should use 12, 11 & 13

If you look at the OP's wiring picture, it IS connected to 11, 12, & 13.

The SD library seems easier to use / to be better documented than SdFat, so I'm considering returning the SDXC cards and purchasing SDHC or SD cards instead.

Though that doesn't change the fact that there is still a problem that needs solving, or a mistake I am making—and if I am experiencing a problem or making a mistake, there are likely others who will experience the same problem or make the same mistake; SdFat is supposed to work with SDXC cards, but does not in my case.

The return window for the SD cards closes on July 1. It seems this will end up being a cold case.

What do you mean?

It is unsolved. The problem has not been fixed, and I do not currently have the know-how, or time*, to look-into it further. I plan on returning the SD cards, and buying "the right ones" this time. If someone else encounters this problem, they're out of luck, unless they're smarter than me and actually figure it out.

*"This topic will close 6 months after the last reply." And the return window for the SD cards closes July 1.

Will this (probably) work?

on my current project, using an ESP32 card with a built in SD card module:

the program will not load with an S card plugged in the module

if you upload the program with no SD card plugged in
1gb cards like you show above, 2 gb cards, 4 gb cards work, but the board indicates the SD module does not work if you do not have a card plugged in. you hqve tomupload with no SD card, insert a card and reload to get to a functional SD card.

16 gb cards do not work.
I have no 8gb cards to try

16 GB SDHC cards works fine for me with the same cardreader as OP used/

I don't see your code in the thread, nor the wiring diagrams.

Did you look at post #1?

According to the forum rules you should insert your code at the forum as text using the code tags. I don't see anything like in the post 1. Links to the example codes are not useful, because we need to see EXACT your code, with all your editions, like a pin numbers...
Seeing your answer in post #5 I suspect you have a error in pin numbers in the code.

The same with connections. Please insert YOUR wiring diagram.

Without all these your chances to get help will be quite small.

I've already returned the SD cards, so it doesn't matter anymore.

The posted images (the last two, specifically) are/were my "wiring diagram".

What was wired (pic) vs what was planned (schematic) , are why we need a picture to compare with the schematic. Either alone is insufficient. Having confirmed what was wired was intended, we can then move on to other possibilities.

I didn't have a planned schematic. This wasn't part of any larger project (yet); I was merely testing things out. (It's generally good idea to start out small, right?)