Commit Graph

1879 Commits

Author SHA1 Message Date
Vinit Mehta
1d44972a26 samples: bluetooth: pbp_public_broadcast: Fix PACS register issue
- Add sink PACS register for PBP public broadcast sink example to make
  it work with PBP broadcast source

Signed-off-by: Vinit Mehta <vinit.mehta@nxp.com>
2025-07-28 16:41:51 -04:00
Gomaa Mohammed Eldebaby
01b14df31e samples: bluetooth: typo in project name
Corrected a typo in the project name within the Bluetooth
samples directory. The incorrect name was causing confusion
in documentation and build processes. This change updates
the relevant file(s) to use the correct project name, ensuring
consistency across the Zephyr repository.

Signed-off-by: Gomaa Mohammed Eldebaby <gomaaeldebaby2211@gmail.com>
2025-07-28 08:55:42 -04:00
Manojkumar Konisetty
26fd4458de samples: bluetooth: mtu_update: peripheral: Restart Advertisement
Add a workqueue to handle readvertisement after
disconnection from central. This avoids performing
advertising operations directly from the disconnected callback,
ensuring better thread safety.

Signed-off-by: Manojkumar Konisetty <manoj@aerlync.com>
2025-07-19 13:49:46 -04:00
Manojkumar Konisetty
caf2caea94 samples: bluetooth: mtu_update: peripheral: Avoid busy-looping
Avoid busy-looping before BLE connection and introduce
a semaphore. Check for NULL conn before retaking
semaphore after disconnection.

Signed-off-by: Manojkumar Konisetty <manoj@aerlync.com>
2025-07-19 13:49:46 -04:00
Vinayak Kariappa Chettimada
43e8753f86 board: nrf: Fix nRF54LM20DK upstream Bluetooth Controller supported
Fix nRF54LM20DK upstream Bluetooth Controller supported.

