Skip to content

Commit

Permalink
tests: bsim: Bluetooth: nrRF53/54L: Throughput and multiple_id testing
Browse files Browse the repository at this point in the history
Enable throughput and multiple_id testing on nRF5340bsim and
nrf54l15bsim.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
  • Loading branch information
cvinayak authored and kartben committed Jan 18, 2025
1 parent 750250f commit 31863fd
Show file tree
Hide file tree
Showing 15 changed files with 157 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# For LC3 the following configs are needed
CONFIG_FPU=y
CONFIG_LIBLC3=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# For LC3 the following configs are needed
CONFIG_FPU=y
CONFIG_LIBLC3=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file content is just a copy of the equivalent one in the unicast client sample

# For LC3 the following configs are needed
CONFIG_FPU=y
CONFIG_LIBLC3=y
2 changes: 2 additions & 0 deletions tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpuapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export BOARD="${BOARD:-nrf5340bsim/nrf5340/cpuapp}"
source ${ZEPHYR_BASE}/tests/bsim/compile.source

app=tests/bsim/bluetooth/ll/conn conf_file=prj_split_privacy.conf sysbuild=1 compile
app=tests/bsim/bluetooth/ll/throughput sysbuild=1 compile
app=tests/bsim/bluetooth/ll/multiple_id sysbuild=1 compile
app=tests/bsim/bluetooth/ll/bis sysbuild=1 compile
app=tests/bsim/bluetooth/ll/cis conf_overlay=overlay-acl_group.conf sysbuild=1 compile

Expand Down
3 changes: 3 additions & 0 deletions tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ export BOARD="${BOARD:-nrf54l15bsim/nrf54l15/cpuapp}"

source ${ZEPHYR_BASE}/tests/bsim/compile.source

app=tests/bsim/bluetooth/ll/throughput compile
app=tests/bsim/bluetooth/ll/multiple_id compile

run_in_background ${ZEPHYR_BASE}/tests/bsim/bluetooth/samples/compile.sh
run_in_background ${ZEPHYR_BASE}/tests/bsim/bluetooth/audio/compile.sh
run_in_background ${ZEPHYR_BASE}/tests/bsim/bluetooth/audio_samples/compile.sh

wait_for_background_jobs
14 changes: 14 additions & 0 deletions tests/bsim/bluetooth/ll/multiple_id/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

source "share/sysbuild/Kconfig"

config NET_CORE_BOARD
string
default "nrf5340bsim/nrf5340/cpunet" if $(BOARD_TARGET_STRING) = "NRF5340BSIM_NRF5340_CPUAPP"

config NATIVE_SIMULATOR_PRIMARY_MCU_INDEX
int
# Let's pass the test arguments to the application MCU test
# otherwise by default they would have gone to the net core.
default 0 if $(BOARD_TARGET_STRING) = "NRF5340BSIM_NRF5340_CPUAPP"
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Maximum simultaneous ACL connections, today's maximum considering other
# roles using ticker nodes count up to 255 (UINT8_MAX) in the hci_ipc with ISO
# support
CONFIG_BT_MAX_CONN=233

# Each PHY update can pause connections for 6 interval hence to let other
# parallel connection establishment to succeed increase Rx buffer count.
# A minimum of 1 Rx buffer is required to receive data PDU, during control
# procedures Rx buffer could be held, preventing new connections to be
# established, a value of 3 is tuned based on this test case execution for 2
# iterations. If there is buffer leak, simulated by using value of 2 here, the
# test is failing.
# If there is buffer leak, this test now should catch it.
CONFIG_BT_CTLR_RX_BUFFERS=3

# Provide enough spacing between connections so that multiple peripheral roles
# when connected to a single peer device (peripheral_identity sample) have
# room for window widening and do not overlap with each other in that single
# peer device. This can be tuned based on connection interval and clock
# accuracy, current value here is sufficient for 500ppm at 1 second interval and
# considering required connection event length for 251 byte PDU on 2M PHY.
# (Event Overhead + Radio Ready Delay + Rx window + 1064 + 154 + 1064)
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_CENTRAL_SPACING=3750

# Do not use max data PDU size time reservation for connection events spacing
# instead use lesser value as supplied in CONFIG_BT_CTLR_CENTRAL_SPACING
CONFIG_BT_CTLR_CENTRAL_RESERVE_MAX=n
CONFIG_BT_CTLR_SLOT_RESERVATION_UPDATE=n

# Required maximum simultaneous LLCP contexts
CONFIG_BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM=233

CONFIG_LOG=y
20 changes: 13 additions & 7 deletions tests/bsim/bluetooth/ll/multiple_id/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@ CONFIG_BT_AUTO_PHY_UPDATE=y
CONFIG_BT_USER_DATA_LEN_UPDATE=y
CONFIG_BT_AUTO_DATA_LEN_UPDATE=y

CONFIG_BT_MAX_CONN=250
CONFIG_BT_ID_MAX=250

# L2CAP, ATT and SMP usage cause data transmission deadlock due to shortage
# of buffers when transactions crossover amongst the connections in the same
# device. Hence, keeping them disabled in this test until future investigations.
# Maximum simultaneous ACL connections, current maximum considering other roles
# using ticker nodes count up to 255 (UINT8_MAX) in the hci_ipc with ISO support
CONFIG_BT_MAX_CONN=233
CONFIG_BT_ID_MAX=233

# Avoid using the PPCP provided connection interval so that the multiple
# connections are kept non-overlapping as initially scheduled at connection
# setup
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n

# Enables simultaneousn MTU exchange in the test
CONFIG_BT_GATT_CLIENT=y

# Having simulataneous SMP procedures leads to deadlock, disabled pending
# required investigation of the issue.
# CONFIG_BT_SMP=y
# CONFIG_BT_MAX_PAIRED=250
# CONFIG_BT_MAX_PAIRED=233

