SD example crashs on ESP-WROVER-KIT

StefanS
Posts: 10
Joined: Sat Jul 07, 2018 1:12 pm

SD example crashs on ESP-WROVER-KIT

Postby StefanS » Sat Jul 07, 2018 1:18 pm

Hello,

I've two ESP-WROVER-KIT and the SD card example crashes always on one board, and works with the second one.
The example is exactly as provided by IDF, only with modified SD slot number:

Code: Select all

sdmmc_host_t host = SDMMC_HOST_DEFAULT();
host.slot = SDMMC_HOST_SLOT_1;
This is the console output:

Code: Select all

I (298) example: Initializing SD card
I (298) example: Using SDMMC peripheral
I (303) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
Guru Meditation Error: Core  0 panic'ed (InstrFetchProhibited)
. Exception was unhandled.
Core 0 register dump:
PC      : 0x800e52e5  PS      : 0x00060630  A0      : 0x800e52e5  A1      : 0x3ffc6e40  
A2      : 0x0000000d  A3      : 0x00000001  A4      : 0x00000027  A5      : 0x00000000  
A6      : 0x00002000  A7      : 0x00000000  A8      : 0x3f405cb4  A9      : 0x00000000  
A10     : 0x00000020  A11     : 0x00000000  A12     : 0x3f405264  A13     : 0x00000010  
A14     : 0x00000003  A15     : 0x00000005  SAR     : 0x00000007  EXCCAUSE: 0x00000014  
EXCVADDR: 0x800e52e4  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xfffffffe  

Backtrace: 0x400e52e5:0x3ffc6e40 0x400e52e2:0x3ffc6e70 0x400e61f2:0x3ffc6ec0 0x400d2bf9:0x3ffc6f10 0x400d0ede:0x3ffc7010
0x400e52e5: sdmmc_host_init_slot at /opt/toolkit-esp32/esp-idf/components/driver/sdmmc_host.c:396

0x400e52e2: sdmmc_host_init_slot at /opt/toolkit-esp32/esp-idf/components/driver/sdmmc_host.c:395

0x400e61f2: esp_vfs_fat_sdmmc_mount at /opt/toolkit-esp32/esp-idf/components/fatfs/src/vfs_fat_sdmmc.c:75

0x400d2bf9: app_main at ??:?

0x400d0ede: main_task at /opt/toolkit-esp32/esp-idf/components/esp32/cpu_start.c:470


Entering gdb stub now.
Any idea what could be the reason for this?

Thank you

Stefan

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: SD example crashs on ESP-WROVER-KIT

Postby ESP_Sprite » Sun Jul 08, 2018 11:00 am

From memory, that slot shares pins with the SPI flash (given that you use a pre-existing module or board, or the default flash pins). Your code is (mostly) executed from that flash, so re-purposing those pins for something else is something the ESP32 doesn't quite like as all of a sudden it can't access its program data anymore.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: SD example crashs on ESP-WROVER-KIT

Postby WiFive » Sun Jul 08, 2018 5:39 pm

This doesn't actually do anything

Code: Select all

host.slot = SDMMC_HOST_SLOT_1;
https://github.com/espressif/esp-idf/bl ... host.h#L37

StefanS
Posts: 10
Joined: Sat Jul 07, 2018 1:12 pm

Re: SD example crashs on ESP-WROVER-KIT

Postby StefanS » Mon Jul 09, 2018 2:27 pm

Sprite, you're right that the first SDMMC slot is shared by the flash (SDMMC_HOST_SLOT_0).
The second slot (SDMMC_HOST_SLOT_1) is directly wired to the SD card holder in ESP-WROVER-KIT v3.
So I guess the reason for the crash is something else.

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: SD example crashs on ESP-WROVER-KIT

Postby ESP_Sprite » Tue Jul 10, 2018 2:22 am

Oops, because your code implied you changed the slot from the default I imagined you were using slot 0. Sorry for throwing you that red herring!

Who is online

Users browsing this forum: No registered users and 139 guests