为什么ESP32-S3的SDIO接SD卡,用1bit数据和4bit数据读取文件,速度几乎没有差别

122722629@qq.com
Posts: 20
Joined: Wed Feb 16, 2022 7:01 am

为什么ESP32-S3的SDIO接SD卡,用1bit数据和4bit数据读取文件,速度几乎没有差别

Postby 122722629@qq.com » Sun Apr 17, 2022 2:37 pm

4bit不是应该快很多吗,但是实际并没有快多少,600多K的文件,要700ms才能读完。

这是1bit时的日志:

Code: Untitled.cpp Select all



I (0) cpu_start: App cpu up.
I (1218) spiram: SPI SRAM memory test OK
I (1227) cpu_start: Pro cpu start user code
I (1227) cpu_start: cpu freq: 240000000
I (1227) cpu_start: Application information:
I (1230) cpu_start: Project name: sd_card
I (1235) cpu_start: App version: ac75c64-dirty
I (1241) cpu_start: Compile time: Apr 6 2022 14:41:49
I (1247) cpu_start: ELF file SHA256: 9c75e896892f3e6c...
I (1253) cpu_start: ESP-IDF: v4.4-dirty
I (1258) heap_init: Initializing. RAM available for dynamic allocation:
I (1266) heap_init: At 3FC951D8 len 0004AE28 (299 KiB): D/IRAM
I (1272) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (1279) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (1285) heap_init: At 600FE000 len 00002000 (8 KiB): RTCRAM
I (1292) spiram: Adding pool of 8192K of external SPI memory to heap allocator
I (1300) spi_flash: detected chip: gd
I (1304) spi_flash: flash io: dio
I (1308) sleep: Configure to isolate all GPIO pins in sleep state
I (1315) sleep: Enable automatic switching of GPIO sleep configuration
I (1322) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (1337) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (1346) example: Initializing SD card
I (1350) example: Using SDMMC peripheral
I (1355) example: Mounting filesystem
I (1359) gpio: GPIO[8]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1369) gpio: GPIO[10]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1378) gpio: GPIO[6]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1435) example: Filesystem mounted
Name: SD
Type: SDSC
Speed: 20 MHz
Size: 121MB
I (1436) example: Opening file /sdcard/hello.txt
I (1446) example: File written
I (1450) example: Renaming file /sdcard/hello.txt to /sdcard/foo.txt
I (1452) example: Reading file /sdcard/foo.txt
I (1456) example: Read from file: 'Hello SD !'
I (1556) example: list: /,open succeed
I (1557) example: file: 2.MJP , size: 622178 , fattrib: 32
I (1557) example: file: FOO.TXT , size: 13 , fattrib: 32
I (1562) example: free_heap_size = 8082979
I (1567) example: free_heap_size = 8078883
I (2279) example: read 622178 bytes in 707 ms
I (2280) example: free_heap_size = 8082979

I (2280) example: Card unmounted


这是4bit时的日志:

Code: Untitled.cpp Select all



I (0) cpu_start: App cpu up.
I (1218) spiram: SPI SRAM memory test OK
I (1227) cpu_start: Pro cpu start user code
I (1227) cpu_start: cpu freq: 240000000
I (1227) cpu_start: Application information:
I (1230) cpu_start: Project name: sd_card
I (1235) cpu_start: App version: ac75c64-dirty
I (1241) cpu_start: Compile time: Apr 6 2022 14:41:49
I (1247) cpu_start: ELF file SHA256: ca6d01d26a856673...
I (1253) cpu_start: ESP-IDF: v4.4-dirty
I (1258) heap_init: Initializing. RAM available for dynamic allocation:
I (1266) heap_init: At 3FC951D8 len 0004AE28 (299 KiB): D/IRAM
I (1272) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM
I (1279) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (1285) heap_init: At 600FE000 len 00002000 (8 KiB): RTCRAM
I (1292) spiram: Adding pool of 8192K of external SPI memory to heap allocator
I (1300) spi_flash: detected chip: gd
I (1304) spi_flash: flash io: dio
I (1308) sleep: Configure to isolate all GPIO pins in sleep state
I (1315) sleep: Enable automatic switching of GPIO sleep configuration
I (1322) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (1337) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (1346) example: Initializing SD card
I (1350) example: Using SDMMC peripheral
I (1355) example: Mounting filesystem
I (1359) gpio: GPIO[8]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1369) gpio: GPIO[10]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1378) gpio: GPIO[6]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1387) gpio: GPIO[7]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1396) gpio: GPIO[12]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (1406) gpio: GPIO[5]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1463) example: Filesystem mounted
Name: SD
Type: SDSC
Speed: 20 MHz
Size: 121MB
I (1464) example: Opening file /sdcard/hello.txt
I (1474) example: File written
I (1530) example: Renaming file /sdcard/hello.txt to /sdcard/foo.txt
I (1532) example: Reading file /sdcard/foo.txt
I (1533) example: Read from file: 'Hello SD !'
I (1633) example: list: /,open succeed
I (1633) example: file: 2.MJP , size: 622178 , fattrib: 32
I (1633) example: file: FOO.TXT , size: 13 , fattrib: 32
I (1639) example: free_heap_size = 8082979
I (1643) example: free_heap_size = 8078883
I (2356) example: read 622178 bytes in 707 ms
I (2356) example: free_heap_size = 8082979

I (2357) example: Card unmounted


Yake
Espressif staff
Espressif staff
Posts: 111
Joined: Mon Mar 06, 2017 12:23 pm

Re: 为什么ESP32-S3的SDIO接SD卡,用1bit数据和4bit数据读取文件,速度几乎没有差别

Postby Yake » Mon May 09, 2022 12:13 pm

你看下你的 SD 卡速率是多少,很多时候是受限于 SD 卡的速率。用 PC 读写试试速率

Jinsc_esp32
Posts: 7
Joined: Sun Apr 17, 2022 7:16 am

Re: 为什么ESP32-S3的SDIO接SD卡,用1bit数据和4bit数据读取文件,速度几乎没有差别

Postby Jinsc_esp32 » Mon Sep 12, 2022 12:46 am

因为你用的是C语言提供的接口,读写用fatfs的接口就行了

Who is online

Users browsing this forum: Amazon [Bot] and 2 guests