Page 1 of 1

LyraT-mini SD-card

Posted: Thu May 05, 2022 11:33 pm
by Altivecer
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?

Re: LyraT-mini SD-card

Posted: Fri May 20, 2022 4:47 pm
by Altivecer
The code I found was the fix, I was just applying it to the wrong example.

I added the following at the beginning of main in the sd_card_example_main.c of sdmmc which is in the sd-card folder of the Examples.

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);

And it now works.