TAB5 SD doesnt work in Arduino IDE
-
I have been trying to convert some core2 code to work with Tab5 with little success when in comes to the microSD. I have chatted with chat.m5stack.com to get some minimal working code and it still doesn't work. I have tested on known good cards and 2 new TAB5s.
Here's the code from their chat bot (doesn't work)
thanks for any direction,
Kris#include <M5Unified.h>
#include <SPI.h> // Include SPI library
#include <SD.h> // Include Arduino SD library// Tab5 SD card SPI pin definitions
#define SD_CS_PIN 4
#define SD_SCK_PIN 18
#define SD_MISO_PIN 19
#define SD_MOSI_PIN 23void setup() {
auto cfg = M5.config();
M5.begin(cfg); // Initialize M5Unified// Initialize SPI for SD card
SPI.begin(SD_SCK_PIN, SD_MISO_PIN, SD_MOSI_PIN, SD_CS_PIN);// Initialize SD card with specified CS pin and speed (25MHz)
if (!SD.begin(SD_CS_PIN, SPI, 25000000)) {
M5.Lcd.println("SD Card failed!");
while (1); // Halt if failed
}
M5.Lcd.println("SD Card initialized.");
}void loop() {}
-
-
@felmue Thanks for testing Felix. If you hear of any work arounds, please let us know.
-
-
I managed to get the SD card reader to work.
H_SDIO_DRV error: sdio card init failed
The WiFi module (ESP32-C6) uses an independent set of dedicated pins (SDIO2_D0 to SDIO2_CK), thus avoiding any physical interface overlap and conflicts.sd_mmc_card:
id: sd_card
clk_pin: GPIO43
cmd_pin: GPIO44
data0_pin: GPIO39
data1_pin: GPIO40
data2_pin: GPIO41
data3_pin: GPIO42
mode_1bit: false
slot: 0esp32_hosted:
variant: esp32c6
active_high: true
clk_pin: GPIO12
cmd_pin: GPIO13
d0_pin: GPIO11
d1_pin: GPIO10
d2_pin: GPIO9
d3_pin: GPIO8
reset_pin: GPIO15
slot: 1