From 31863fd8e36fe1884a9dde92bce47047a1d3a3f0 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Fri, 27 Dec 2024 06:02:01 +0100 Subject: [PATCH] tests: bsim: Bluetooth: nrRF53/54L: Throughput and multiple_id testing Enable throughput and multiple_id testing on nRF5340bsim and nrf54l15bsim. Signed-off-by: Vinayak Kariappa Chettimada --- .../boards/nrf54l15bsim_nrf54l15_cpuapp.conf | 3 ++ .../boards/nrf54l15bsim_nrf54l15_cpuapp.conf | 3 ++ .../boards/nrf54l15bsim_nrf54l15_cpuapp.conf | 5 +++ .../compile.nrf5340bsim_nrf5340_cpuapp.sh | 2 ++ .../compile.nrf54l15bsim_nrf54l15_cpuapp.sh | 3 ++ .../bluetooth/ll/multiple_id/Kconfig.sysbuild | 14 ++++++++ ...lay-nrf5340_cpunet_iso-bt_ll_sw_split.conf | 34 +++++++++++++++++++ tests/bsim/bluetooth/ll/multiple_id/prj.conf | 20 +++++++---- .../bluetooth/ll/multiple_id/sysbuild.cmake | 29 ++++++++++++++++ .../bluetooth/ll/throughput/Kconfig.sysbuild | 14 ++++++++ tests/bsim/bluetooth/ll/throughput/prj.conf | 3 ++ .../bluetooth/ll/throughput/sysbuild.cmake | 24 +++++++++++++ .../ll/throughput/tests_scripts/gatt_write.sh | 6 ++-- .../tests.nrf5340bsim_nrf5340_cpuapp.txt | 2 ++ .../tests.nrf54l15bsim_nrf54l15_cpuapp.txt | 5 ++- 15 files changed, 157 insertions(+), 10 deletions(-) create mode 100644 samples/bluetooth/bap_unicast_client/boards/nrf54l15bsim_nrf54l15_cpuapp.conf create mode 100644 samples/bluetooth/bap_unicast_server/boards/nrf54l15bsim_nrf54l15_cpuapp.conf create mode 100644 tests/bsim/bluetooth/audio_samples/bap_unicast_client/boards/nrf54l15bsim_nrf54l15_cpuapp.conf create mode 100644 tests/bsim/bluetooth/ll/multiple_id/Kconfig.sysbuild create mode 100644 tests/bsim/bluetooth/ll/multiple_id/overlay-nrf5340_cpunet_iso-bt_ll_sw_split.conf create mode 100644 tests/bsim/bluetooth/ll/multiple_id/sysbuild.cmake create mode 100644 tests/bsim/bluetooth/ll/throughput/Kconfig.sysbuild create mode 100644 tests/bsim/bluetooth/ll/throughput/sysbuild.cmake diff --git a/samples/bluetooth/bap_unicast_client/boards/nrf54l15bsim_nrf54l15_cpuapp.conf b/samples/bluetooth/bap_unicast_client/boards/nrf54l15bsim_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..8bfd5bc41f9b --- /dev/null +++ b/samples/bluetooth/bap_unicast_client/boards/nrf54l15bsim_nrf54l15_cpuapp.conf @@ -0,0 +1,3 @@ +# For LC3 the following configs are needed +CONFIG_FPU=y +CONFIG_LIBLC3=y diff --git a/samples/bluetooth/bap_unicast_server/boards/nrf54l15bsim_nrf54l15_cpuapp.conf b/samples/bluetooth/bap_unicast_server/boards/nrf54l15bsim_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..8bfd5bc41f9b --- /dev/null +++ b/samples/bluetooth/bap_unicast_server/boards/nrf54l15bsim_nrf54l15_cpuapp.conf @@ -0,0 +1,3 @@ +# For LC3 the following configs are needed +CONFIG_FPU=y +CONFIG_LIBLC3=y diff --git a/tests/bsim/bluetooth/audio_samples/bap_unicast_client/boards/nrf54l15bsim_nrf54l15_cpuapp.conf b/tests/bsim/bluetooth/audio_samples/bap_unicast_client/boards/nrf54l15bsim_nrf54l15_cpuapp.conf new file mode 100644 index 000000000000..e8c8629ce62f --- /dev/null +++ b/tests/bsim/bluetooth/audio_samples/bap_unicast_client/boards/nrf54l15bsim_nrf54l15_cpuapp.conf @@ -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 diff --git a/tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpuapp.sh b/tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpuapp.sh index 62f32ca2338f..00dc5c4bdb66 100755 --- a/tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpuapp.sh +++ b/tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpuapp.sh @@ -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 diff --git a/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh b/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh index 8e56e1caa395..a17d9bf86773 100755 --- a/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh +++ b/tests/bsim/bluetooth/compile.nrf54l15bsim_nrf54l15_cpuapp.sh @@ -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 diff --git a/tests/bsim/bluetooth/ll/multiple_id/Kconfig.sysbuild b/tests/bsim/bluetooth/ll/multiple_id/Kconfig.sysbuild new file mode 100644 index 000000000000..6cf765d44e25 --- /dev/null +++ b/tests/bsim/bluetooth/ll/multiple_id/Kconfig.sysbuild @@ -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" diff --git a/tests/bsim/bluetooth/ll/multiple_id/overlay-nrf5340_cpunet_iso-bt_ll_sw_split.conf b/tests/bsim/bluetooth/ll/multiple_id/overlay-nrf5340_cpunet_iso-bt_ll_sw_split.conf new file mode 100644 index 000000000000..7dc53386b6dd --- /dev/null +++ b/tests/bsim/bluetooth/ll/multiple_id/overlay-nrf5340_cpunet_iso-bt_ll_sw_split.conf @@ -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 diff --git a/tests/bsim/bluetooth/ll/multiple_id/prj.conf b/tests/bsim/bluetooth/ll/multiple_id/prj.conf index c32e067d922a..345c7b2a64b1 100644 --- a/tests/bsim/bluetooth/ll/multiple_id/prj.conf +++ b/tests/bsim/bluetooth/ll/multiple_id/prj.conf @@ -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 @@ -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 diff --git a/tests/bsim/bluetooth/ll/multiple_id/sysbuild.cmake b/tests/bsim/bluetooth/ll/multiple_id/sysbuild.cmake new file mode 100644 index 000000000000..0e987ad242e7 --- /dev/null +++ b/tests/bsim/bluetooth/ll/multiple_id/sysbuild.cmake @@ -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}) diff --git a/tests/bsim/bluetooth/ll/throughput/Kconfig.sysbuild b/tests/bsim/bluetooth/ll/throughput/Kconfig.sysbuild new file mode 100644 index 000000000000..6cf765d44e25 --- /dev/null +++ b/tests/bsim/bluetooth/ll/throughput/Kconfig.sysbuild @@ -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" diff --git a/tests/bsim/bluetooth/ll/throughput/prj.conf b/tests/bsim/bluetooth/ll/throughput/prj.conf index 6f52a3d5091c..49a2099c3a65 100644 --- a/tests/bsim/bluetooth/ll/throughput/prj.conf +++ b/tests/bsim/bluetooth/ll/throughput/prj.conf @@ -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 @@ -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 diff --git a/tests/bsim/bluetooth/ll/throughput/sysbuild.cmake b/tests/bsim/bluetooth/ll/throughput/sysbuild.cmake new file mode 100644 index 000000000000..69397264edfa --- /dev/null +++ b/tests/bsim/bluetooth/ll/throughput/sysbuild.cmake @@ -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}) diff --git a/tests/bsim/bluetooth/ll/throughput/tests_scripts/gatt_write.sh b/tests/bsim/bluetooth/ll/throughput/tests_scripts/gatt_write.sh index 12881ee88c07..61fd4bc8edcc 100755 --- a/tests/bsim/bluetooth/ll/throughput/tests_scripts/gatt_write.sh +++ b/tests/bsim/bluetooth/ll/throughput/tests_scripts/gatt_write.sh @@ -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 diff --git a/tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpuapp.txt b/tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpuapp.txt index b14d3819f5f5..539015d14280 100644 --- a/tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpuapp.txt +++ b/tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpuapp.txt @@ -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/ diff --git a/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt b/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt index 8c39f8fbcc5a..1df18c98a437 100644 --- a/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt +++ b/tests/bsim/bluetooth/tests.nrf54l15bsim_nrf54l15_cpuapp.txt @@ -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/