Draft
Add GATT notify throughput samples and multirole relay bsim test#33
Conversation
Copilot
AI
changed the title
Add bluetooth notify samples and multirole_gatt_relay bsim test
Add GATT notify throughput samples and multirole relay bsim test
Jun 4, 2026
Copilot created this pull request from a session on behalf of
cvinayak
June 4, 2026 04:54
View session
Reading the TCP/UDP port fields via UNALIGNED_GET(&tcphdr->src_port) takes the address of a packed struct member, which trips Clang's -Waddress-of-packed-member warning. Since net_tcp_hdr and net_udp_hdr are already __packed structs, the compiler emits correct unaligned accesses for direct member reads, so read the port fields directly instead. This is consistent with how the rest of the file already accesses these members. Assisted-by: Cursor:opus-4.8 Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Introduce mandatory fields that drivers need to include in their common data & config structs. These will eventually enable having a larger common functional layer between HCI drivers and their users, which will help simplify drivers but also give the flexibility of introducing new functionality without breaking drivers or their users. Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Add support for the new common data & config fields for all in-tree drivers. Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Standard C doesn't allow empty structs, so place some initial content into the config struct. Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Make these static (no need to export them) and also name them in a way that doesn't class with the HCI driver API prefix. Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Now that we have a common data struct, we can take advantage of it and move the recv callback into it. This way the common layer takes care of assigning, dispatching and clearing the callback. Drivers now have to use the new bt_hci_recv() API to pass data to the layer above them (typically a host stack). Additionally, the drivers no longer get a recv parameter as part of their open() callback, since that's all handled by the common layer. Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
There's no point in having driver specific data structs if the only thing they contain is the common data struct. Just declare the common data struct directly as dev->data. Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Add code comments to make sure the common data/config fields stay in the correct place in the driver-specific struct if those structs ever get modified. Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Document the changes that HCI drivers need to do for their data & config structs, the change to the open() API callback parameters and the existence of the new bt_hci_recv() API. Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Most HCI drivers have never handled the return value from the driver-to-host receive path in any way, and they haven't really needed to either since the buffer was always consumed regardless of success or failure. To be aligned with Zephyr coding guidelines without having to add minimal value code to every driver, change bt_hci_recv() to return void instead. A new bt_hci_recv_err() API is also added for any use case where access to the error is needed. There's also a related semantic change to the recv callback (passed to bt_hci_open()) in that it's now expected to *not* consume the buffer in case of error. There was only a single place in the host that needed an update for this, while e.g. HCI raw always returned success. Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Add clock ID definitions for i.MX952 SoC to support clock configuration in devicetree. Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
Add support for NXP i.MX952 SoC Cortex-M7 core: - Add SoC configuration and Kconfig files - Add M7 core specific initialization code - Add pinctrl definitions for i.MX952 - Add SCMI CPU management support - Update imx9 CMakeLists to include imx952 subdirectory - Register imx952 series in soc.yml Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
Add devicetree source for i.MX952 Cortex-M7 core including: - Memory regions (ITCM, DTCM, OCRAM, DDR) - Interrupt controller (GIC, IRQSTEER) - SCMI clock and power domain support - Peripheral definitions (LPUART, LPI2C, LPSPI, ENET, etc.) - DMA controllers (EDMA) - Timers (TPM, GPT) - GPIO controllers - Mailbox (MU) interfaces Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
Add board support for NXP i.MX952 EVK (Evaluation Kit) with Cortex-M7 core configurations: - M7 core running from TCM (default configuration) - M7 core running from DDR memory - M7 core running from flash memory Board features: - MIMX9529 SoC with Cortex-M7 core - Multiple memory configurations (TCM/DDR/Flash) - Pinctrl definitions for board peripherals - Board documentation - CMake and Kconfig configuration files Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
Enable the MU1 (Messaging Unit 1) driver component in the MCUX SDK driver configuration to support inter-core communication on i.MX952. Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
Disable the device.system component in the MCUX SDK device configuration for i.MX952 to avoid conflicts with Zephyr device initialization system. Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
Add imx952_power header and API Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
i.MX952 M7 supports multi-level interrupt. Current ram_context_for_isr test does not cover multi-level interrupt. So exclude i.MX952 M7. Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
i.MX952 M7 is using multi-level interrupts with custom interrupt handling. So arm_irq_vector_table tests should exclude it. Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
exclude unsupported cases Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
Remove Kconfig settings in tests/ .conf files that have no effect: - Driver/subsystem enables that are already `default y` and gated by a `DT_HAS_<compat>_ENABLED` dependency. - Board/SoC overlay (boards/<board>.conf, socs/<soc>.conf) lines that duplicate, with the same value, an option already set in the test's prj.conf. Assisted-by: Claude:opus-4.8 Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Twister one_line console harnesses match individual output lines. The LVGL demo regex expected square brackets around the heap info line, but the sample prints the statistics without them. Update the regex to match the actual heap info output or the malloc mode message so the rk055hdmipi4ma0 case no longer reports a false hang on mimxrt1170_evk@B. Fixes zephyrproject-rtos#110239 Signed-off-by: Hake Huang <hake.huang@nxp.com>
GPR bit 0 is Write-Only (WO per DM9051A spec), reading returns undefined values (default XXh). The previous code read GPR and only powered on the PHY if bit 0 was set to 1. If the read returned 0x00 (random undefined value), the PHY would never be powered on. Fix by unconditionally writing GPR = 0x00 to power up the PHY, ensuring it is always enabled regardless of any prior state. Signed-off-by: Ching Ping Sun <tom_sun@davicom.com.tw>
Add Doxygen documentation for the micro-step resolution check macro. Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This refactors the default MPU region table into its own file. Also declares it to be weak so SoC or board can override it if needed. Because of this, CONFIG_XTENSA_MPU_ONLY_SOC_RANGES is removed. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This removes xtensa_soc_mpu_ranges[]. SoC or board needing their own memory regions should override xtensa_mpu_ranges[] in their own layer. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This introduces xtensa_mpu_mem_type_ranges[] to specify the memory type for different memory regions. This is used to populate the memory type bits in the MPU entries. The regions here should correspond to hardware configuration. This is being introduced as the memory mapping APIs do not have a way to specify memory type, for example, device MMIO APIs. This also changes the default memory type to 0x6 as this seems to be the default in the background map. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This defines a custom MPU memory types according to memory being used. Also fix the length of vec_helpers section. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
When sorting the entries, we should only consider enabled ones and skip the disabled one in front. This is more efficient. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This looks up the boot permissions in xtensa_mpu_ranges to be programmed into MPU map when removing a thread from domain. If the memory region is not described in xtensa_mpu_ranges, we use the default permissions which only allows kernel read/write access. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
There is no need to split the is_migration blocks into two. They can be done in the same block. And since stack_end_addr is only used inside the is_migration block, we only need to calculate the address inside the block. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
When adding entries to an empty MPU map, we can simply insert the necessary entries at the end of the MPU map. There is no need to consolidate entries or chechking first enabled index. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Change consolidate_entries() so that it can return true or false on whether it is successful in consolidating MPU entries. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
If there are not enough free slots to add new regions, we first try to consolidate entries in the map to see if we can free up some slots. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit removes an empty elseif() branch from the CMake scripts for the IAR linker. The empty branching was generating warnings/noise when building Zephyr with IAR using the latest CMake. Signed-off-by: Felipe Torrezan <felipe.torrezan@qt.io>
The existing hwinfo_mcux_syscon driver handles the 128-bit UID read with no driver changes required Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
This allows checking if it was initialized already and prevent leaking or double-freeing it. I don't think it can happen the way the code is used right now, but I ran into this issue while experimenting with tests. Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
- This is less repetitive. - This is more resilient against changes to the buffer size. Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
Adds a minimal ESP-NOW broadcast sample under samples/boards/espressif/espnow/ demonstrating peer-to-peer communication between ESP32 boards without a Wi-Fi access point. Features: - Role selected at build time (SENDER / RECEIVER / BIDIR) - Broadcasts a 14-byte heartbeat frame: sequence counter, uptime, source MAC - Both devices lock to a fixed channel via esp_wifi_set_channel() -- no AP required - sample.yaml with Twister build-only test (esp32s3 + esp32c6) - CONFIG_BUILD_ONLY_NO_BLOBS=y in extra_args for CI All ESP-IDF API return values are checked and logged. NULL guards added to recv_cb() and send_cb(). Non-ASCII characters and unnecessary Kconfig entries removed. Tested on esp32_devkitc/esp32/procpu (ESP32-D0WD-V3 rev3.0) with two boards exchanging beacons at RSSI -42 dBm. Depends on: zephyrproject-rtos/hal_espressif#552 Signed-off-by: BhuvanChandra DV <bhuvanchandra.dv@rapyuta-robotics.com>
The module-level ``from west.configuration import config`` import is deprecated in favour of the ``west.configuration.Configuration`` class (typically reached via ``self.config`` on a ``WestCommand``). Drop the deprecated import from ``build_helpers.py`` and add a keyword-only ``config`` parameter to ``find_build_dir()``. When the caller does not provide one, fall back to instantiating a ``Configuration`` from the current workspace so out-of-tree behaviour matches the populated-global path the deprecated import used to follow. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be> Assisted-by: Claude:claude-opus-4.7
…ommon Drop the deprecated ``from west.configuration import config`` import from ``run_common.py``. Add a keyword-only ``config`` parameter to ``get_build_dir()``, when the caller does not provide one, instantiate a ``Configuration`` from the current workspace. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be> Assisted-by: Claude:claude-opus-4.7
Drop the deprecated ``from west.configuration import config`` import
from ``build.py`` along with the ``config_get`` / ``config_getboolean``
module-level wrappers. Inline the seven call sites with
``self.config.get('build.<key>', default=...)`` /
``self.config.getboolean('build.<key>', default=...)``, which uses the
dotted-key API exposed by ``west.configuration.Configuration``.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Assisted-by: Claude:claude-opus-4.7
Keep zephyr/edt.pickle when cleaning artifacts for test-only packages. Add edt.pickle to the single-domain and multi-domain allow-lists used by cleanup_device_testing_artifacts(). Update the related Twister unit tests to match the new retained artifact lists. Some runners need edt.pickle at flash time to resolve the code partition from the EDT, so removing it breaks flashing from packaged device-testing artifacts. Signed-off-by: Hake Huang <hake.huang@nxp.com>
Adds devicetree bindings for the Infineon HPPASS Comparator Slope Generator MFD device. The HPPASS CSG MFD device provides the base address, shared comparator interrupt definition, and number of slices for the HPPASS CSG subsystem. Updates the psc3 devicetree definitions to include the CSG and five entries each for the per slice comparator and DAC. Assisted-by: Github Copilot:claude-opus-4.7 Signed-off-by: John Batch <john.batch@infineon.com>
Add internal API header for the HPPASS_CSG_MFD sub-driver. Handles registering individual slice callbacks for the comparator to the shared handler in the MFD. Assisted-by: Github Copilot:claude-opus-4.7 Signed-off-by: John Batch <john.batch@infineon.com>
Adds the CSG MFD driver for the Infineon HPPASS block. The CSG contains five slices containing a DAC and comparator. This MFD owns the combined comparator interrupt and manages dispatches to each child comparator device. Assisted-by: Github Copilot:claude-opus-4.7 Signed-off-by: John Batch <john.batch@infineon.com>
Enables the HPPASS CSG block in the kit_psc3m5_evk eval board. Assisted-by: Github Copilot:claude-opus-4.7 Signed-off-by: John Batch <john.batch@infineon.com>
Add wkhadgar as a collaborator for the Modem and Drivers: Modem areas. Signed-off-by: Paulo Santos <pauloxrms@gmail.com>
For apps built with twister inline the build errors if they happen. This is the same we do in the twister workflow, and in the tests built with compile.source Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The default initialization priority of 79 causes the cellular modem driver to initialize before the network stack (priority 90). Set the default to 91 to ensure the modem initializes after the network stack is ready. Signed-off-by: Povilas Selevicius <povilas.selevicius@quadigi.com>
This code snippet was originally removed by zephyrproject-rtos#109163 but then incorrectly re-introduced by zephyrproject-rtos#107850 (most likely due to a rebasing error). Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Fix two copy-paste errors in the WeAct Studio USB2CANFDV2 documentation page. Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Add three new Bluetooth samples: - peripheral_gatt_notify: Peripheral that sends GATT notifications - central_notify_receive: Central that receives GATT notifications - central_peripheral_notify_send_receive: Central plus Peripheral Add bsim CI test tests/bsim/bluetooth/host/multirole_gatt_relay to verify the 3-device notification relay topology under simulation. Assisted-by: GitHub CoPilot: Claude Opus 4.6 Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
d5304b7 to
a823bbf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three new samples demonstrating a 3-device GATT notification relay topology, plus a bsim CI test covering the usecase.
Samples
samples/bluetooth/peripheral_gatt_notify— Peripheral-only. Advertises custom notify service, sends notifications at max rate, prints periodic throughput (bps).samples/bluetooth/central_peripheral_notify_send_receive— Simultaneous central + peripheral. Connects to Device 3 and subscribes to its notifications; advertises its own service and sends notifications to Device 1. Prints both TX and RX throughput.samples/bluetooth/central_notify_receive— Central-only. Discovers and subscribes to Device 2's notify characteristic, measures RX throughput.All three are standalone-flashable (e.g. three nrf52840dk boards). No PHY/connection update iterations — simple throughput measurement.
Bsim test
tests/bsim/bluetooth/host/multirole_gatt_relay— Compiles all three sample sources into a single binary (followingtests/bsim/bluetooth/ll/throughputpattern). Runs 3 simulated devices, each validates throughput > 0 after a configurable notification count.Bsim single-binary considerations
periph_,central_,multirole_) across all three source files to avoid linker collisions.role_activeguards inBT_CONN_CB_DEFINEcallbacks — all three sets of callbacks are registered at link time, but only the active role's callbacks take effect at runtime....def2/def3) vs Device 3's (...def0/def1) to prevent GATT discovery ambiguity when bothBT_GATT_SERVICE_DEFINEinstances coexist.