Skip to content

Commit c6f2cca

Browse files
aescolarMaureenHelm
authored andcommitted
tests/bsim/bt bis: Add support for split build with sysbuild
Add sysbuild build files, which allows building this test both for the targets we could already before (nrf52_bsim & nrf5340bsim_nrf5340_cpunet) and also adds support for the a split build with the nrf5340bsim_nrf5340_cpuapp. Signed-off-by: Alberto Escolar Piedras <[email protected]>
1 parent a843492 commit c6f2cca

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2023 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
source "share/sysbuild/Kconfig"
5+
6+
config NET_CORE_BOARD
7+
string
8+
default "nrf5340bsim_nrf5340_cpunet" if $(BOARD) = "nrf5340bsim_nrf5340_cpuapp"
9+
10+
config NATIVE_SIMULATOR_PRIMARY_MCU_INDEX
11+
int
12+
# Let's pass the test arguments to the application MCU test
13+
# otherwise by default they would have gone to the net core.
14+
default 0 if $(BOARD) = "nrf5340bsim_nrf5340_cpuapp"

tests/bsim/bluetooth/ll/bis/prj.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ CONFIG_BT_CTLR_ADV_ISO_PDU_LEN_MAX=251
2121
CONFIG_BT_CTLR_SYNC_ISO_PDU_LEN_MAX=251
2222

2323
CONFIG_BT_CTLR_TEST=y
24+
25+
CONFIG_BT_BUF_ACL_TX_SIZE=251
26+
CONFIG_BT_BUF_ACL_RX_SIZE=255
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright (c) 2023 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(NOT("${SB_CONFIG_NET_CORE_BOARD}" STREQUAL ""))
5+
set(NET_APP hci_rpmsg)
6+
set(NET_APP_SRC_DIR ${ZEPHYR_BASE}/samples/bluetooth/${NET_APP})
7+
8+
ExternalZephyrProject_Add(
9+
APPLICATION ${NET_APP}
10+
SOURCE_DIR ${NET_APP_SRC_DIR}
11+
BOARD ${SB_CONFIG_NET_CORE_BOARD}
12+
)
13+
14+
set(${NET_APP}_CONF_FILE
15+
${NET_APP_SRC_DIR}/nrf5340_cpunet_iso-bt_ll_sw_split.conf
16+
CACHE INTERNAL ""
17+
)
18+
19+
# For the simulated board, the application core build will produce the final executable
20+
# for that, we give it the path to the netcore image
21+
set(NET_LIBRARY_PATH ${CMAKE_BINARY_DIR}/${NET_APP}/zephyr/zephyr.elf)
22+
set_property(TARGET ${DEFAULT_IMAGE} APPEND_STRING PROPERTY CONFIG
23+
"CONFIG_NATIVE_SIMULATOR_EXTRA_IMAGE_PATHS=\"${NET_LIBRARY_PATH}\"\n"
24+
)
25+
26+
if (NOT ("${SB_CONFIG_NATIVE_SIMULATOR_PRIMARY_MCU_INDEX}" STREQUAL ""))
27+
set_property(TARGET ${NET_APP} APPEND_STRING PROPERTY CONFIG
28+
"CONFIG_NATIVE_SIMULATOR_PRIMARY_MCU_INDEX=${SB_CONFIG_NATIVE_SIMULATOR_PRIMARY_MCU_INDEX}\n"
29+
)
30+
set_property(TARGET ${DEFAULT_IMAGE} APPEND_STRING PROPERTY CONFIG
31+
"CONFIG_NATIVE_SIMULATOR_PRIMARY_MCU_INDEX=${SB_CONFIG_NATIVE_SIMULATOR_PRIMARY_MCU_INDEX}\n"
32+
)
33+
endif()
34+
35+
# Let's build the net core library first
36+
add_dependencies(${DEFAULT_IMAGE} ${NET_APP})
37+
endif()
38+
39+
# Let's meet the expectation of finding the final executable in zephyr/zephyr.exe
40+
add_custom_target(final_executable
41+
ALL
42+
COMMAND
43+
${CMAKE_COMMAND} -E copy
44+
${CMAKE_BINARY_DIR}/${DEFAULT_IMAGE}/zephyr/zephyr.exe
45+
${CMAKE_BINARY_DIR}/zephyr/zephyr.exe
46+
DEPENDS ${DEFAULT_IMAGE}
47+
)

0 commit comments

Comments
 (0)