I'm able to run an example in 4-bit mode only after:
1. disconnecting GPIO12 from SD-card shield (with soldered pull-ups) (to not interfere with internal pull-down signaling of LDO voltage)
2. addling 5 second delay at the beginning of my code
3. reconnecting GPIO12 to SD CARD D2 during this delay.
Speaking about LDO voltage. I have measured voltage on bare GPIO12 pin and it is 0V. So according to page 9 of ESP32 datasheet I made an assumption that internal flash on my module is 3.3V. But in sd_card example readme file I found an opposite information "For boards which use 1.8V flash chip, GPIO12 needs to be low at reset.". So what is true?
And please share with us commands how to set efuses for SDIO_TIEH=0 and SDIO_FORCE=1, because (if I understand correctly) this settings are permanent and can't be changed back.
I have also made some benchmarking (using a code from test_sd.c) and here are the results:
Code: Select all
Type: SDHC/SDXC
Speed: default speed
Size: 14991MB
CSD: ver=1, sector_size=512, capacity=30702592 read_bl_len=9
SCR: sd_spec=2, bus_width=5
# 4-bit mode
sector | count | size(kB) | wr_time(ms) | wr_speed(MB/s) | rd_time(ms) | rd_speed(MB/s)
0 | 1 | 0.5 | 22.21 | 0.02 | 0.33s | 1.49
0 | 4 | 2.0 | 22.79 | 0.09 | 0.58s | 3.39
1 | 16 | 8.0 | 22.87 | 0.34 | 1.17s | 6.71
16 | 32 | 16.0 | 27.29 | 0.57 | 2.05s | 7.63
48 | 64 | 32.0 | 16.42 | 1.90 | 3.74s | 8.35
128 | 128 | 64.0 | 8.69 | 7.19 | 7.10s | 8.80
1024 | 256 | 128.0 | 16.18 | 7.72 | 13.88s | 9.00
# 1-bit mode
sector | count | size(kB) | wr_time(ms) | wr_speed(MB/s) | rd_time(ms) | rd_speed(MB/s)
0 | 1 | 0.5 | 22.91 | 0.02 | 0.48s | 1.01
0 | 4 | 2.0 | 26.14 | 0.07 | 1.20s | 1.62
1 | 16 | 8.0 | 25.84 | 0.30 | 3.67s | 2.13
16 | 32 | 16.0 | 41.25 | 0.38 | 7.00s | 2.23
48 | 64 | 32.0 | 25.09 | 1.25 | 13.58s | 2.30
128 | 128 | 64.0 | 27.23 | 2.29 | 26.76s | 2.34
1024 | 256 | 128.0 | 53.78 | 2.32 | 53.19s | 2.35