Skip to content

Commit d53f324

Browse files
ExaltZephyrcfriedt
authored andcommitted
tests: sdio: Add write test to SDIO subsystem
This commit expands the SDIO subsystem test suite by adding support for write test. Also this commit adds needed conf/overlay files for arduino portenta h7, nicla vision and giga r1 for wifi_nm tests Signed-off-by: Sara Touqan <[email protected]>
1 parent 24caf43 commit d53f324

8 files changed

+82
-0
lines changed

tests/net/wifi/wifi_nm/testcase.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ tests:
1212
platform_exclude:
1313
- rd_rw612_bga/rw612/ethernet # Requires binary blobs to build
1414
- frdm_rw612 # Requires binary blobs to build
15+
- arduino_giga_r1/stm32h747xx/m7 # Requires binary blobs to build
16+
- arduino_nicla_vision/stm32h747xx/m7 # Requires binary blobs to build
17+
- arduino_portenta_h7/stm32h747xx/m7 # Requires binary blobs to build
18+
- [email protected]/stm32h747xx/m7 # Requires binary blobs to build
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2025 EXALT Technologies.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_HEAP_MEM_POOL_SIZE=24576
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright (c) 2025 EXALT Technologies.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&wifi {
8+
status = "disabled";
9+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2025 EXALT Technologies.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_HEAP_MEM_POOL_SIZE=24576
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright (c) 2025 EXALT Technologies.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&wifi {
8+
status = "disabled";
9+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2025 EXALT Technologies.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_HEAP_MEM_POOL_SIZE=24576
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2025 EXALT Technologies.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&boot_partition{
8+
reg = <0x00000000 0x00020000>;
9+
};
10+
&scratch_partition {
11+
reg = <0x00020000 0x00020000>;
12+
};
13+
&slot0_partition {
14+
reg = <0x00040000 0x001C0000>;
15+
};
16+
&slot1_partition {
17+
reg = <0x00200000 0x001C0000>;
18+
};
19+
20+
&wifi {
21+
status = "disabled";
22+
};

tests/subsys/sd/sdio/src/main.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,32 @@ ZTEST(sd_stack, test_read)
4646
zassert_not_equal(reg, 0xFF, "CCCR read returned invalid data");
4747
}
4848

49+
/*
50+
* Verify that a register write works. Given the custom nature of SDIO devices,
51+
* we just write to the card common I/O area.
52+
*/
53+
ZTEST(sd_stack, test_write)
54+
{
55+
int ret;
56+
uint8_t data = 0x01;
57+
uint8_t reg = 0xFF;
58+
uint8_t new_reg_value = 0xFF;
59+
60+
/* Read from card common I/O area. */
61+
ret = sdio_read_byte(&card.func0, SDIO_CCCR_BUS_IF, &reg);
62+
zassert_equal(ret, 0, "SD card read failed");
63+
64+
/* Write to card common I/O area. */
65+
ret = sdio_write_byte(&card.func0, SDIO_CCCR_BUS_IF, data);
66+
zassert_equal(ret, 0, "SD card write failed");
67+
68+
/* Read after write to verify that data was written */
69+
ret = sdio_read_byte(&card.func0, SDIO_CCCR_BUS_IF, &new_reg_value);
70+
zassert_equal(ret, 0, "SD card read failed");
71+
new_reg_value = new_reg_value & SDIO_CCCR_BUS_IF_WIDTH_MASK;
72+
zassert_equal(new_reg_value, data, "read data was not as expected");
73+
}
74+
4975
/* Simply dump the card configuration. */
5076
ZTEST(sd_stack, test_card_config)
5177
{

0 commit comments

Comments
 (0)