Skip to content

Commit 6218078

Browse files
committed
[UTEST][SDIO] Add block device read and write test
1 parent 6ea6827 commit 6218078

4 files changed

Lines changed: 438 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
menu "SDIO Test"
2+
3+
config RT_UTEST_SDIO
4+
bool "SDIO Block Read and Write Test"
5+
default n
6+
depends on RT_USING_SDIO
7+
help
8+
Verify SDIO block-device read and write paths with a real SD card.
9+
The test writes directly to the configured sectors and does not use
10+
DFS or format the card.
11+
12+
if RT_UTEST_SDIO
13+
14+
config RT_SDIO_UTEST_DEVICE_NAME
15+
string "SDIO block device name"
16+
default "sd0"
17+
help
18+
Block device used by the test, for example sd0 or sd0p0.
19+
20+
config RT_SDIO_UTEST_START_SECTOR
21+
hex "SDIO test start sector"
22+
default 0x0
23+
help
24+
First sector used by the test. Existing data in the selected sectors
25+
will be overwritten.
26+
27+
config RT_SDIO_UTEST_SECTOR_COUNT
28+
int "SDIO test sector count"
29+
range 1 128
30+
default 8
31+
help
32+
Number of contiguous sectors used by each transfer.
33+
34+
config RT_SDIO_UTEST_LOOP_COUNT
35+
int "SDIO test loop count"
36+
range 1 100
37+
default 3
38+
help
39+
Number of write/read verification loops at each test location.
40+
41+
config RT_SDIO_UTEST_DEVICE_WAIT_MS
42+
int "SDIO device wait time"
43+
range 0 60000
44+
default 3000
45+
help
46+
Time to wait for the SDIO block device to appear before failing.
47+
48+
endif
49+
50+
endmenu
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Import('rtconfig')
2+
from building import *
3+
4+
cwd = GetCurrentDir()
5+
src = []
6+
CPPPATH = [cwd, cwd + '/../../include']
7+
8+
if GetDepend('RT_UTEST_SDIO'):
9+
src += Glob('*.c')
10+
11+
group = DefineGroup('utestcases', src,
12+
depend = ['RT_USING_UTESTCASES', 'RT_USING_SDIO'],
13+
CPPPATH = CPPPATH)
14+
15+
Return('group')

0 commit comments

Comments
 (0)