Skip to content

bsim: bluetooth: add multi-controller observer test using two hci_uart instances#29

Draft
cvinayak with Copilot wants to merge 7108 commits into
mainfrom
copilot/add-babblesim-test-for-hci-uart-instances
Draft

bsim: bluetooth: add multi-controller observer test using two hci_uart instances#29
cvinayak with Copilot wants to merge 7108 commits into
mainfrom
copilot/add-babblesim-test-for-hci-uart-instances

Conversation

Copilot AI commented May 8, 2026

Copy link
Copy Markdown
  • Merge PR Bluetooth: Introduce multi-controller infrastructure zephyrproject-rtos/zephyr#108254 (multi-controller infrastructure) into branch
  • Add boards/nrf52_bsim.overlay to observer_multi sample
  • Add boards/nrf52_bsim.conf to observer_multi sample
  • Create tests/bsim/bluetooth/host/scan/observer_multi_hci_uart/test_scripts/run.sh
  • Update tests/bsim/bluetooth/hci_uart/compile.sh to build observer_multi and broadcaster_multiple
  • Add broadcaster_multiple device (d=2) to run.sh; update PHY to D=3

Alexios Lyrakis and others added 30 commits May 4, 2026 14:54
Document the S-mode port and the ecall constraint: cause=9 (ECall from
S-mode) is reserved for SBI and cannot be used as a kernel self-trap in
S-mode.

Signed-off-by: Alexios Lyrakis <alexios.lyrakis@gmail.com>
add struct net_if to arguments

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
as the ethernet api already includes
struct net_if as a argument for its
functions also add it to struct wifi_mgmt_ops.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
NET_IF_MAX_CONFIGS is always 1, therefore the NET_IF_INIT and
NET_IF_OFFLOAD_INIT macros can be simplified by removing the array and
using a single struct net_if and struct net_if_dev instead.

This also removes the use of designated initializers with ranges, which
is a GNU extension.
https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
add helper macros to add more than one iface
to a device.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
implement 2 ifaces on one device in the
esp32 wifi driver.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Mention ethernet/wifi api change.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Update the test code in order not to use psa_open_key/psa_close_key
because they have been removed in TF-PSA-Crypto 1.1.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
To have a way to tell whether PS rollback protection is enabled and
also possibly to turn it off.

The Kconfig option is put in a new Kconfig file dedicated to the
Protected Storage, just as we have for the Crypto modules.

`if BUILD_WITH_TFM` is moved to the main Kconfig file so that we don't
have it in every subfile.

`Kconfig.tfm.crypto_modules` is renamed to `Kconfig.tfm.crypto` for
consistency with the partition name.

A CMake macro is introduced to more easily pass boolean Kconfig options
to TF-M and is applied to relevant places.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
"tfm_regression_test" sample used TF-M default testing method where an
external OS (named RTX) is used to run non-secure regression tests. In
this scenario Zephyr OS is completely ignored.

This commit replaces RTX with Zephyr's app as container of the NS code.
This pattern reflects what usually happens in Zephyr when a NS application
is built.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
- Move selection of the isolation level to individual test cases.
- Slightly reshape tests naming in "testcase.yaml".

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
remove unnecessary Kconfigs from the configuration file

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
In order to properly build non-regression tests for the TF-M secure side
we need to pass 2 additional parameters:
- tf-m-tests build folder
- secure test configuration file

Previously these values were added from
'samples/tfm_integration/tfm_regression_tests' sample.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
These were only used in 'samples/tfm_integration/tfm_regression_test' and
when that application is built they are both assumed to be enabled, so
it's not really meaningful to have these Kconfigs generally available.

Extra parameters that need to be passed to the TF-M's CMake build are now
added from
'samples/tfm_integration/tfm_regression_test/CMakeLists.txt'.

