Skip to content

Commit

Permalink
applications: Add ipc_radio firmware code
Browse files Browse the repository at this point in the history
Add ipc_radio firmware code for network core.
This image serves purpose as universal network core
image for hci_rpmsg rpc_host and IEEE 802.15.4 remote image.

Jira: NCSDK-23798

Signed-off-by: Dominik Chat <[email protected]>
  • Loading branch information
dchat-nordic authored and jfischer-no committed Feb 22, 2024
1 parent 94e2c1c commit b379434
Show file tree
Hide file tree
Showing 15 changed files with 767 additions and 1 deletion.
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
# Applications
/applications/asset_tracker_v2/ @nrfconnect/ncs-cia @coderbyheart
/applications/connectivity_bridge/ @nrfconnect/ncs-cia @nordic-auko
/applications/ipc_radio/ @dchat-nordic
/applications/machine_learning/ @pdunaj
/applications/matter_bridge/ @Damian-Nordic @kkasperczyk-no
/applications/matter_weather_station/ @Damian-Nordic @kkasperczyk-no
Expand Down
26 changes: 26 additions & 0 deletions applications/ipc_radio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Copyright (c) 2023 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(ipc_radio)

target_include_directories(app PRIVATE ./src)

target_sources_ifdef(CONFIG_IPC_RADIO_802154 app PRIVATE src/802154.c)

if(CONFIG_IPC_RADIO_BT_HCI_IPC)
target_sources(app PRIVATE src/bt_hci_ipc.c)
else()
target_sources(app PRIVATE src/bt_empty.c)
endif()

# NORDIC SDK APP START
target_sources(app PRIVATE
src/main.c
)
# NORDIC SDK APP END
53 changes: 53 additions & 0 deletions applications/ipc_radio/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# Copyright (c) 2023 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

mainmenu "Nordic ipc_radio firmware"

config IPC_RADIO_802154
bool "IPC IEEE 802.15.4 radio"
select NRF_802154_SER_RADIO
help
Enable the IPC IEEE 802.15.4 radio serialization.

config IPC_RADIO_BT
bool "IPC Bluetooth"
help
Enable the IPC Bluetooth radio serialization.

if IPC_RADIO_BT

choice IPC_RADIO_BT_SER
default IPC_RADIO_BT_HCI_IPC
prompt "Bluetooth serialization type"
help
Type of the IPC Bluetooth radio serialization used.

config IPC_RADIO_BT_HCI_IPC
bool "Bluetooth HCI serialization"
depends on IPC_SERVICE
depends on BT_HCI_RAW
help
Use Bluetooth HCI serialization over ipc_service.

config IPC_RADIO_BT_RPC
bool "Bluetooth host API serialization over RPC"
depends on BT_RPC_HOST
help
Use nRF RPC serialization for Bluetooth.

endchoice # IPC_RADIO_BT_SER

config BT_MAX_CONN
default 4 if IPC_RADIO_802154
default 16 if !IPC_RADIO_802154

endif # IPC_RADIO_BT

module = IPC_RADIO
module-str = "ipc_radio"
source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config"

source "Kconfig.zephyr"
10 changes: 10 additions & 0 deletions applications/ipc_radio/overlay-802154.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Copyright (c) 2023 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_NRF_802154_SER_RADIO=y
CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT=2

CONFIG_IPC_RADIO_802154=y
24 changes: 24 additions & 0 deletions applications/ipc_radio/overlay-bt_hci_ipc.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright (c) 2023 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

CONFIG_MBOX=y
CONFIG_IPC_SERVICE=y

CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_CTLR_ASSERT_HANDLER=y
CONFIG_BT_HCI_RAW_RESERVE=1

CONFIG_ASSERT=y
CONFIG_DEBUG_INFO=y
CONFIG_EXCEPTION_STACK_TRACE=y

CONFIG_IPC_RADIO_BT=y
CONFIG_IPC_RADIO_BT_HCI_IPC=y
32 changes: 32 additions & 0 deletions applications/ipc_radio/overlay-bt_rpc.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Copyright (c) 2023 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_NRF_RPC_THREAD_STACK_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

CONFIG_BT=y
CONFIG_BT_RPC=y
CONFIG_BT_RPC_HOST=y

CONFIG_BT_PERIPHERAL=y
CONFIG_BT_MAX_CONN=1
CONFIG_BT_MAX_PAIRED=1
CONFIG_BT_SMP=y

# Host side registers all GATT services using dynamic database
CONFIG_BT_GATT_DYNAMIC_DB=y

# Enable bonding
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y

CONFIG_IPC_RADIO_BT=y
CONFIG_IPC_RADIO_BT_RPC=y
9 changes: 9 additions & 0 deletions applications/ipc_radio/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Copyright (c) 2023 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_LOG=n
36 changes: 36 additions & 0 deletions applications/ipc_radio/sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
sample:
name: IPC radio firmware
description: IPC radio firmware application
tests:
applications.ipc_radio.hci:
build_only: true
platform_allow: nrf5340dk_nrf5340_cpunet thingy53_nrf5340_cpunet
tags: bluetooth ci_build
integration_platforms:
- nrf5340dk_nrf5340_cpunet
- thingy53_nrf5340_cpunet
extra_args: EXTRA_CONF_FILE=overlay-bt_hci_ipc.conf
applications.ipc_radio.rpc:
build_only: true
platform_allow: nrf5340dk_nrf5340_cpunet thingy53_nrf5340_cpunet
tags: bluetooth ci_build
integration_platforms:
- nrf5340dk_nrf5340_cpunet
- thingy53_nrf5340_cpunet
extra_args: EXTRA_CONF_FILE=overlay-bt_rpc.conf
applications.ipc_radio.802154:
build_only: true
platform_allow: nrf5340dk_nrf5340_cpunet thingy53_nrf5340_cpunet
tags: ci_build
integration_platforms:
- nrf5340dk_nrf5340_cpunet
- thingy53_nrf5340_cpunet
extra_args: EXTRA_CONF_FILE=overlay-802154.conf
applications.ipc_radio.hci802154:
build_only: true
platform_allow: nrf5340dk_nrf5340_cpunet thingy53_nrf5340_cpunet
tags: bluetooth ci_build
integration_platforms:
- nrf5340dk_nrf5340_cpunet
- thingy53_nrf5340_cpunet
extra_args: EXTRA_CONF_FILE="overlay-bt_hci_ipc.conf;overlay-802154.conf"
22 changes: 22 additions & 0 deletions applications/ipc_radio/src/802154.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include <stddef.h>
#include <zephyr/kernel.h>
#include <nrf_802154_serialization_error.h>

void nrf_802154_serialization_error(const nrf_802154_ser_err_data_t *err)
{
ARG_UNUSED(err);
__ASSERT(false, "802.15.4 serialization error");
k_oops();
}

void nrf_802154_sl_fault_handler(uint32_t id, int32_t line, const char *err)
{
__ASSERT(false, "module_id: %u, line: %d, %s", id, line, err);
k_oops();
}
24 changes: 24 additions & 0 deletions applications/ipc_radio/src/bt_empty.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include <errno.h>
#include <zephyr/logging/log.h>

#include "ipc_bt.h"

LOG_MODULE_DECLARE(ipc_radio, CONFIG_IPC_RADIO_LOG_LEVEL);

int ipc_bt_init(void)
{
LOG_DBG("Empty ipc_bt_init called.");
return -ENOSYS;
}

int ipc_bt_process(void)
{
LOG_DBG("Empty ipc_bt_process called.");
return -ENOSYS;
}
Loading

0 comments on commit b379434

Please sign in to comment.