Set the NWP power profile at boot, rather than postponing it until
Bluetooth is enabled. The workaround to postpone it is no longer
needed, as recent NWP firmware versions support setting power
profile prior to configuring Bluetooth TX power.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Adapt Series 2 HCI driver to changes in SiSDK v2026.6.0. The
functions to send and receive events have been renamed, and
the buffer memory is configured in a different way.
The radio also requires PHY configuration files to be separately
compiled, they are no longer built in to the library.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Add the HCI driver that carries Bluetooth traffic over the
esp-hosted-mcu transport core, so Wi-Fi and Bluetooth share the
single link to the coprocessor. The driver asks the coprocessor
to initialise and enable its controller, then acts as a raw H4
bridge.
Received frames are copied into a slab slot on the shared receive
thread and rebuilt on a dedicated delivery thread, so waiting on
a host buffer pool cannot stall the Wi-Fi path. The framed
transport adds call depth on the tx processor thread, which runs
the driver send path, so its stack default is raised.
The coprocessor firmware advertises the controller to host flow
control commands but rejects them, so the binding sets the
no-flow-control quirk by default.
Extended advertising is left to the application. The coprocessor
is a separate part whose Bluetooth generation is not known when
the host is built: an esp32 provides Bluetooth 4.2 and has none,
while the riscv parts provide 5.0. Keep the legacy advertising
commands available so either generation works.
Assisted-by: Claude:opus-4-8
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
The BT_HCI_RAW_H4 and BT_HCI_RAW_H4_ENABLE Kconfig options lost their
last code references in commit 26d97164be ("Bluetooth: HCI: Use H:4
encoding for buffers"), which made the HCI raw layer use H:4 packet
encoding for all buffers unconditionally. Since then setting these
options has had no effect.
Remove the option definitions, the stale references in the sample
configurations, as well as a dead conditional default in the
BT_DRV_RX_STACK_SIZE option. Document the removal in the release
notes; since the options have been no-ops for several releases and
were never part of a deprecation cycle, there is no migration to
describe beyond dropping them.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Move the BT_RX_STACK_SIZE default out of the HCI driver Kconfig
and into the common Espressif defconfig, next to the other
Bluetooth subsystem defaults.
The BT_ESP32 block is now shared by both architectures instead of
being duplicated under RISCV and XTENSA, so the stack default also
applies to the Xtensa targets.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Run-time FW version check can be performed in the
stm32wb HCI driver, when initializing the Bluetooth IPM.
The wireless firmware information can be retrieved
(using the SHCI_GetWirelessFwInfo()) and verified
if it match or not.
Added FUS version.
Signed-off-by: Eric Mechin <eric.mechin@st.com>
Get interrupt configuration from the devicetree. The interrupts NVIC IDs
must match the value expected (defined) in the HAL. Interrupts priority
is also set from the 0 instead of being hard coded to 0.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Add support for selecting HSE/1024 as the STM32WB RF wakeup (low speed)
clock source, as an alternative to LSE, for boards without a 32.768 kHz
LSE crystal.
The source is selected through the existing clock-cell mechanism on the
ble_rf devicetree node (e.g. <&rcc (STM32_SRC_HSE | STM32_CLOCK_DIV(1024))
RFWKP_SEL(3)>), so no new devicetree property and no clock-control driver
change are needed. The ipm_stm32wb driver reads the configured source from
that clock cell and, for HSE/1024, sets the HSE/1024 SHCI low speed clock
bit on top of the CFG_BLE_LS_SOURCE value from app_conf.h. The Cube
app_conf.h is not modified, so no companion hal_stm32 change is required.
Note: switching the RF wakeup clock source is a CPU2 clock change and
requires a power-on reset to take effect.
Signed-off-by: Lubos Koudelka <lubos.koudelka@st.com>
The ACI_HAL_STACK_RESET command is replaced by ACI_RESET command.
Update comment.
Added endianness management for 32 bits options parameter.
Remove misaligning.
Signed-off-by: Eric Mechin <eric.mechin@st.com>
This macro eliminates manual size/alignment management and prevents
namespace collisions by moving internal queues to file-private scope.
Signed-off-by: Cesar Vandevelde <cesar.vandevelde@gmail.com>
-Add option to have IR using vendor command without PDN toggle
to over come resetting of a non BT CPU in case of COEX scenarios
Signed-off-by: Vinit Mehta <vinit.mehta@nxp.com>
The BLE receive thread runs the connect-time settings store
(CCC, keys, GATT database hash), which on Espressif SoCs goes
through the flash driver and PSA crypto and overflows the 1200
byte host default. Raise BT_RX_STACK_SIZE to 2048 when
BT_SETTINGS is enabled.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
There is no 'config UART' base definition in the tree; the only
definition was an accidental bare declaration in the
cy8cproto_062_4343w board Kconfig.defconfig, so every
'select UART' resolved against a phantom bool that gates nothing.
- bluetooth: hci: BT_AIROC: drop the select. BT_H4 already selects
BT_UART, which selects SERIAL and UART_INTERRUPT_DRIVEN, so the
H4 transport is fully covered.
- sensor: explorir_m, fcx_mldx5, s3km1110: drop the select. These
drivers already have 'depends on UART_INTERRUPT_DRIVEN', which
requires SERIAL; replacing the select with 'select SERIAL' would
create a Kconfig dependency loop through UART_INTERRUPT_DRIVEN.
- input: ch9350l: drop the select for the same reason (it depends
on SERIAL_SUPPORT_INTERRUPT and selects UART_INTERRUPT_DRIVEN).
- stepper: adi_tmc: STEPPER_ADI_TMC_UART: replace with
'select SERIAL', matching the sibling STEPPER_ADI_TMCM_RS485
symbol, so enabling the UART bus variant actually enables the
serial drivers.
Found by a full-tree Kconfig audit cross-referencing every defined
symbol against its uses.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add PM support for HCI ESP32 driver. Update sleep retention
config for BLE power management.
Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
Fix few:
wuc_nxp_wuu.c:231:14: warning: duplicate 'const' declaration specifier
[-Wduplicate-decl-specifier]
warnings, DEVICE_API already includes the const qualifier. Only exposed
when compiling with COMPILER_SAVE_TEMPS=y for some reason.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
In Wi-Fi + BT coex scenario on NXP hosted wireless SoCs (IW612/IW416/
IW610), once Wi-Fi CPU loads valid firmware, it puts BT CPU into sleep
via Boot-Sleep-Patch (BSP). The BT bootloader stops sending HDR
signature bytes, blocking BT firmware download.
Add BSP wakeup detection and trigger mechanism:
- Introduce fw_upload_read_data_tmo() to support custom timeout for
UART read, refactoring fw_upload_read_data() as a wrapper.
- Add fw_upload_wake_bt_from_bootsleep() which polls for HDR signature
bytes with a configurable interval. Absence of signature within the
polling window indicates BT CPU has entered BSP sleep.
- Send an RTS low pulse to wake BT CPU before FW download begins.
New Kconfig options:
- BT_NXP_CTRL_BSP_TRIGGER: enable/disable BSP wakeup feature
- BT_NXP_CTRL_HDR_SIG_INTERVAL: single poll timeout (default 505ms)
- BT_NXP_CTRL_BSP_WAIT_TIMEOUT: max total wait time (default 10s)
- BT_NXP_CTRL_BSP_RTS_PULSE_MS: RTS pulse duration (default 10ms)
Signed-off-by: Nirav Agrawal <nirav.agrawal@nxp.com>
Signed-off-by: Gang Li <gang.li_1@nxp.com>
When processing LE Extended Advertising Report events in
is_hci_event_discardable(), the evt_type field of adv_info[0] may
reside at an unaligned address. This occurs because evt_data can
point to shared memory (e.g., IMU buffer) at an odd address, and
the evt_type (uint16_t) ends up at an odd offset after the packed
struct layout.
On Cortex-M33 with UNALIGN_TRP enabled, this causes a HardFault.
Use sys_le16_to_cpu() to read the evt_type field, which ensures
the compiler generates byte-level access (LDRB) for the packed
struct member, avoiding the unaligned LDRH instruction.
Signed-off-by: Gang Li <gang.li_1@nxp.com>
Extend bflb_rf_init() to support WiFi mode (WL_API_MODE_ALL) with
TX power targets and country code configuration when CONFIG_BFLB_WIFI
is enabled.
Add WiFi platform glue: MAC ISR wiring, task creation, low-power
stubs, wl80211 RTOS primitives (heap, RNG, timers), and the linker
section for WiFi shared RAM.
Introduce CONFIG_BFLB_BL61X_WL_RMEM_SIZE for PHY/RF retention memory
sizing.
Signed-off-by: William Markezana <william.markezana@gmail.com>
Add STM32WBAx suspend-to-RAM support and hook the SoC-specific
implementation into the build when CONFIG_PM_S2RAM is enabled.
Select the custom S2RAM marking capability and add the STM32WBAx S2RAM
support source file.
Update the suspend-to-RAM path to clear the hardware standby flag as early
as possible after resume. Use standby_entered as a software indicator to
track whether standby was effectively entered and cleared, so resume
handling only restores radio state when needed.
Signed-off-by: Romain Jayles <romain.jayles@st.com>
Mesh uses legacy packets with extended advertiser.
Dropping of ext adv events is normal behavior.
However, mesh samples ara spammed these error messages
on some platforms.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Add error logging on the device-not-ready, HCI_RESET and firmware
download failure paths, and include the image size in the firmware
download debug message, to make bring-up failures easier to diagnose.
Assisted-by: Copilot:claude-opus-4.8
Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
Default overrides in Kconfig can makeuse of configdefault instead of
config to preserve the dependency checks.
Signed-off-by: Josuah Demangeon <me@josuah.net>
Make sure to have enough even packets for every ACL TX packets we want to
respond. Declare (BT_EVT_RX_COUNT) as (BT_ACL_TX_COUNT + 1).
Signed-off-by: Josuah Demangeon <me@josuah.net>
Add new KConfig BT_STM32WBA_BASIC_PLUS_LIB specifying the
configuration of the stm32wba ble library for bluetooth
basic plus features.
Signed-off-by: Vincent Tardy <vincent.tardy@st.com>
Each BLE controller blob variant reports a fixed number of ACL TX
packets in the HCI LE Read Buffer Size response (extracted from the
binaries): 2 to 16 for BL70x, 2 or 8 for BL60x, 2 to 8 for BL70xL and
4 or 10 for BL61x. Set the BT_BUF_ACL_TX_COUNT default per selected
variant so the host allocates exactly as many bt_conn_tx contexts as
the controller has buffers, silencing the hci_core mismatch warning
and using the controller queue fully.
Signed-off-by: William Markezana <william.markezana@gmail.com>
The bt_hci_driver_api send() contract requires that the buffer
reference is only consumed (unreffed) on success. On error, the
caller retains ownership and is responsible for unreffing the buffer.
bt_bflb_send() was unconditionally calling net_buf_unref() at a
goto done label, incorrectly consuming the buffer on all error paths.
Fix by returning early on each error path (without unreffing), and
unreffing only on the success path.
Assisted-by: GitHub Copilot:claude-sonnet-4.6
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
The bt_hci_driver_api send() contract requires that the buffer
reference is only consumed (unreffed) on success. On error, the
caller retains ownership and is responsible for unreffing the buffer.
bt_hci_bee_send() was unconditionally calling net_buf_unref() at a
goto done label, incorrectly consuming the buffer on error paths too.
Additionally, buf->len was accessed after the unref, constituting a
use-after-free.
Fix by returning early on each error path (without unreffing), and
unreffing only on the success path.
Assisted-by: GitHub Copilot:claude-sonnet-4.6
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Add HCI driver for Realtek Ameba BT controller. The driver bridges
the Realtek HAL HCI transport to the Zephyr BT HCI driver API.
Signed-off-by: minyuan xue <minyuan_xue@realsil.com.cn>
Replace the two-line pattern:
net_buf_unref(buf);
buf = NULL;
with net_buf_drop(&buf) which performs both operations
atomically in a single step. Since net_buf_drop() also handles NULL
pointers checks for those before the call can be removed.
Assisted-by: GitHub Copilot:claude-sonnet-4.6
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
This code snippet was originally removed by #109163 but then incorrectly
re-introduced by #107850 (most likely due to a rebasing error).
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
WiseConnect zeros the BT half of its cached coex performance profile
on every Wi-Fi disconnect, leaving BT out of power save and preventing
the NWP from sleeping after re-association.
Delegate Wi-Fi power-save to siwx91x_nwp_apply_power_profile(), which
already owns both BT and Wi-Fi halves of the coex profile. Extend the
helper to accept an optional sl_wifi_performance_profile_v2_t override
so the Wi-Fi driver can pass its tailored profile (listen_interval,
dtim_aligned_type, monitor_interval); BT-only and init call sites pass
NULL to keep their current behaviour.
Signed-off-by: Tejus Subramanya <ters@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>
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>
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>
When there are multiple zephyr,bt-hci-uart nodes, we currently use the
reset-assert-duration-ms property from the first one for all of them due
to a typo in the initializer macro. Fix it.
Fixes: 9f44b011de ("bluetooth: hci: h4: optional reset pin")
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Replace manual pointer transfer with net_buf_take() for better
readability and atomic operation.
Signed-off-by: Dharun krithik k <dharunkrithik@aerlync.com>
Provide the necessary changes for the ST HCI SPI Bluetooth driver
to support X-NUCLEO-WBA25A1 shield.
Update ST BLE shields' overlays with the new properties.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Route the ESP32_BT_* defaults through the generic BT_CTLR_* symbols
so a standard BT_CTLR_* toggle reaches the vendor knobs without
further user intervention. Select the matching BT_CTLR_*_SUPPORT
capabilities from BT_ESP32, and add Kconfig entries for the BLE 5.x
feature gates, controller power placement and light-sleep XTAL.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Defining a Kconfig symbol several times is dangerous. It is better to use
configdefault for the CMSIS related symbols.
Bluetooth configdefault depends on NWP driver. It is more accurate to
depend on the Si91x Bluetooth driver.
Finally, configdefault is supposed to be only used in Kconfig.defconfig
files. So, relocate BT_HCI_ACL_FLOW_CONTROL.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
This commit fixes the command packet size allocation. It allocates an
'hci_cmd_buf' buffer to store the HCI command packet to send. The buffer
size supports the maximum command packet size and the maximum event size.
This commit also fixes an issue where the buf argument was not unreferenced
when bt_buf_get_evt() failed in the BT_HCI_H4_CMD command case.
Signed-off-by: Vincent Tardy <vincent.tardy@st.com>
Having an interface library named "mbedTLS" and the real library named
"mbedtls" (as provided by the Mbed TLS module) is misleading.
This commit replaces:
- mbedTLS -> mbedtls_iface for the CMake library. "mbedTLS" is still
available as alias to "mbedtls_iface" for backward
compatibility, but this should be removed in the future.
- mbedTLS -> Mbed TLS in comments and documentation.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>