Xinyuan-LilyGO / T-Dongle-S3

An ESP32S3 development board that can freely use WIFI, BLE, TF, LED, TFT_LCD functions.
MIT License
144 stars 46 forks source link

Card Mount Failed due to ESP_ERR_TIMEOUT #1

Closed datacute closed 1 year ago

datacute commented 2 years ago

If I use the Arduino IDE (v2.0.1) with arduino-esp32 2.0.5 https://github.com/espressif/arduino-esp32 I can add the SD_MMC.setPins line and run the SSDMMC_Test and read from some microSD cards with no problem.

However using PlatformIO, building and installing the Factory project results in the Card Mount Failed error.

E (4001) sdmmc_req: sdmmc_host_wait_for_event returned 0x107 E (4001) sdmmc_sd: sdmmc_check_scr: send_scr returned 0x107 E (4002) vfs_fat_sdmmc: sdmmc_card_init failed (0x107). [ 4231][E][SD_MMC.cpp:138] begin(): Failed to initialize the card (0x107). Make sure SD card lines have pull-up resistors in place. Card Mount Failed scan start scan done 5 networks found etc.

I see that 0x107 is ESP_ERR_TIMEOUT

datacute commented 2 years ago

I found a solution - updating platformio.ini to use version 2.0.5 of framework-arduinoespressif32 (latest at the time that I write this).

I then get this output:

SD_MMC Card Type: SD_MMCHC SD_MMC Card Size: 30543 Total space: 30526MB Used space: 0MB scan start scan done etc.

mmMicky commented 2 years ago

Looks like you've found a workaround. Please close this issue if the issue has been resolved.

bratoff commented 1 year ago

Looks like you've found a workaround. Please close this issue if the issue has been resolved.

Maybe not completely solved. I am using a rebuild of the Factory project with Arduino 1.8.19 and arduino-ESP32 2.0.5, although I had the same issue with the Factory firmware received on the board. I am observing that some brands of micro SD cards work and others do not. Based on my testing, it does not seem to be related to the card size or how it was formatted (all are formatted FAT32 at the default block size). Of the various cards I have on hand, Samsung, Centon and Amplim all work, while Kingston and Patriot do not.

datacute commented 1 year ago

@bratoff I think you need to open a new issue. This line was for individual cards working or not due to the programming environment.