Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion subsys/ipc/ipc_service/backends/ipc_icmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,17 @@ static int backend_init(const struct device *instance)
DT_INST_FOREACH_STATUS_OKAY(DEFINE_BACKEND_DEVICE)

/* TODO: REMOVE THIS WORKAROUND!!! */

#ifdef NRF_PPR
#include <string.h>
static int workaround_ppr_reset(void)
{
#define _FIX_RESET_MEM(i) \
memset(&backend_data_##i, 0, sizeof(backend_data_##i)); \
backend_data_##i.tx_pb = &tx_pb_##i; \
backend_data_##i.rx_pb = &rx_pb_##i;
DT_INST_FOREACH_STATUS_OKAY(_FIX_RESET_MEM);
return 0;
}

SYS_INIT(workaround_ppr_reset, PRE_KERNEL_1, 0);
#endif
4 changes: 4 additions & 0 deletions tests/subsys/ipc/ipc_sessions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ zephyr_include_directories(./common)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})

zephyr_sources_ifdef(CONFIG_IPC_SERVICE_ICMSG_V1 interoperability/icmsg_v1.c)
zephyr_sources_ifdef(CONFIG_PBUF_V1 interoperability/pbuf_v1.c)
zephyr_sources_ifdef(CONFIG_IPC_SERVICE_BACKEND_ICMSG_V1 interoperability/ipc_icmsg_v1.c)
7 changes: 7 additions & 0 deletions tests/subsys/ipc/ipc_sessions/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

rsource "interoperability/Kconfig"

menu "Zephyr"
source "Kconfig.zephyr"
endmenu
Expand All @@ -28,3 +30,8 @@ config IPC_TEST_BLOCK_SIZE
config IPC_TEST_BLOCK_CNT
int "Number of blocks for multiple transfers test"
default 8000

config IPC_TEST_SKIP_UNBOUND
bool "Skip unbound tests"
help
Whether to skip tests that requires unbound callback functionality.
29 changes: 29 additions & 0 deletions tests/subsys/ipc/ipc_sessions/interoperability/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

config IPC_SERVICE_BACKEND_ICMSG
default n if IPC_SERVICE_BACKEND_ICMSG_V1

config IPC_SERVICE_ICMSG
default n if IPC_SERVICE_ICMSG_V1

config IPC_SERVICE_BACKEND_ICMSG_V1
bool "ICMSG backend with SPSC packet buffer (old implementation)"
depends on MBOX
select IPC_SERVICE_ICMSG_V1
help
Chosing this backend results in single endpoint implementation based
on circular packet buffer.

menuconfig IPC_SERVICE_ICMSG_V1
bool "icmsg IPC library (old implementation)"
select PBUF_V1
help
Icmsg library

if IPC_SERVICE_ICMSG_V1
rsource "Kconfig.icmsg_v1"
endif
90 changes: 90 additions & 0 deletions tests/subsys/ipc/ipc_sessions/interoperability/Kconfig.icmsg_v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Copyright (c) 2022 Nordic Semiconductor (ASA)
# SPDX-License-Identifier: Apache-2.0

config IPC_SERVICE_ICMSG_SHMEM_ACCESS_SYNC_V1
bool "Synchronize access to shared memory"
depends on MULTITHREADING
default y
help
Provide synchronization access to shared memory at a library level.
This option is enabled by default to allow to use sending API from
multiple contexts. Mutex is used to guard access to the memory.
This option can be safely disabled if an application ensures data
are sent from single context.

config IPC_SERVICE_ICMSG_SHMEM_ACCESS_TO_MS_V1
int "Mutex lock timeout in milliseconds"
depends on IPC_SERVICE_ICMSG_SHMEM_ACCESS_SYNC_V1
range 1 5
default 1
help
Maximum time to wait, in milliseconds, for access to send data with
backends basing on icmsg library. This time should be relatively low.

config IPC_SERVICE_ICMSG_BOND_NOTIFY_REPEAT_TO_MS_V1
int "Bond notification timeout in miliseconds"
range 1 100
default 1
help
Time to wait for remote bonding notification before the
notification is repeated.

config IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE_V1
bool "Use dedicated workqueue"
depends on MULTITHREADING
default y
help
Enable dedicated workqueue thread for the ICMsg backend.
Disabling this configuration will cause the ICMsg backend to
process incoming data through the system workqueue context, and
therefore reduces the RAM footprint of the backend.
Disabling this config may result in deadlocks in certain usage
scenarios, such as when synchronous IPC is executed from the system
workqueue context.
The callbacks coming from the backend are executed from the workqueue
context.
When the option is disabled, the user must obey the restrictions
imposed by the system workqueue, such as never performing blocking
operations from within the callback.

if IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE_V1

config IPC_SERVICE_BACKEND_ICMSG_WQ_STACK_SIZE_V1
int "Size of RX work queue stack"
default 1280
help
Size of stack used by work queue RX thread. This work queue is
created to prevent notifying service users about received data
from the system work queue. The queue is shared among instances.

config IPC_SERVICE_BACKEND_ICMSG_WQ_PRIORITY_V1
int "Priority of RX work queue thread"
default -1
range -256 -1
help
Priority of the ICMSG RX work queue thread.
The ICMSG library in its simplicity requires the workqueue to execute
at a cooperative priority.

endif

# The Icmsg library in its simplicity requires the system workqueue to execute
# at a cooperative priority.
config SYSTEM_WORKQUEUE_PRIORITY
range -256 -1 if !IPC_SERVICE_BACKEND_ICMSG_WQ_ENABLE_V1

config PBUF_V1
bool "Packed buffer support library (old implementation)"
help
The packet buffer implements lightweight unidirectional packet buffer
with read/write semantics on top of a memory region shared by the
reader and writer. It optionally embeds cache and memory barrier
management to ensure correct data access.

if PBUF_V1

config PBUF_RX_READ_BUF_SIZE_V1
int "Size of PBUF read buffer in bytes"
default 128

endif # PBUF
Loading
Loading