Skip to content

Commit f704a83

Browse files
pdgendtnashif
authored andcommitted
tests: nvmem: Add flash testcase
Add an overlay/config to test the NVMEM subsystem with a flash driver. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent a85f733 commit f704a83

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

tests/subsys/nvmem/api/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
cmake_minimum_required(VERSION 3.20.0)
55
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
6-
project(nvmem_eeprom)
6+
project(nvmem_api)
77

88
target_sources(app PRIVATE src/main.c)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Copyright (c) 2025, Basalte bv
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/ {
7+
aliases {
8+
nvmem0 = &flashcontroller0;
9+
};
10+
11+
test_consumer0: test-consumer0 {
12+
compatible = "vnd,nvmem-consumer";
13+
nvmem-cells = <&cell0>, <&cell10>;
14+
nvmem-cell-names = "cell0", "cell10";
15+
};
16+
};
17+
18+
&flashcontroller0 {
19+
nvmem-layout {
20+
compatible = "fixed-layout";
21+
#address-cells = <1>;
22+
#size-cells = <1>;
23+
24+
cell0: cell@0 {
25+
reg = <0x0 0x10>;
26+
#nvmem-cell-cells = <0>;
27+
};
28+
29+
cell10: cell@10 {
30+
reg = <0x10 0x10>;
31+
read-only;
32+
#nvmem-cell-cells = <0>;
33+
};
34+
};
35+
};

tests/subsys/nvmem/api/testcase.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ tests:
1111
- CONFIG_EEPROM=y
1212
extra_dtc_overlay_files:
1313
- eeprom.overlay
14+
nvmem.api.flash:
15+
extra_configs:
16+
- CONFIG_FLASH=y
17+
- CONFIG_NVMEM_FLASH_WRITE=y
18+
extra_dtc_overlay_files:
19+
- flash.overlay

0 commit comments

Comments
 (0)