-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't write or read the eMMC (IDFGH-1398) #3676
Comments
Can you set log level to verbose in menuconfig, and attach the output you get? |
No, indeed the log level needs to be set when compiling with the esp-idf. Since your test code is mostly independent from Arduino functionality, can you switch to IDF for the purpose of debugging this? You can also use Arduino library as IDF component: https://github.com/espressif/arduino-esp32/blob/master/docs/esp-idf_component.md |
|
I am currently using the ESP32 to read/write sectors for the eMMC devices. The circuit set up is as below.
However, I can get the information from the chip, but the read/write operations are always fail with the error message E (6505) sdmmc_req: sdmmc_host_wait_for_event returned 0x107
E (6505) sdmmc_cmd: sdmmc_write_sectors_dma: sdmmc_send_cmd returned 0x107
`#include <stdio.h>
#include <string.h>
#include <sys/unistd.h>
#include <sys/stat.h>
#include "esp_err.h"
#include "esp_log.h"
#include "esp_vfs_fat.h"
#include "driver/sdmmc_host.h"
#include "driver/sdspi_host.h"
#include "sdmmc_cmd.h"
#include "driver/gpio.h"
void setup(){
Serial.begin(112500);
sdmmc_host_init();
sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT();
slot_config.width = 4;
sdmmc_host_init_slot(SDMMC_HOST_SLOT_1, &slot_config);
sdmmc_host_t host = SDMMC_HOST_DEFAULT();
//host.max_freq_khz = SDMMC_FREQ_HIGHSPEED;
//host.max_freq_khz = SDMMC_FREQ_PROBING;
sdmmc_card_t card;
sdmmc_card_init(&host,&card);
Serial.println("\n ready to get information");
sdmmc_card_print_info(stdout, &card);
sdmmc_write_sectors(&card, data, 1000, 1);
Serial.println("check write");
ESP_ERROR_CHECK( sdmmc_write_sectors(&card, data, 1000, 1) );
sdmmc_read_sectors(&card, buff, 1000, 1);
ESP_ERROR_CHECK( sdmmc_read_sectors(&card, buff, 1000, 1) );
}
void loop() {
// put your main code here, to run repeatedly:
}`
the output is shown below
ready to get information Name: Q2J55L� Type: MMC Speed: 20 MHz Size: 7264MB CSD: ver=3, sector_size=512, capacity=14876672 read_bl_len=9 E (6505) sdmmc_req: sdmmc_host_wait_for_event returned 0x107 E (6505) sdmmc_cmd: sdmmc_write_sectors_dma: sdmmc_send_cmd returned 0x107 check write
The text was updated successfully, but these errors were encountered: