Thank you for the advice.
and, I'm very sorry.
the connection and sketch I indicated was wrong.
confused.
Finally I reffer and correct information are here.
Maybe, it is almost dead copy of the refference page.
https://lang-ship.com/blog/work/m5stickc-spi-sd-3wire/
M5StickCPlus >>>> SD
3V3 >>>> 3V3
GND >>>> GND
0 >>>> CLK
36 >>>> MISO
26 >>>> MOSI
GND >>>> CS
#include <M5StickCPlus.h>
#include "SD.h"
SPIClass SPI_EXT;
// PIN配置
enum { spi_sck = 0, spi_miso = 36, spi_mosi = 26, spi_ss = -1 };
void setup()
{
// M5StickC initialize
M5.begin();
M5.Lcd.setRotation(3);
// SPI initialize
SPI_EXT.begin(spi_sck, spi_miso, spi_mosi, spi_ss);
// SD initialize
if (!SD.begin(spi_ss, SPI_EXT)) {
M5.Lcd.println("Card Mount Failed");
return;
}
// SD check
uint8_t cardType = SD.cardType();
if (cardType == CARD_NONE) {
M5.Lcd.println("None SD Card");
return;
}
M5.Lcd.print("SD Card Type: ");
if (cardType == CARD_MMC) {
M5.Lcd.println("MMC");
} else if (cardType == CARD_SD) {
M5.Lcd.println("SDSC");
} else if (cardType == CARD_SDHC) {
M5.Lcd.println("SDHC");
} else {
M5.Lcd.println("UNKNOWN");
}
// SD volume
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
M5.Lcd.printf("SD Card Size: %lluMB\n", cardSize);
}
void loop() {
}