-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
suit: Add flash_ipuc pseudo-driver tests
Add tests for the pseudo-flash driver that writes data through SUIT IPUC. Ref: NCSDK-30809 Signed-off-by: Tomasz Chyrowicz <[email protected]>
- Loading branch information
Showing
9 changed files
with
1,153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# | ||
# Copyright (c) 2025 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.20.0) | ||
|
||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
|
||
project(flash_ipuc) | ||
|
||
target_include_directories(app PRIVATE ${ZEPHYR_NRF_MODULE_DIR}/subsys/suit/ipuc/include) | ||
target_include_directories(app PRIVATE mocks) | ||
|
||
zephyr_compile_definitions(CONFIG_FLASH_IPUC_COUNT=2) | ||
zephyr_compile_definitions(CONFIG_FLASH_IPUC_LOG_LEVEL) | ||
zephyr_compile_definitions(CONFIG_FLASH_IPUC_LOG_LEVEL_DBG) | ||
# Pretend to call API as nRF54H20 application FW | ||
zephyr_compile_definitions(CONFIG_SOC_NRF54H20_CPUAPP) | ||
|
||
target_sources(app PRIVATE | ||
src/main.c | ||
${ZEPHYR_NRF_MODULE_DIR}/drivers/flash/flash_ipuc/flash_ipuc.c | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# | ||
# Copyright (c) 2025 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
CONFIG_FLASH_SIMULATOR=y | ||
CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# | ||
# Copyright (c) 2025 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
CONFIG_FLASH_SIMULATOR=y | ||
CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (c) 2025 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
#ifndef MOCK_SUIT_IPUC_H__ | ||
#define MOCK_SUIT_IPUC_H__ | ||
|
||
#include <suit_ipuc.h> | ||
#include <zephyr/fff.h> | ||
|
||
DEFINE_FFF_GLOBALS; | ||
|
||
FAKE_VALUE_FUNC(int, suit_ipuc_get_count, size_t *); | ||
FAKE_VALUE_FUNC(int, suit_ipuc_get_info, size_t, struct zcbor_string *, suit_manifest_role_t *); | ||
FAKE_VALUE_FUNC(int, suit_ipuc_write_setup, struct zcbor_string *, struct zcbor_string *, | ||
struct zcbor_string *); | ||
FAKE_VALUE_FUNC(int, suit_ipuc_write, struct zcbor_string *, size_t, uintptr_t, size_t, bool); | ||
|
||
static inline void mock_suit_ipuc_reset(void) | ||
{ | ||
RESET_FAKE(suit_ipuc_get_count); | ||
RESET_FAKE(suit_ipuc_get_info); | ||
RESET_FAKE(suit_ipuc_write_setup); | ||
RESET_FAKE(suit_ipuc_write); | ||
} | ||
|
||
#endif /* MOCK_SUIT_IPUC_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# | ||
# Copyright (c) 2025 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
CONFIG_ZTEST=y | ||
CONFIG_SUIT=y | ||
CONFIG_SUIT_UTILS=y | ||
CONFIG_SUIT_METADATA=y | ||
|
||
CONFIG_ZCBOR=y | ||
CONFIG_ZCBOR_CANONICAL=y | ||
|
||
CONFIG_FLASH=y |
Oops, something went wrong.