M5GFX icon indicating copy to clipboard operation
M5GFX copied to clipboard

SD card not working

Open rudiratlos opened this issue 9 months ago • 2 comments

Hello, I know that SD library is not included in m5unified/m5gfx. I tried:

SD.begin(4, SPI, 25000000); on my m5paper and SD.begin(47, SPI, 25000000); on my new m5paperS3, but nothing worked.

my include order: #include <SD.h> #include <epdiy.h> #include <M5Unified.h>

any suggestion, how get this working again?

rudiratlos avatar Mar 17 '25 16:03 rudiratlos

Hello @rudiratlos

you probably need to initialize SPI with the proper GPIOs for M5PaperS3. E.g. something like:

SPI.begin(<SCK_PIN>, <MISO_PIN>, <MOSI_PIN>)

M5PaperS3 pinmap see here.

Thanks Felix

felmue avatar Mar 21 '25 14:03 felmue

Thank you felmue, your tip was the right way. Below my code snipped to get SD.begin() working to read sd card file.

` switch (M5.getBoard()) { case 19: // c_BoardVersionPaperS3 PIN_SD_CS = GPIO_NUM_47; SPI.begin(GPIO_NUM_39, GPIO_NUM_40, GPIO_NUM_38, PIN_SD_CS); // SCK, MISO, MOSI, SD break; case 7: // c_BoardVersionPaper PIN_SD_CS = GPIO_NUM_4; break; }

SD.begin(PIN_SD_CS);

rudiratlos avatar Mar 23 '25 07:03 rudiratlos

I think this issue is resolved so I'll close it. Thanks @felmue .

lovyan03 avatar Sep 08 '25 02:09 lovyan03