SDMMC 4-line mode not working

Pilgrim
Posts: 1
Joined: Tue Aug 21, 2018 1:05 pm

SDMMC 4-line mode not working

Postby Pilgrim » Tue Aug 21, 2018 1:28 pm

I have already read all of the threads about sdmmc here and on github too. Most of these threads are unresolved or old, so I couldn't find any solution for my problem.

I'm trying to get my esp32 wroom32 to get to work with an sd-card reader in sdmmc 4-line mode. The spi and 1-line modes are working, but the 4-line mode isn't.

I'm using the sdcard example:
  • I've put six 10k pullup resistors on the pins
  • I have already used the "set_flash_voltage 3.3V" command so the GPIO12 pin isn't the problem
  • When I'm flashing the esp the GPIO2 pin is on the GND, and when I'm monitoring it's on the 10k pullup
  • I'm using a breadbord so I added the next line to my code : host.max_freq_khz = SDMMC_FREQ_PROBING;
So what could be the problem?

The log file:

Code: Select all

MONITOR
--- idf_monitor on COM3 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x3f (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:8156
load:0x40078000,len:10068
load:0x40080400,len:6512
entry 0x40080780
D (70) bootloader_flash: mmu set block paddr=0x00000000 (was 0xffffffff)
I (35) boot: ESP-IDF v3.2-dev-343-g561884b6-dirty 2nd stage bootloader
I (35) boot: compile time 09:47:39
I (36) boot: Enabling RNG early entropy source...
D (42) boot: magic e9
D (44) boot: segments 04
D (47) boot: spi_mode 02
D (49) boot: spi_speed 00
D (52) boot: spi_size 02
I (55) boot: SPI Speed      : 40MHz
I (59) boot: SPI Mode       : DIO
I (63) boot: SPI Flash Size : 4MB
D (67) bootloader_flash: mmu set paddr=00000000 count=1
D (72) boot: mapped partition table 0x8000 at 0x3f408000
D (77) flash_parts: partition table verified, 4 entries
I (83) boot: Partition Table:
I (86) boot: ## Label            Usage          Type ST Offset   Length
D (94) boot: load partition table entry 0x3f408000
D (99) boot: type=1 subtype=2
I (102) boot:  0 nvs              WiFi data        01 02 00009000 00006000
D (109) boot: load partition table entry 0x3f408020
D (114) boot: type=1 subtype=1
I (117) boot:  1 phy_init         RF data          01 01 0000f000 00001000
D (125) boot: load partition table entry 0x3f408040
D (130) boot: type=0 subtype=0
I (133) boot:  2 factory          factory app      00 00 00010000 00100000
I (140) boot: End of partition table
D (145) boot: Trying partition index -1 offs 0x10000 size 0x100000
D (151) esp_image: reading image header @ 0x10000
D (156) bootloader_flash: mmu set block paddr=0x00010000 (was 0xffffffff)
D (163) esp_image: image header: 0xe9 0x09 0x02 0x01 40080f08
V (168) esp_image: loading segment header 0 at offset 0x10018
V (174) esp_image: segment data length 0xbc18 data starts 0x10020
V (180) esp_image: segment 0 map_segment 1 segment_data_offs 0x10020 load_addr 0
x3f400020
I (189) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x0bc18 ( 4
8152) map
D (197) bootloader_flash: mmu set paddr=00010000 count=1
V (220) esp_image: loading segment header 1 at offset 0x1bc38
D (220) bootloader_flash: mmu set block paddr=0x00010000 (was 0xffffffff)
V (221) esp_image: segment data length 0x22a4 data starts 0x1bc40
V (227) esp_image: segment 1 map_segment 0 segment_data_offs 0x1bc40 load_addr 0
x3ffb0000
I (236) esp_image: segment 1: paddr=0x0001bc40 vaddr=0x3ffb0000 size=0x022a4 (
8868) load
D (245) bootloader_flash: mmu set paddr=00010000 count=1
V (254) esp_image: loading segment header 2 at offset 0x1dee4
D (256) bootloader_flash: mmu set block paddr=0x00010000 (was 0xffffffff)
V (263) esp_image: segment data length 0x0 data starts 0x1deec
V (269) esp_image: segment 2 map_segment 0 segment_data_offs 0x1deec load_addr 0
x3ffb22a4
I (277) esp_image: segment 2: paddr=0x0001deec vaddr=0x3ffb22a4 size=0x00000 (
   0) load
D (286) bootloader_flash: mmu set paddr=00010000 count=1
V (291) esp_image: loading segment header 3 at offset 0x1deec
D (297) bootloader_flash: mmu set block paddr=0x00010000 (was 0xffffffff)
V (304) esp_image: segment data length 0x400 data starts 0x1def4
V (310) esp_image: segment 3 map_segment 0 segment_data_offs 0x1def4 load_addr 0
x40080000
0x40080000: _iram_start at D:/esp32/esp-idf/components/freertos/xtensa_vectors.S
:1685

I (318) esp_image: segment 3: paddr=0x0001def4 vaddr=0x40080000 size=0x00400 (
1024) load
0x40080000: _iram_start at D:/esp32/esp-idf/components/freertos/xtensa_vectors.S
:1685

D (327) bootloader_flash: mmu set paddr=00010000 count=1
V (333) esp_image: loading segment header 4 at offset 0x1e2f4
D (338) bootloader_flash: mmu set block paddr=0x00010000 (was 0xffffffff)
V (345) esp_image: segment data length 0x1d14 data starts 0x1e2fc
V (351) esp_image: segment 4 map_segment 0 segment_data_offs 0x1e2fc load_addr 0
x40080400
I (360) esp_image: segment 4: paddr=0x0001e2fc vaddr=0x40080400 size=0x01d14 (
7444) load
D (369) bootloader_flash: mmu set paddr=00010000 count=2
V (377) esp_image: loading segment header 5 at offset 0x20010
D (380) bootloader_flash: mmu set block paddr=0x00020000 (was 0xffffffff)
V (387) esp_image: segment data length 0x1a088 data starts 0x20018
V (393) esp_image: segment 5 map_segment 1 segment_data_offs 0x20018 load_addr 0
x400d0018
0x400d0018: _flash_cache_start at ??:?

I (401) esp_image: segment 5: paddr=0x00020018 vaddr=0x400d0018 size=0x1a088 (10
6632) map
0x400d0018: _flash_cache_start at ??:?

D (410) bootloader_flash: mmu set paddr=00020000 count=2
V (453) esp_image: loading segment header 6 at offset 0x3a0a0
D (453) bootloader_flash: mmu set block paddr=0x00030000 (was 0xffffffff)
V (454) esp_image: segment data length 0x75ec data starts 0x3a0a8
V (460) esp_image: segment 6 map_segment 0 segment_data_offs 0x3a0a8 load_addr 0
x40082114
0x40082114: _xt_user_exc at D:/esp32/esp-idf/components/freertos/xtensa_vectors.
S:632

I (469) esp_image: segment 6: paddr=0x0003a0a8 vaddr=0x40082114 size=0x075ec ( 3
0188) load
0x40082114: _xt_user_exc at D:/esp32/esp-idf/components/freertos/xtensa_vectors.
S:632

D (477) bootloader_flash: mmu set paddr=00030000 count=2
V (495) esp_image: loading segment header 7 at offset 0x41694
D (496) bootloader_flash: mmu set block paddr=0x00040000 (was 0xffffffff)
V (498) esp_image: segment data length 0x0 data starts 0x4169c
V (504) esp_image: segment 7 map_segment 0 segment_data_offs 0x4169c load_addr 0
x400c0000
I (512) esp_image: segment 7: paddr=0x0004169c vaddr=0x400c0000 size=0x00000 (
   0) load
D (521) bootloader_flash: mmu set paddr=00040000 count=1
V (526) esp_image: loading segment header 8 at offset 0x4169c
D (532) bootloader_flash: mmu set block paddr=0x00040000 (was 0xffffffff)
V (539) esp_image: segment data length 0x0 data starts 0x416a4
V (545) esp_image: segment 8 map_segment 0 segment_data_offs 0x416a4 load_addr 0
x50000000
I (553) esp_image: segment 8: paddr=0x000416a4 vaddr=0x50000000 size=0x00000 (
   0) load
D (562) bootloader_flash: mmu set paddr=00040000 count=1
V (567) esp_image: image start 0x00010000 end of last section 0x000416a4
D (574) bootloader_flash: mmu set block paddr=0x00040000 (was 0xffffffff)
D (581) esp_image: Calculated hash: 14ffbd06
D (585) bootloader_flash: mmu set paddr=00040000 count=1
I (596) boot: Loaded app from partition at offset 0x10000
I (597) boot: Disabling RNG early entropy source...
D (602) boot: Mapping segment 0 as IROM
D (606) boot: Mapping segment 5 as DROM
D (610) boot: calling set_cache_and_start_app
D (615) boot: configure drom and irom and start
V (619) boot: d mmu set paddr=00020000 vaddr=400d0000 size=106632 n=2
V (626) boot: rc=0
V (628) boot: rc=0
V (630) boot: i mmu set paddr=00010000 vaddr=3f400000 size=48152 n=1
V (636) boot: rc=0
V (638) boot: rc=0
D (640) boot: start: 0x40080f08
0x40080f08: call_start_cpu0 at D:/esp32/esp-idf/components/esp32/cpu_start.c:114


I (644) cpu_start: Pro cpu up.
I (647) cpu_start: Starting app cpu, entry point is 0x40080ec0
0x40080ec0: call_start_cpu1 at D:/esp32/esp-idf/components/esp32/cpu_start.c:225


I (0) cpu_start: App cpu up.
I (658) heap_init: Initializing. RAM available for dynamic allocation:
I (665) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (671) heap_init: At 3FFB33E0 len 0002CC20 (179 KiB): DRAM
I (677) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (683) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (690) heap_init: At 40089700 len 00016900 (90 KiB): IRAM
I (696) cpu_start: Pro cpu start user code
I (43) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (44) example: Initializing SD card
I (44) example: Using SDMMC peripheral
I (44) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldow
n: 0| Intr:0
E (104) sdmmc_cmd: sdmmc_read_sectors_dma: sdmmc_send_cmd returned 0x109
E (104) diskio_sdmmc: sdmmc_read_blocks failed (265)
W (114) vfs_fat_sdmmc: failed to mount card (1)
E (114) example: Failed to mount filesystem. If you want the card to be formatte
d, set format_if_mount_failed = true.

Who is online

Users browsing this forum: Baidu [Spider] and 98 guests