ESP-IDF example SD/MMC fails with 0x107. Not sure about pins!

VincentP
Posts: 2
Joined: Tue Dec 03, 2024 10:17 pm

ESP-IDF example SD/MMC fails with 0x107. Not sure about pins!

Postby VincentP » Tue Dec 03, 2024 10:43 pm

I am getting to grips with the IDF. Thought I would try the SD card reader on my ESP32s3 WROOM 1 N16R8 OTG UART board.

Apart from setting the flash memory size, I've altered nothing but it fails with

Code: Select all

I (861) example: Initializing SD card
I (861) example: Using SDMMC peripheral
I (861) example: Mounting filesystem
I (871) gpio: GPIO[36]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (871) gpio: GPIO[35]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (881) gpio: GPIO[37]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (891) gpio: GPIO[38]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (901) gpio: GPIO[33]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (911) gpio: GPIO[34]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
E (941) sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107
E (941) vfs_fat_sdmmc: sdmmc_card_init failed (0x107).
I (941) gpio: GPIO[36]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (951) gpio: GPIO[35]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (961) gpio: GPIO[37]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (971) gpio: GPIO[38]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (981) gpio: GPIO[33]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (981) gpio: GPIO[34]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (991) gpio: GPIO[0]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1001) gpio: GPIO[0]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1011) gpio: GPIO[0]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1021) gpio: GPIO[0]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
E (1031) example: Failed to initialize the card (ESP_ERR_TIMEOUT). Make sure SD card lines have pull-up resistors in place.
I note that pin GPIO[34] appears to be output enabled and hence Pullup=0. According to ReadMe files all these pins should be Pulled up.
I've tried 3 separate boards with the same result.


Any pointers??

VincentP
Posts: 2
Joined: Tue Dec 03, 2024 10:17 pm

Re: ESP-IDF example SD/MMC fails with 0x107. Not sure about pins!

Postby VincentP » Wed Dec 04, 2024 3:34 pm

I worked it out.
If you look at the masking on the board it has a legend -=Camera, ~=SD and * = psram. Pins 38,39 & 40 had a tilde (~) next to them.
So, by using a spy glass and continuity testing I determined that the CMD, CLK and D0 pins were connected to 38,39 & 40, respectively.

I couldn't find any other connected (except VDD and VSS).

In menuconfig I set it to 1 line operation. With CMD, ClK & D0 set to the above pins.

Bingo! it worked.

Hope someone finds this helpful. :D

Who is online

Users browsing this forum: No registered users and 5 guests