LyraT-mini SD-card

Altivecer
Posts: 15
Joined: Thu May 05, 2022 10:55 pm

LyraT-mini SD-card

Postby Altivecer » Thu May 05, 2022 11:33 pm

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?

Altivecer
Posts: 15
Joined: Thu May 05, 2022 10:55 pm

Re: LyraT-mini SD-card

Postby Altivecer » Fri May 20, 2022 4:47 pm

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.

Who is online

Users browsing this forum: No registered users and 67 guests