Portenta H7 interface with MKR MEM Shield

Hello forum
Being trying to connect the Portenta H7 to MEK MEM shield of Arduino. I have installed a 16GB micro SD card and formatted to FAT32. The card does not initialize when the sketch is updated to Portenta. The wiring diagram is as below
SD card wiring

The code used is the following

#include <SPI.h>
#include <SD.h>

//int cspin = 4; //Pin on MEM shield
int cspin = D7; //Pin on Portenta H7

void setup() {
  Serial.begin(115200);
  pinMode(cspin, OUTPUT);

  Serial.print("Initializing SD card...");

  if (!SD.begin()) {
    Serial.println("initialization failed!");
    while (1);
  }
  Serial.println("initialization done.");
}

 
void loop() {
  
}

Need urgent help for a quick resolution

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.