-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: ipc: ipc_sessions: Implementation
Implementation of the test that focuses on session management in IPC. Mainly restoring connections after disconnection. Signed-off-by: Radoslaw Koppel <[email protected]>
- Loading branch information
Showing
20 changed files
with
987 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright 2021 Google LLC | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
cmake_minimum_required(VERSION 3.20.0) | ||
|
||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
project(ipc_service) | ||
|
||
zephyr_include_directories(./common) | ||
|
||
FILE(GLOB app_sources src/*.c) | ||
target_sources(app PRIVATE ${app_sources}) |
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,16 @@ | ||
# | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
menu "Zephyr" | ||
source "Kconfig.zephyr" | ||
endmenu | ||
|
||
config IPC_TEST_MSG_HEAP_SIZE | ||
int "The heap to copy processed messages" | ||
default 512 | ||
help | ||
Internal heap where all the message data would be copied to be processed | ||
linearry in tests. |
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,13 @@ | ||
# | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" | ||
|
||
config REMOTE_BOARD | ||
string "The board used for remote target" | ||
default "nrf5340dk/nrf5340/cpunet" if BOARD_NRF5340DK_NRF5340_CPUAPP | ||
default "nrf5340dk/nrf5340/cpunet" if BOARD_NRF5340DK_NRF5340_CPUAPP_NS | ||
default "nrf54h20dk/nrf54h20/cpuppr" if BOARD_NRF54H20DK_NRF54H20_CPUAPP |
7 changes: 7 additions & 0 deletions
7
tests/subsys/ipc/ipc_sessions/boards/nrf5340dk_nrf5340_cpuapp.conf
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,7 @@ | ||
# | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
CONFIG_SOC_NRF53_CPUNET_ENABLE=y |
37 changes: 37 additions & 0 deletions
37
tests/subsys/ipc/ipc_sessions/boards/nrf5340dk_nrf5340_cpuapp.overlay
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,37 @@ | ||
/* | ||
* Copyright (c) 2022 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
/delete-node/ &ipc0; | ||
|
||
/ { | ||
chosen { | ||
/delete-property/ zephyr,ipc_shm; | ||
/delete-property/ zephyr,bt-hci; | ||
}; | ||
|
||
reserved-memory { | ||
/delete-node/ memory@20070000; | ||
|
||
sram_tx: memory@20070000 { | ||
reg = <0x20070000 0x8000>; | ||
}; | ||
|
||
sram_rx: memory@20078000 { | ||
reg = <0x20078000 0x8000>; | ||
}; | ||
}; | ||
|
||
ipc0: ipc0 { | ||
compatible = "zephyr,ipc-icmsg"; | ||
tx-region = <&sram_tx>; | ||
rx-region = <&sram_rx>; | ||
mboxes = <&mbox 0>, <&mbox 1>; | ||
mbox-names = "tx", "rx"; | ||
dcache-alignment = <8>; | ||
unbound = "detect"; | ||
status = "okay"; | ||
}; | ||
}; |
26 changes: 26 additions & 0 deletions
26
tests/subsys/ipc/ipc_sessions/boards/nrf54h20dk_nrf54h20_cpuapp.overlay
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,26 @@ | ||
/* | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
/* Replace default ipc0 instance */ | ||
/delete-node/ &ipc0; | ||
|
||
ipc0: &cpuapp_cpuppr_ipc { | ||
status = "okay"; | ||
unbound = "detect"; | ||
}; | ||
|
||
&cpuppr_vevif { | ||
status = "okay"; | ||
}; | ||
|
||
&cpuapp_bellboard { | ||
status = "okay"; | ||
}; | ||
|
||
/ { | ||
chosen { | ||
/delete-property/ zephyr,bt-hci; | ||
}; | ||
}; |
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,46 @@ | ||
/* | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
#ifndef TEST_COMMANDS_H | ||
#include <stdint.h> | ||
|
||
/** | ||
* @brief Test commands executable by remote | ||
*/ | ||
enum ipc_test_commands { | ||
IPC_TEST_CMD_NONE, /**< Command to be ingored */ | ||
IPC_TEST_CMD_PING, /**< Respond with the @ref IPC_TEST_CMD_PONG message */ | ||
IPC_TEST_CMD_PONG, /**< Expected response to IPC_TEST_CMD_PING */ | ||
IPC_TEST_CMD_ECHO, /**< Respond with the same data */ | ||
IPC_TEST_CMD_ECHO_RSP, /**< Echo respond */ | ||
IPC_TEST_CMD_REBOND, /**< Unbond and rebond back whole interface */ | ||
IPC_TEST_CMD_REBOOT, /**< Restart remote CPU after a given delay */ | ||
}; | ||
|
||
/** | ||
* @brief Base command structure | ||
*/ | ||
struct ipc_test_cmd { | ||
uint32_t cmd; /**< The command of @ref ipc_test_command type */ | ||
uint8_t data[]; /**< Command data depending on the command itself */ | ||
}; | ||
|
||
/** | ||
* @brief Rebond command structure | ||
*/ | ||
struct ipc_test_cmd_rebond { | ||
struct ipc_test_cmd base; | ||
uint32_t timeout_ms; | ||
}; | ||
|
||
/** | ||
* @brief Reboot command structure | ||
*/ | ||
struct ipc_test_cmd_reboot { | ||
struct ipc_test_cmd base; | ||
uint32_t timeout_ms; | ||
}; | ||
|
||
#endif /* TEST_COMMANDS_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,7 @@ | ||
# Copyright 2021 Carlo Caione <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
CONFIG_ZTEST=y | ||
CONFIG_MMU=y | ||
CONFIG_IPC_SERVICE=y | ||
CONFIG_MBOX=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,15 @@ | ||
# | ||
# Copyright (c) 2024 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(remote_icmsg) | ||
|
||
zephyr_include_directories(../common) | ||
|
||
FILE(GLOB remote_sources src/*.c) | ||
target_sources(app PRIVATE ${remote_sources}) |
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,7 @@ | ||
# | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
source "Kconfig.zephyr" |
36 changes: 36 additions & 0 deletions
36
tests/subsys/ipc/ipc_sessions/remote/boards/nrf5340dk_nrf5340_cpunet.overlay
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,36 @@ | ||
/* | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
/delete-node/ &ipc0; | ||
|
||
/ { | ||
chosen { | ||
/delete-property/ zephyr,ipc_shm; | ||
}; | ||
|
||
reserved-memory { | ||
/delete-node/ memory@20070000; | ||
|
||
sram_rx: memory@20070000 { | ||
reg = <0x20070000 0x8000>; | ||
}; | ||
|
||
sram_tx: memory@20078000 { | ||
reg = <0x20078000 0x8000>; | ||
}; | ||
}; | ||
|
||
ipc0: ipc0 { | ||
compatible = "zephyr,ipc-icmsg"; | ||
tx-region = <&sram_tx>; | ||
rx-region = <&sram_rx>; | ||
mboxes = <&mbox 0>, <&mbox 1>; | ||
mbox-names = "rx", "tx"; | ||
dcache-alignment = <8>; | ||
unbound = "detect"; | ||
status = "okay"; | ||
}; | ||
}; |
1 change: 1 addition & 0 deletions
1
tests/subsys/ipc/ipc_sessions/remote/boards/nrf54h20dk_nrf54h20_cpuppr.conf
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 @@ | ||
CONFIG_WATCHDOG=y |
31 changes: 31 additions & 0 deletions
31
tests/subsys/ipc/ipc_sessions/remote/boards/nrf54h20dk_nrf54h20_cpuppr.overlay
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,31 @@ | ||
/* | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
ipc0: &cpuapp_cpuppr_ipc { | ||
status = "okay"; | ||
unbound = "detect"; | ||
}; | ||
|
||
&cpuppr_vevif { | ||
status = "okay"; | ||
}; | ||
|
||
&cpuapp_bellboard { | ||
status = "okay"; | ||
}; | ||
|
||
&wdt131 { | ||
status = "okay"; | ||
}; | ||
|
||
/ { | ||
chosen { | ||
/delete-property/ zephyr,bt-hci; | ||
}; | ||
|
||
aliases { | ||
watchdog0 = &wdt131; | ||
}; | ||
}; |
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,20 @@ | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
|
||
CONFIG_PRINTK=y | ||
CONFIG_EVENTS=y | ||
|
||
CONFIG_LOG=y | ||
CONFIG_LOG_ALWAYS_RUNTIME=y | ||
CONFIG_LOG_MODE_MINIMAL=y | ||
#CONFIG_LOG_PROCESS_THREAD_PRIORITY=-15 | ||
#CONFIG_LOG_PROCESS_THREAD_CUSTOM_PRIORITY=y | ||
|
||
CONFIG_HEAP_MEM_POOL_SIZE=2048 | ||
|
||
CONFIG_IPC_SERVICE=y | ||
CONFIG_IPC_SERVICE_LOG_LEVEL_INF=y | ||
|
||
CONFIG_MBOX=y | ||
|
||
CONFIG_REBOOT=y |
Oops, something went wrong.