File tree Expand file tree Collapse file tree 5 files changed +564
-0
lines changed
tests/lib/nrf_modem_lib/trace_backends/flash Expand file tree Collapse file tree 5 files changed +564
-0
lines changed Original file line number Diff line number Diff line change
1
+ #
2
+ # Copyright (c) 2025 Nordic Semiconductor ASA
3
+ #
4
+ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5
+ #
6
+
7
+ cmake_minimum_required (VERSION 3.20.0)
8
+
9
+ find_package (Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE} )
10
+ project (flash)
11
+
12
+ target_include_directories (app PRIVATE src)
13
+
14
+ # Add test sources
15
+ target_sources (app PRIVATE src/main.c)
16
+
17
+ # Provide compile-time definitions for configs expected by the backend
18
+ target_compile_definitions (app PRIVATE
19
+ CONFIG_NRF_MODEM_LIB_TRACE_FLASH_SECTORS=16
20
+ CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_FLASH_BUF_SIZE=1024
21
+ CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_FLASH_PARTITION_SIZE=0x10000
22
+ )
23
+
24
+ # Generate runner for the test
25
+ test_runner_generate(src/main.c)
26
+
27
+ # Add the actual flash backend implementation
28
+ target_sources (app PRIVATE
29
+ ${ZEPHYR_NRF_MODULE_DIR} /lib/nrf_modem_lib/trace_backends/flash/flash.c)
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2025 Nordic Semiconductor ASA
3
+ *
4
+ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5
+ */
6
+
7
+ &flash0 {
8
+ partitions {
9
+ compatible = "fixed-partitions";
10
+ #address-cells = <1>;
11
+ #size-cells = <1>;
12
+
13
+ /* Keep boot and slot0 so chosen code-partition remains valid */
14
+ /delete-node/ slot1_partition;
15
+ /delete-node/ scratch_partition;
16
+ /delete-node/ storage_partition;
17
+
18
+ /* modem_trace partition - matches flash backend without partition manager */
19
+ modem_trace: partition@75000 {
20
+ label = "modem_trace";
21
+ reg = <0x00075000 0x00010000>; /* 64KB */
22
+ };
23
+ };
24
+ };
Original file line number Diff line number Diff line change
1
+ #
2
+ # Copyright (c) 2025 Nordic Semiconductor ASA
3
+ #
4
+ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5
+ #
6
+
7
+ CONFIG_UNITY=y
8
+ CONFIG_ASSERT=y
9
+
10
+ # Enable real flash simulator and subsystems
11
+ CONFIG_FLASH=y
12
+ CONFIG_FLASH_MAP=y
13
+ CONFIG_FLASH_SIMULATOR=y
14
+ CONFIG_FLASH_SIMULATOR_UNALIGNED_READ=y
15
+ CONFIG_FLASH_SIMULATOR_EXPLICIT_ERASE=y
16
+ CONFIG_FCB=y
17
+ CONFIG_FCB_ALLOW_FIXED_ENDMARKER=y
You can’t perform that action at this time.
0 commit comments