Relates to commit 3d1fa8b333 ("board: nrf: Add nRF54LM20DK
board").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-07-19 13:24:24 -04:00
Gaetan Perrot
2d9d14e55e samples: bluetooth: cap_initiator: Fix shadowed variable
Avoid redeclaring 'err' inside a nested block, which shadowed the outer
definition.

This cleanup prevents confusion and potential logical bugs.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-19 10:14:13 +02:00
Gaetan Perrot
5cff080775 samples: bluetooth: cap_acceptor: Fix shadowed variable
Avoid redeclaring 'err' inside a nested block, which shadowed the outer
definition.

This cleanup prevents confusion and potential logical bugs.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-19 10:14:13 +02:00
Ravinder Singh
394c97a819 Bluetooth: LE: CONN: Added bt_conn_le_set_default_phy function.
Added bt_le_set_default_phy in hci. This handles
the HCI_LE_Set_Default_PHY HCI command.
Added call to bt_conn_le_set_default_phy in central_gatt_write and
peripheral_gatt_write samples.

Signed-off-by: Ravinder Singh <ravinder.singh2@infineon.com>
2025-07-19 09:46:34 +02:00
Johan Hedberg
c85cc47b5b Bluetooth: samples: Fix off-by-one bug in atomic API usage
The code was accessing bits 1 and 2 (but not 0), effectively needing three
bits, but still requesting only 2 when calling ATOMIC_DEFINE().

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-07-04 13:05:22 -05:00
Alex Zhou
9aa0ae9378 samples: Bluetooth: PAWR: Fix Response Slot Delay Value is too Small
Previously, reponse slot value is 5* 1.25ms = 6.25ms , on nxp rw61x
platform, host got the periodic adv report v2 and after about 6ms,
send reponse data cmd,  it is too late , so always rpt the 0x46 too
late err code to host , in order to send the response , so make rsp
delay update to 10ms.

Signed-off-by: Alex Zhou <alex.zhou@nxp.com>
2025-06-30 17:37:19 -05:00
Sylvio Alves
f775f9a96e samples: bluetooth: add esp32c6 testcase
Allows CI to build and test bluetooth driver of ESP32-C6 SoC.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-06-27 18:27:15 -05:00
Nirav Agrawal
706cfc211d samples: bluetooth: fixes tmap sample issues
- Added support for CAP_COMMANDER in configuration to allow tmap-cg
 and tmap-ums roles to be validated. For CG and UMR, CAP INITIATOR
 and CAP COMMANDER roles are mandatory. Without this support, config
 "CONFIG_BT_TMAP_CG_SUPPORTED" & "CONFIG_BT_TMAP_UMS_SUPPORTED" are
 not getting defined and function fail during "valid_tmap_role()".

- Replaced iso_pool user-data size from 8 to kconfig setting
 "CONFIG_BT_CONN_TX_USER_DATA_SIZE" to allow conn_iso_send()
 to success. Without it the user-data for iso_pool configured
 with value 8 but the kconfig "BT_CONN_TX_USER_DATA_SIZE" has
 default value as 16 causes conn_iso_send() function to fail.

- Updated audio_timer_timeout() with expected QoS interval value
 to send ISO_SDU at every 10msec instead of 1 sec. Without this sink
 device receiving null-sdu most of the time as ISO interval is 10ms
 and unicast-source keep sends SDU at every 1 sec.

Signed-off-by: Nirav Agrawal <nirav.agrawal@nxp.com>
2025-06-25 15:51:24 -10:00
Johan Hedberg
187ec7012d Bluetooth: samples: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated
bt_hci_cmd_create().

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-06-23 12:44:53 -07:00
Anas Nashif
bd8597c9d7 x86: rename DEBUG_INFO to X86_DEBUG_INFO
This is an X86 specific option and should not appear as generic debug
option.

Fixes zephyrproject-rtos/zephyr#52929

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-06-20 14:43:42 -05:00
Emil Gydesen
117dca089a samples: Bluetooth: BAP: BA: Reset states and modify error checking
Modify the reset function to also reset the connection and
PA sync states.

Modify and add missing checks for mutex locks to use ASSERT
when using K_FOREVER, as they should never fail/timeout.

Cleanup some text and error checks.

Ensure that the add_src_param is reset for each loop
iteration as well.

Modify so that we use K_FOREVER fewer places.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-06-18 11:15:53 +01:00
Johan Stridkvist
df0db6a7a3 samples: Bluetooth: hci_ipc: __ASSERT on fail to deliver complete message
The hci_ipc sample does not support fragmentation of IPC-messages.
Give an ASSERT if only parts of an IPC-message is delivered.
This would happen for instance when the underlying transport mechanism
cannot hold the complete message.

Background:
The open-amp backend uses RPMSG_BUFFER_SIZE=512

Most applications and controllers use HCI-packets which are at most
255 bytes. In some cases a controller may deliver HCI-packets beyond
255 bytes.

This may for instance be the case if the controller delivers large ISO
SDUs as a single HCI-packet.

Signed-off-by: Johan Stridkvist <johan.stridkvist@nordicsemi.no>
2025-06-17 16:09:17 +02:00
Emil Gydesen
2ab5882e0b Bluetooth: CAP: Add cap_unicast_group API
Adds a new abstract struct for unicast group that is
specific for CAP. The difference between this and the BAP
unicast group, is that the parameters are CAP streams and
thus ensuring that the streams in the group adhere to the
additional requirements that CAP has on top of BAP.

This also adds foreach functions for both CAP and BAP
to allow users to iterate on the streams in the
abstract groups.

Various samples, modules and tests have been updated
to use the CAP struct and API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-06-17 08:20:25 +02:00
Vinayak Kariappa Chettimada
f1931bb813 samples: Bluetooth: bap_broadcast_sink: Fix logging invalid recv count
Fix logging of invalid recv count by incrementing them
before logging them.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-06-13 10:35:20 -04:00
Emil Gydesen
aa6ac8e650 Samples: Bluetooth: HR: Remove use of ISO config for IPC
When compiling with sysbuild and IPC the samples would use the
nrf5340_cpunet_iso-bt_ll_sw_split.conf config file, which was
incompatible with the sample's host configuration.

Instead of using the ISO configuration file, define a hci_ipc
overlay in each sample with the necessary configurations
that support all host configurations.

This commit also updates the sample.yaml files to split
configurations for single- and multicore builds, as what
needs to be configured for each type is different.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-06-11 10:19:05 -07:00
Axel Le Bourhis
b1ad7877f2 samples: bluetooth: enable PM standby on rd_rw612_bga and frdm_rw612
Enable the standby power state by default for the rd_rw612_bga and
frdm_rw612 boards in the peripheral_ht and central_ht Bluetooth samples.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
2025-06-10 13:36:56 +02:00
Lyle Zhu
14eba9d2d9 Samples: Bluetooth: HF: Move handsfree and handsfree_ag to './classic'
Move `handsfree` and `handsfree_ag` to sub-folder './classic'.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-06-10 12:25:46 +02:00
Jiawei Yang
dc20d44d69 Sample: bluetooth: Enable MIMXRT1170 EVKB for peripheral_ht
Enable MIMXRT1170 EVKB for peripheral_ht.

Signed-off-by: Jiawei Yang <jiawei.yang_1@nxp.com>
2025-05-29 06:31:20 +02:00
Nirav Agrawal
767772aad1 samples: bluetooth: fix adv_update error in bthome_sensor_template
- "bt_le_adv_update_data()" func calls just after bt_enable() call
 without completion of bt_ready() which is called as part of worker
 thread within init_work() causes issue where bluetooth controller
 has not been initialized and provides cb to app before app requests
 advertise_update to the stack.
- remove bt_ready() func and place content within main() post
 bt_enable() fixes this issue.

Signed-off-by: Nirav Agrawal <nirav.agrawal@nxp.com>
2025-05-27 10:29:28 +02:00
Jens Rehhoff Thomsen
9ac38c48fe Bluetooth samples: Improve multi subgroup support
For the BAP broadcast sink sample handling of requested BIS sync set
to BT_BAP_BIS_SYNC_NO_PREF for one or more subgroups is now added.
In case of no preference of requested BIS then sync is adjusted to the
number of streams available when no target allocation present.

Signed-off-by: Jens Rehhoff Thomsen <jthm@demant.com>
2025-05-21 12:33:28 +02:00
Pieter De Gendt
22cac4fdf6 boards: nxp: mimxrt1040_evk: Convert to Bluetooth M.2 shield
Use the shield nxp_m2_wifi_bt instead of defining on board nodes.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-05-12 19:19:53 +02:00
Vinayak Kariappa Chettimada
315ae48ceb Bluetooth: Controller: Use LOW_LAT_ULL implementation for ISO support
Use BT_CTLR_LOW_LAT_ULL implementation for enqueing ISO Rx.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-05-09 10:42:28 +02:00
Johan Hedberg
306faea69a Bluetooth: samples: Fix minimal configuration stack sizes
With recent changes to the host stack and crypto subsystem, the actual
usage of the system and long workqueues has changed.

Here's the measured usage when doing LE SC pairing on a Cortex M0 target:

BT LW WQ            : STACK: unused 360 usage 1040 / 1400 (74 %); CPU: 4 %
sysworkq            : STACK: unused 0 usage 1024 / 1024 (100 %); CPU: 0 %

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-05-08 14:01:00 +02:00
Gudipudi Ramana Kumar
44ed0c60ba samples: bluetooth: Increase number of buffers for avoiding deadlocks
The central_multilink sample issues various API calls
(in particular because it does some from the bt_workq("BT RX WQ"))
this results in a deadlock since there are not enough
HCI command buffers available, this is causing deadlocks on hardware
that do not support BT_HCI_ACL_FLOW_CONTROL.

Below is the flow where assert is observed:
bt_hci_le_enh_conn_complete() -> bt_conn_connected()
-> connected() callback -> start_scan() -> bt_le_scan_start()
-> set_random_address() -> bt_hci_cmd_send_sync: opcode 0x2005
-> Controller unresponsive, command opcode 0x2005 timeout with err -11

Since the start_scan is called from the callback and BT RX WQ thread,
the command buffers are still not available for the system work queue
to process the hci commands it has to send out for starting the scan.

By adding additional buffers this deadlock can be avoided.

Signed-off-by: Gudipudi Ramana Kumar <ragudipu@silabs.com>
2025-05-05 10:57:33 +02:00
Vinayak Kariappa Chettimada
30a634c47a Bluetooth: Controller: Interleaved extended advertising reception
Increase scan aux sets to support interleaved extended
advertising reception in hci_ipc ISO support configuration
in nRF5340 HCI ISO Controller.

CONFIG_BT_MAX_CONN is reduced accordingly as ticker node
instances are shared across all state/role scheduling in the
Controller implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-05-02 15:20:30 +02:00
Mark Wang
bc47bce39b bluetooth: handsfree: improve the cod print string
cod is three bytes, print it as 6 hex values.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-04-30 13:59:58 +02:00
Marek Matej
780bafab6a tests, samples: update esp32_devkitc board records
Update the tests using the esp32_devkitc_xxx entries.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2025-04-29 16:48:55 +02:00
Johan Hedberg
f85d63a6cc Bluetooth: Remove USB H4 mode support
This non-standard feature never had any proper host side implementation
(e.g. it was never upstreamed to BlueZ), and since it comes with notable
maintenance overhead it's fair to just remove it.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-04-29 13:00:33 +02:00
Johan Hedberg
26d97164be Bluetooth: HCI: Use H:4 encoding for buffers
Encode the packet type as a H:4 payload prefix for buffers passing to &
from HCI drivers. The existing bt_buf_set/get_type functions are
deprecated, but kept compatible with the change, except that they can only
be called once, since they modify the buffer payload.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-04-29 13:00:33 +02:00
Sayooj K Karun
bf104d42cb bluetooth: mtu_update: peripheral: Add NULL check
Add NULL check for connection context, and only send the
notification if connection is established.

Signed-off-by: Sayooj K Karun <sayooj@atmosic.com>
2025-04-24 11:57:43 +02:00
Greg Leach
23338e5708 samples: Add BL54L15/L15u DVK support
Adds support for the BL54L15 and BL54L15u DVK boards.

Signed-off-by: Greg Leach <greg.leach@ezurio.com>
2025-04-23 15:02:20 +02:00
Emil Gydesen
e02bd58049 samples: Bluetooth: BAP: Unicast Server: Fix bad valid check
The valid check was incorrect and instead set valid_data to
false for valid data, and true for invalid data.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-04-11 16:18:23 +02:00
Manojkumar Konisetty
aa690fad3f doc: samples: Update bluetooth/central README
Add relevant details to README file of samples/bluetooth/central

Signed-off-by: Manojkumar Konisetty <manoj@aerlync.com>
2025-04-11 10:54:17 +02:00
Lyle Zhu
3f7224a926 Bluetooth: Classic: HFP_AG: Update the callback sco_disconnected()
Change the arguments of HFP AG callback `sco_disconnected()` to SCO
conn and disconnection reason.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-09 08:06:04 +02:00
Emil Gydesen
7f379fb963 samples: Bluetooth: BAP: Broadcast sink use new USB stack
Refactor the USB of the BAP broadcast sink to use the new
USB stack.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-04-08 17:36:34 +02:00
Vinayak Kariappa Chettimada
d8cd8ddc51 samples: Bluetooth: bap_broadcast_source nRF5340 audio dk + nRF21540 FEM
Added overlay file to support nRF5340 audio dk + nRF21540
FEM.

Build the hci_ipc with corresponding overlay file to use the
nRF21540 FEM with the bap_broadcast_source sample on nRF5340
audio kit.

Use the below commandline:
$ west build -b nrf5340_audio_dk/nrf5340/cpuapp --sysbuild \
  samples/bluetooth/bap_broadcast_source \
  -DDTC_OVERLAY_FILE= \
  boards/nrf5340_audio_dk_nrf5340_cpuapp_nrf21540_ek.overlay \
  -Dhci_ipc_DTC_OVERLAY_FILE= \
  boards/nrf5340_audio_dk_nrf5340_cpunet_nrf21540_ek.overlay

Related to commit 35ad653038 ("samples: Bluetooth:
hci_uart/hci_ipc: CI coverage for nRF53+nRF21 FEM").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-04-07 11:23:11 +02:00
Matthias Hauser
941a5489d3 dts: boards: we: add board Ophelia-IV
add new board Ophelia-IV

Signed-off-by: Matthias Hauser <matthias.hauser@we-online.de>
2025-04-03 13:16:05 +02:00
Lyle Zhu
c09cf23844 Bluetooth: HFP_AG: Add ACL conn to the connected callback
If the AG works as Data Channel Acceptor, the ACL conn cannot be known
by the application of AG. Similar with HF, add ACL conn as the first
parameter to the `connected` callback of AG.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
68d2526130 Sample: Bluetooth: HFP_HF: Update the sample
Due to the interface of HF is updated, update HF sample accordingly.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Lyle Zhu
fcedda6a00 Sample: Bluetooth: HFP_AG: Update the sample
Due to the interface of AG is updated, update AG sample accordingly.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-03 06:24:32 +02:00
Ryan Chu
9ba60d3eb7 bluetooth: host: Apply callback changes of CS complete events
The CS complete callbacks provide both status and params.
In the case of errors, NULL pointer is passed to the params of callbacks.

Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
2025-04-01 16:26:58 +02:00
Sean Kyer
93c1c7d066 Samples: Bluetooth: Extend DIS sample
- Extended the DIS sample to showcase all possible
  fields using placeholder values.
- UDI issuer strings use a 'private' ODI which is
   unregistered.

Signed-off-by: Sean Kyer <Sean.Kyer@analog.com>
2025-03-31 19:50:12 -04:00
Benjamin Cabé
776c0cab9a doc: boards: nordic: Adopt zephyr:board directives
Migrate all Nordic boards to leverage the full extent of zephyr:board
directives.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-03-31 22:00:02 +02:00
Emil Gydesen
4fe81ec398 samples: Bluetooth: Replace OVERLAY_CONFIG with EXTRA_CONF_FILE
OVERLAY_CONFIG has been deprecated and replaced by
EXTRA_CONF_FILE. Update samples to reflect that.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-26 16:20:36 +01:00
Emil Gydesen
065dca7e92 Bluetooth: ISO: Make setting ISO data explicit
The stack will no longer implicitly set the data path
for ISO channel, and the responsibility for doing that is
now for the upper layers/applications.

This provides additional flexibility for the higher layers
as they can better control the values and timing of the data
path, as well as support removing and even reconfiguring the
data path at will.
This also removes some complexity from the stack.

This commit also fixed a inconsistency in the disconnected
handler. CIS for centrals as well as BIS were still valid
bt_iso_chan channels in the disconnected callback,
but CIS for peripherals were completely cleaned up at this
point. This issue is fixed by moving the disconnected callback
handling to before the code to cleanup the channel for
peripherals.

Since there is a difference in how you remove data paths
depending on the GAP role (central/peripheral), the
iso_info struct type has been expanded to be more
concise of which type of CIS it is.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-19 10:56:57 +01:00
Emil Gydesen
fb68b4be7e Revert "Bluetooth: Audio: Use generic count_bits to count bits"
This reverts commit ee335399c1.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-18 16:39:47 +01:00