VS1053 and arduino mega2560

Hello

I try to connect an vs1053 card with an arduino mega2560 and i have always the same error :

Couldn't find VS1053, do you have the right pins defined?

Or

Can't access SD card. Do not reformat. No card, wrong chip select pin, or SPI problem? SD errorCode: 0X20,0XFF

My connection :

| vs1053 | Mega | | - | - | | 5V | 5V | | GND | GND | | CS | 10 | | MISO | 50 | | MOSI | 51 | | SCK | 52 | | XCS | 7 | | XRESET | 9 | | XDCS | 8 | | DREQ | 3 |

Thank for your help

I finded the solution, I have a Arduino mega 2560 with a shield USB and i tried to connect a vs1053’s card.

I had always an error

Can’t access SD card. Do not reformat.
No card, wrong chip select pin, or SPI problem?
SD errorCode: 0X20,0XFF

I resolved the error with this code :

// Chip select may be constant or RAM variable.
const uint8_t SD_CHIP_SELECT_PIN = 4;
pinMode(10, OUTPUT); // <— ADD THIS
digitalWrite(10, HIGH); // <<— ADD THIS
if (!sd.begin(SD_CHIP_SELECT_PIN)) {
sd.initErrorHalt();
}

I defined another pin for the pin 10 because it was use by the USB Shield.

Now it’s work