CONFIG_BT_L2CAP_TX_MTU=247

Expand Down Expand Up @@ -58,3 +62,5 @@ CONFIG_BT_CTLR_CENTRAL_SPACING=3750
# instead use lesser value as supplied in CONFIG_BT_CTLR_CENTRAL_SPACING
CONFIG_BT_CTLR_CENTRAL_RESERVE_MAX=n
CONFIG_BT_CTLR_SLOT_RESERVATION_UPDATE=n

CONFIG_LOG=y
29 changes: 29 additions & 0 deletions tests/bsim/bluetooth/ll/multiple_id/sysbuild.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

if(NOT("${SB_CONFIG_NET_CORE_BOARD}" STREQUAL ""))
set(NET_APP hci_ipc)
set(NET_APP_SRC_DIR ${ZEPHYR_BASE}/samples/bluetooth/${NET_APP})

ExternalZephyrProject_Add(
APPLICATION ${NET_APP}
SOURCE_DIR ${NET_APP_SRC_DIR}
BOARD ${SB_CONFIG_NET_CORE_BOARD}
)

set(${NET_APP}_CONF_FILE
${NET_APP_SRC_DIR}/nrf5340_cpunet_iso-bt_ll_sw_split.conf
CACHE INTERNAL ""
)

set(${NET_APP}_EXTRA_CONF_FILE
${APP_DIR}/overlay-nrf5340_cpunet_iso-bt_ll_sw_split.conf
CACHE INTERNAL ""
)

native_simulator_set_primary_mcu_index(${DEFAULT_IMAGE} ${NET_APP})

native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP})
endif()

native_simulator_set_final_executable(${DEFAULT_IMAGE})
14 changes: 14 additions & 0 deletions tests/bsim/bluetooth/ll/throughput/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

source "share/sysbuild/Kconfig"

config NET_CORE_BOARD
string
default "nrf5340bsim/nrf5340/cpunet" if $(BOARD_TARGET_STRING) = "NRF5340BSIM_NRF5340_CPUAPP"

config NATIVE_SIMULATOR_PRIMARY_MCU_INDEX
int
# Let's pass the test arguments to the application MCU test
# otherwise by default they would have gone to the net core.
default 0 if $(BOARD_TARGET_STRING) = "NRF5340BSIM_NRF5340_CPUAPP"
3 changes: 3 additions & 0 deletions tests/bsim/bluetooth/ll/throughput/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CONFIG_BT_CENTRAL=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_SMP=y
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_SEND_ECC_EMULATION=y

CONFIG_BT_BUF_ACL_RX_SIZE=255
CONFIG_BT_BUF_ACL_TX_SIZE=251
Expand All @@ -12,3 +13,5 @@ CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255
CONFIG_BT_L2CAP_TX_MTU=247

CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

CONFIG_LOG=y
24 changes: 24 additions & 0 deletions tests/bsim/bluetooth/ll/throughput/sysbuild.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

if(NOT("${SB_CONFIG_NET_CORE_BOARD}" STREQUAL ""))
set(NET_APP hci_ipc)
set(NET_APP_SRC_DIR ${ZEPHYR_BASE}/samples/bluetooth/${NET_APP})

ExternalZephyrProject_Add(
APPLICATION ${NET_APP}
SOURCE_DIR ${NET_APP_SRC_DIR}
BOARD ${SB_CONFIG_NET_CORE_BOARD}
)

set(${NET_APP}_CONF_FILE
${NET_APP_SRC_DIR}/nrf5340_cpunet_iso-bt_ll_sw_split.conf
CACHE INTERNAL ""
)

native_simulator_set_primary_mcu_index(${DEFAULT_IMAGE} ${NET_APP})

native_simulator_set_child_images(${DEFAULT_IMAGE} ${NET_APP})
endif()

native_simulator_set_final_executable(${DEFAULT_IMAGE})
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ EXECUTE_TIMEOUT=240
cd ${BSIM_OUT_PATH}/bin

Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_throughput_prj_conf \
-v=${verbosity_level} -s=${simulation_id} -d=0 -testid=central
-v=${verbosity_level} -s=${simulation_id} -RealEncryption=1 -d=0 \
-testid=central

Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_throughput_prj_conf\
-v=${verbosity_level} -s=${simulation_id} -d=1 -testid=peripheral
-v=${verbosity_level} -s=${simulation_id} -RealEncryption=1 -d=1 \
-testid=peripheral

Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=60e6 $@ -argschannel -at=40
Expand Down
2 changes: 2 additions & 0 deletions tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpuapp.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Search paths(s) for tests which will be run in the nrf5340 split stack configuration
# This file is used in CI to select which tests are run
tests/bsim/bluetooth/ll/conn/tests_scripts/basic_conn_encrypted_split_privacy.sh
tests/bsim/bluetooth/ll/throughput/
tests/bsim/bluetooth/ll/multiple_id/
tests/bsim/bluetooth/ll/bis/tests_scripts/broadcast_iso.sh
tests/bsim/bluetooth/samples/central_hr_peripheral_hr/
tests/bsim/bluetooth/audio_samples/
Expand Down
5 changes: 4 additions & 1 deletion tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Search paths(s) for tests which will be run in the nrf54l15 app core
# This file is used in CI to select which tests are run
tests/bsim/bluetooth/ll/multiple_id/tests_scripts/multiple.sh
tests/bsim/bluetooth/ll/throughput/
tests/bsim/bluetooth/ll/multiple_id/
tests/bsim/bluetooth/samples/central_hr_peripheral_hr/
tests/bsim/bluetooth/audio_samples/
tests/bsim/bluetooth/audio/

0 comments on commit 31863fd

Please sign in to comment.