I’m trying to get the esp-idf/examples/storage/sd_card/sdspi example to work on the esp32-LyraT-mini card, but I get an 0x107 error when it runs.
The esp-adf/examples/audio_processing/poipeline_alc successfully plays music files on the sd-card, so I know the hardware works.
The audio example calls audio_board_sdcard_init, which has the below code in it, which I’m guessing is setting up GPIO_NUM_32. I’m guessing the sdspi example code is not doing this, but I’m nite sure where/how to add it.
gpio_config_t sdcard_pwr_pin_cfg = {
.pin_bit_mask = 1UL << SDCARD_PWR_CTRL,
.mode = GPIO_MODE_OUTPUT,
.pull_up_en = GPIO_PULLUP_DISABLE,
.pull_down_en = GPIO_PULLDOWN_DISABLE,
.intr_type = GPIO_INTR_DISABLE,
};
gpio_config(&sdcard_pwr_pin_cfg);
gpio_set_level(SDCARD_PWR_CTRL, 0);
Has anyone update the examples to work with the new development boards?
Hi.
Unfortunately, I’m not familiar with audio examples or ESP-IDF.
I found this example for the Arduino core that shows how to play a specific file from the SD card:
- https://github.com/schreibfaul1/ESP32-audioI2S/wiki#what-audio-events-are-there
- https://github.com/schreibfaul1/ESP32-audioI2S/blob/master/examples/I2Saudio/I2Saudio.ino
I hope this helps.
Regards,
Sara
Hi Sara,
I figured this one out. The code has just not been updated for their new development board. if the following is added to the code it works. They added a FET to turn on and off the power to the SD card.
#define SDCARD_PWR_CTRL 13
at the top of main, add the following.
// Turn SD card on
gpio_config_tsdcard_pwr_pin_cfg = {
.pin_bit_mask = 1UL << SDCARD_PWR_CTRL,
.mode = GPIO_MODE_OUTPUT,
.pull_up_en = GPIO_PULLUP_DISABLE,
.pull_down_en = GPIO_PULLDOWN_DISABLE,
.intr_type = GPIO_INTR_DISABLE,
};
gpio_config(&sdcard_pwr_pin_cfg);
gpio_set_level(SDCARD_PWR_CTRL, 0);
I’m sure the same problem will occur when using the Arduino examples on the esp32-LyraT-mini card.