Reputation: 19
I'm using a esp32 CamPlus OV5640 Rev 1.2.1 (example) and cannot get the SD card to initialise.
These are my details:
The specific error is:
E (6343) sdmmc_req: handle_idle_state_events unhandled: 00001000 00000000
E (10353) sdmmc_periph: sdmmc_host_clock_update_command(200): sdmmc_host_start_command returned 0x107
E (10353) sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107
E (10353) vfs_fat_sdmmc: sdmmc_card_init failed (0x107).
I've tried:
SD_MMC.begin()
)I'm unable to find much detail on this new (2025) board. (Note it is different to the common esp32cam board for which SD card is fine)
Any ideas, success stories or resources would be greatly appreciated!
#include "esp_vfs_fat.h"
#include "sdmmc_cmd.h"
#include "driver/sdmmc_host.h"
static const char *TAG = "example";
#define MOUNT_POINT "/sdcard"
void app_main(void)
{
esp_err_t ret;
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
.format_if_mount_failed = false, // tried true
.max_files = 3,
.allocation_unit_size = 4096 // tried 16 * 1024 too
};
sdmmc_card_t *card;
const char mount_point[] = MOUNT_POINT;
ESP_LOGI(TAG, "Using SDMMC peripheral");
sdmmc_host_t host = SDMMC_HOST_DEFAULT();
// host.max_freq_khz = 400; // Tried to lower frequency
// host.slot = SDMMC_HOST_SLOT_1; // Tried to customize slot
sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT();
// Set bus width to use:
slot_config.width = 4; // tried 1 too
// Tried to customize pins from
// https://ae01.alicdn.com/kf/S9e1bdd0e28c5479bbbf5a81bb51c93d7W.jpg
// slot_config.clk = 31;
// slot_config.cmd = 30;
// slot_config.d0 = 32;
// slot_config.d1 = 33;
// slot_config.d2 = 28;
// slot_config.d3 = 29;
ESP_LOGI(TAG, "Mounting filesystem");
ret = esp_vfs_fat_sdmmc_mount(mount_point, &host, &slot_config, &mount_config, &card);
if (ret != ESP_OK)
{
if (ret == ESP_FAIL)
{
ESP_LOGE(TAG, "Failed to mount filesystem. ");
}
else
{
ESP_LOGE(TAG, "Failed to initialize the card (%s). ", esp_err_to_name(ret));
// fails here with
// E (1343) sdmmc_periph: sdmmc_host_clock_update_command(200): sdmmc_host_start_command returned 0x107
}
return;
}
ESP_LOGI(TAG, "Filesystem mounted");
sdmmc_card_print_info(stdout, card);
esp_vfs_fat_sdcard_unmount(mount_point, card);
}
Upvotes: 1
Views: 42