Skip to content

Commit f5d4957

Browse files
committed
Merge branch 'feature/optimize_fatfs_on_sdmmc' into 'master'
feat(examples/storage): update perf benchmark example Closes IDF-8420 See merge request espressif/esp-idf!27678
2 parents 0631176 + 0c99375 commit f5d4957

13 files changed

+839
-536
lines changed

examples/storage/perf_benchmark/README.md

Lines changed: 181 additions & 128 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
idf_component_register(SRCS "main.c" "tests.c"
1+
idf_component_register(SRCS "perf_benchmark_example_main.c" "perf_benchmark_example_tests.c"
2+
"perf_benchmark_example_sd_utils.c"
23
INCLUDE_DIRS ".")

examples/storage/perf_benchmark/main/Kconfig.projbuild

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
11
menu "Performance Benchmark Example Configuration"
2+
config EXAMPLE_TARGET_RW_SIZE
3+
int "Target size for read/write (bytes)"
4+
default 65536
5+
help
6+
This is the target size used for the benchmark,
7+
it represents how much data will be transferred in each test.
8+
(The actual size of the allocated buffer will be larger for "more than target size" cases.)
9+
The test will test will show the performance of reading and writing
10+
of both slightly more and slightly less than this size as well.
11+
This will greatly affect the performance of the benchmark.
12+
In general, the larger the rw size, the better the performance.
13+
For FATFS, the best performance is achieved when the rw size
14+
matches the cluster size or is at least a multiple of the sector size.
15+
16+
config EXAMPLE_TEST_TRIES
17+
int "Number of test tries"
18+
default 10
19+
help
20+
The number of times to run the benchmark.
21+
The average value will be displayed.
222

3-
config EXAMPLE_USE_MEGABYTES
4-
bool "Use megabytes instead of megabits"
23+
config EXAMPLE_USE_BYTES
24+
bool "Use bytes instead of bits"
525
default y
626
help
727
If this config item is set, the IO speed will be displayed in megabytes per second
@@ -28,12 +48,29 @@ menu "Performance Benchmark Example Configuration"
2848
help
2949
If this config item is set, FATFS will be tested.
3050

51+
config EXAMPLE_FATFS_SPIFLASH_CLUSTER_SIZE
52+
depends on EXAMPLE_TEST_SPIFLASH_FATFS
53+
int "Cluster size for FATFS on internal flash"
54+
default EXAMPLE_TARGET_RW_SIZE
55+
help
56+
The cluster size of the FATFS filesystem.
57+
The cluster size must be a multiple of the sector size.
58+
The default value is the same as the target read/write size.
59+
The larger the cluster size, the better the performance,
60+
but the more space will be wasted on the storage medium.
61+
3162
config EXAMPLE_TEST_SPIFLASH_SPIFFS
3263
bool "Test SPIFFS"
3364
default y
3465
help
3566
If this config item is set, SPIFFS will be tested.
3667

68+
config EXAMPLE_TEST_SPIFLASH_LITTLEFS
69+
bool "Test LittleFS"
70+
default y
71+
help
72+
If this config item is set, LittleFS will be tested.
73+
3774
endmenu # "Internal flash test config"
3875

3976
config EXAMPLE_TEST_SD_CARD
@@ -74,6 +111,23 @@ menu "Performance Benchmark Example Configuration"
74111
help
75112
If this config item is set, FATFS will be tested.
76113

114+
config EXAMPLE_FATFS_SD_CARD_CLUSTER_SIZE
115+
depends on EXAMPLE_TEST_SD_CARD_FATFS
116+
int "Cluster size for FATFS on SD card"
117+
default EXAMPLE_TARGET_RW_SIZE
118+
help
119+
The cluster size of the FATFS filesystem.
120+
The cluster size must be a multiple of the sector size.
121+
The default value is the same as the target read/write size.
122+
The larger the cluster size, the better the performance,
123+
but the more space will be wasted on the storage medium.
124+
125+
config EXAMPLE_TEST_SD_CARD_LITTLEFS
126+
bool "Test LittleFS"
127+
default y
128+
help
129+
If this config item is set, LittleFS will be tested.
130+
77131
choice EXAMPLE_SD_CARD_FREQ_PICKER
78132
prompt "SD card frequency"
79133
default EXAMPLE_SD_FREQ_HIGHSPEED if EXAMPLE_USE_SDMMC
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## IDF Component Manager Manifest File
2+
dependencies:
3+
joltwallet/littlefs: "^1.14.1"

0 commit comments

Comments
 (0)