In this way regression testing is self contained in that folder and it
doesn't pollute the main TF-M build.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Set stack size to 2048 bytes in order to allow all the tests to complete
successfully on real hardware.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This really is a test, so move it appropriately.
The README file is deleted as there is no need for extra (outdated)
documentation.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
Fix the test on the number of arguments in the erase command
to get the optional size argument that was mistakenly increased by
cb2382d ("drivers: flash: flash_shell.c: Requires device on
destructive ops") and made the argument never considered.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Add IEEE 802.15.4 radio driver configuration option to set the CSMA CA
backoff attempts from IEEE 802.15.4-2003+ MAC PIB attributes.

Signed-off-by: David Boullie <David.Boullie@silabs.com>
Add support for defining the PROTECTEMEM and SECONDARY.PROTECTEMEM
sizes in DTS. The sizes are taken from the nodes with label
'protectedmem_partition' and 'secondary_protectedmem_partition',
respectively. The existing interface for setting them via Kconfig
directly has been kept as is for backward compatibility.

Also add a dependency on secondary_partition to enabling secondary
firmware, as it is used unconditionally by the cmake to get the
start address of the secondary firmware.

Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
Add missing copyright and license notice to stm32wbx SoC Cmake file.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Add MEC175x to perform I2C RTIO loopack sample code

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
nSIM standalone mode has no PLIC/APLIC model, so UART interrupts
never reach the CPU. Disable the interrupt-driven shell UART backend
to fall back to polling mode, which fixes test sample.smf.hsm_psicc2
timeout on rmx100 and rhx100 targets caused by zero console output.

Signed-off-by: Mohamed Moawad <moawad@synopsys.com>
CONFIG_SMP is by default already not enabled,
so there is no need to set the default to n in the
soc or board specific Kconfig.defconfig

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
use configdefault for CONFIG_SMP

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Enforce RFC 9000 Section 8.1 by limiting server transmission to
three times the bytes received from an unvalidated client address.

Gate the behavior behind CONFIG_QUIC_SERVER_ANTI_AMPLIFICATION_LIMIT
to preserve feature-testing scenarios that intentionally bypass the
limit.

Add tests that verify the anti-amplification budget handling.

Assisted-by: Copilot:gpt-5.4
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Make sure we send proper version negotiation packet if
we receive a Quic version packet that we do not support.

Add tests that make sure version negotiation works ok.

Assisted-by: Copilot:gpt-5.4
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Initial packet DCID must be >= 8 bytes long. Enforce that
and test it too.

Assisted-by: Copilot:gpt-5.4
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Clarify in the public API and Kconfig help that server mode can send
Version Negotiation and enforce anti-amplification, but Retry and
NEW_TOKEN-based address-validation tokens are not yet implemented.

Also warn when an Initial packet carries a token that the current
implementation does not process.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
A receiver advertises two credits, per-stream
(initial_max_stream_data_*, updated by MAX_STREAM_DATA) and
per-connection (initial_max_data, updated by MAX_DATA). An
endpoint MUST NOT allow the largest received byte offset on a
stream to exceed the stream limit (§4.1), MUST NOT allow the sum of
received offsets across streams to exceed the connection limit (§4.1),
and MUST close with FLOW_CONTROL_ERROR (0x03, §11.2) on
violation. The check is on wire offsets, not on what fits locally.

The code did not do the checks properly for RX data.

Assisted-by: Copilot:gpt-5.4
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Wake any client-side stream_open() waiters that are still blocked on
the handshake outcome.

Assisted-by: Copilot:gpt-5.4
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
silesh-alifsemi and others added 22 commits May 6, 2026 12:02
Move the pinctrl_soc.h header from the Ensemble family directory to
a new vendor-level common directory (soc/alif/common/) to enable
sharing across all Alif Semiconductor SoC families. The pinctrl
hardware implementation is identical across Alif SoC families
(Ensemble and Balletto) and has the same pad configuration and
alternate function register layout.

No functional changes.

Signed-off-by: Silesh C V <silesh@alifsemi.com>
Balletto is a family of BLE 5.3 microcontrollers from Alif
Semiconductor, integrating an Arm Ethos-U55 NPU and a dedicated
network co-processor. The application core is a single Cortex-M55
running in the RTSS-HE (Real Time Subsystem - High Efficiency)
subsystem, targeting power-efficient edge AI/ML and wireless IoT
applications.

Add SoC framework support for the Balletto family, the B1 series
within the family and the AB1C1F4M51820PH0 SoC within the series.

Link: https://alifsemi.com/products/balletto/
Link: https://alifsemi.com/balletto-b1-series/

Signed-off-by: Silesh C V <silesh@alifsemi.com>
The Alif Balletto family of processors contain a single
Cortex-M55 core residing in the High Efficiency Real Time
Subsystem (RTSS-HE).

Add a common device tree file that serves as the foundation
for all SoCs in the Balletto family. This file currently defines
the CPU, MPU, TCM and NVIC nodes that are common across the family.
Peripheral instances shared across all Balletto SoCs will be
added to this file as driver support is introduced in future
patches.

Signed-off-by: Silesh C V <silesh@alifsemi.com>
Balletto SoCs have a peripheral region at 0x1A000000 (8 MB)
that hosts peripherals such as pinmux and clock control registers.
This deviates from the standard Cortex-M memory map and requires
explicit MPU configuration with device memory attributes.

Signed-off-by: Silesh C V <silesh@alifsemi.com>
Add clock definitions for the Alif Semiconductor Balletto family of
SoCs. The definitions use the encoding scheme and module IDs provided
by alif-clocks-common.h header.

Initial support includes UART clocks.

Signed-off-by: Silesh C V <silesh@alifsemi.com>
Add fixed-clock nodes for some of the Balletto family root clocks.
These clocks serve as input sources for peripheral clocks managed
by the clock controller.

Signed-off-by: Silesh C V <silesh@alifsemi.com>
Make the m55hp_cfg register block optional to support single-core
Alif SoCs (such as from the Balletto family) that only have the
Cortex-M55 HE subsystem. Multi-core SoCs that have both RTSS-HE
and RTSS-HP subsystems require all 7 register blocks.

Update the binding documentation accordingly.

Signed-off-by: Silesh C V <silesh@alifsemi.com>
Add clock controller node for the balletto family. Balletto
family shares the same clock module architecture with Ensemble
differing only in the absence of the HP core configuration
region (m55_cfg).

Signed-off-by: Silesh C V <silesh@alifsemi.com>
Add the pinctrl node for the balletto family. Balletto shares the
pin control architecture with Alif Ensemble.

Signed-off-by: Silesh C V <silesh@alifsemi.com>
Add pin multiplexing definitions for the Alif Balletto B1 series.
Each pin supports up to 8 functions: GPIO and 7 alternate functions.

The pinmux encoding uses an 11-bit value:
- Bits [0:2]   - Alternate function (0=GPIO, 1-7=AF1-AF7)
- Bits [3:5]   - Pin number within port (0-7)
- Bits [6:10]  - Port number (0-8 for GPIO, 15 for LPGPIO)

Pin naming follows the convention: PIN_P{port}_{pin}__{function}
Example: PIN_P0_0__UART0_RX_A = Port 0, Pin 0, UART0 RX function

Signed-off-by: Silesh C V <silesh@alifsemi.com>
Add device tree nodes for the six UARTs that are present in all
the Balletto B1 series SoCs.

Signed-off-by: Silesh C V <silesh@alifsemi.com>
Add the device tree file for the SoC AB1C1F4M51820PH0. This file
will host the SoC specific peripheral instances in addition to the
common resources inherited from balletto_common.dtsi.

Signed-off-by: Silesh C V <silesh@alifsemi.com>
Add board support for the Alif Balletto B1 Development Kit
featuring the Balletto B1 SoC.

The Balletto B1 is a single core SoC series featuring a Cortex-M55
cluster called RTSS-HE (Real Time SubSystem - High Efficiency).
Initial board support adds support for the ab1c1f4m51820ph0 SoC and
includes UART for console output.

Link: https://alifsemi.com/support/kits/balletto-b1devkit/

Signed-off-by: Silesh C V <silesh@alifsemi.com>
This commit dsiables alarm counter before executing callback
function. Additionally, the alarm counter (external timer 7)
ticks are limited to 3 bytes. Return errno if the configured
value exceeds this range.

Tested with: samples/drivers/counter/alarm

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
as title.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
Add missing license and copyright notices to samples ST boards
configuration and DTS overlay files. See shell commands used in
zephyrproject-rtos#107404.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Add missing license and copyright notices to tests ST boards
configuration and DTS overlay files. See shell commands used in
zephyrproject-rtos#107404.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Add missing copyright and license notice to ST boards Cmake files
and defconfig files. See shell commands used in
zephyrproject-rtos#107404.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Add foundational infrastructure for supporting multiple HCI
controller devices in the Bluetooth host stack.

Kconfig:
- BT_HCI_MAX_DEV: max number of HCI devices (default 1)
- BT_HCI_HOST selects POLL (for k_poll_signal)

struct bt_dev changes:
- Add 'id' field (uint8_t, HCI device index)
- Add 'ready_sig' field (struct k_poll_signal *)
- Replace singleton bt_dev with bt_devs[] array
- Add bt_dev_get() and bt_dev_lookup_hci() helpers

Public API (include/zephyr/bluetooth/bluetooth.h):
- BT_HCI_DEFAULT macro for the DT chosen HCI device
- bt_dev_enable(dev, signal): enable with k_poll_signal
- bt_dev_disable(dev): disable a controller
- bt_enable() becomes a wrapper using k_work_poll bridge
- bt_le_scan_param.hci_dev / bt_le_scan_recv_info.hci_dev

Per-device command pipeline:
- bt_hci_cmd_send_by_dev / bt_hci_cmd_send_sync_by_dev
- bt_send() takes struct bt_dev *hdev parameter

Event handler signature:
- All handlers gain struct bt_dev *hdev first parameter

Per-device identity and random address:
- set_random_address_by_dev
- bt_id_set_private_addr_by_dev
- bt_id_set_scan_own_addr gains hdev parameter

No functional change when CONFIG_BT_HCI_MAX_DEV == 1.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
Assisted-by: Kiro:claude-opus-4.6
Add per-device scan state and userchan multi-instance support.

scan.c:
- Introduce struct bt_scan_state per controller
- scan_states[] array indexed by bt_dev.id
- Per-device ext_scan_buf and reassembling_advertiser
- bt_le_scan_start/stop operate on param->hci_dev

userchan.c:
- Per-instance rx thread stack and k_thread
- Per-instance connection parameters (--bt-dev=...)
- Support multiple --bt-dev arguments for multi-controller

tests:
- Update unit test mocks for new hdev parameter signatures
- Add bt_hci_cmd_send_sync_by_dev mock wrapper

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
Assisted-by: Kiro:claude-opus-4.6
Minimal sample that starts LE passive scan on two HCI
controllers simultaneously, demonstrating multi-controller
scan infrastructure.

Includes board overlays for qemu_x86 (uart2 + H4 second
instance with custom IRQ 5) and native_sim (userchan second
instance).

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
Assisted-by: Kiro:claude-opus-4.6
…t instances

Add a babblesim CI test under tests/bsim/bluetooth/host/scan/observer_multi_hci_uart/
that exercises the samples/bluetooth/observer_multi sample with two hci_uart
controller instances connected over UART.

The test launches:
- observer_multi app (nosim, d=10) with uart1->ctrl0 and uart0->ctrl1 connections
- hci_uart controller 0 (d=0, connected to 2G4 PHY)
- hci_uart controller 1 (d=1, connected to 2G4 PHY)
- bs_2G4_phy_v1 with D=2 and 15s simulation time

Board files added to the observer_multi sample for nrf52_bsim:
- boards/nrf52_bsim.overlay: adds bt_hci_uart_1 child node on uart0, removes
  uart0 from console chosen, exposes bt-hci1 alias
- boards/nrf52_bsim.conf: disables UART console so uart0 is free for HCI

The compile.sh is updated to build observer_multi for nrf52_bsim alongside
the existing hci_uart and hci_uart_async samples.

Signed-off-by: Copilot <copilot@github.com>

Agent-Logs-Url: https://github.com/cvinayak/zephyr/sessions/32755843-ac07-427f-a423-e6660c550661

Co-authored-by: cvinayak <6350656+cvinayak@users.noreply.github.com>
…g peer

Add a broadcaster_multiple device (d=2, built-in LL SW-split) to the
observer_multi_hci_uart simulation so that both hci_uart scanner
instances actually receive advertising reports during the test run.

PHY device count updated from D=2 to D=3 to include the broadcaster.
compile.sh updated to build broadcaster_multiple with the
overlay-bt_ll_sw_split.conf overlay required for nrf52_bsim.

Agent-Logs-Url: https://github.com/cvinayak/zephyr/sessions/d5334994-41a7-424c-a4aa-86dfe6e16ff0

Co-authored-by: cvinayak <6350656+cvinayak@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.