PatchRAM records store the HCI opcode as a little-endian value in the
firmware image. Read it with sys_get_le16() instead of casting the byte
pointer to uint16_t, which can fault on targets that do not allow
unaligned accesses.
Signed-off-by: Matthias Ringwald <matthias@ringwald.ch>
Extend the shared BFLB HCI driver with BL60x (BL602) support: BL60x
include paths, controller init macros, IRQ setup, and platform shim
forward declarations.
Kconfig adds BT_BFLB_BL60X with two controller variant choices
(m1s1, m8s1) and smart defaults based on enabled BT roles.
Signed-off-by: William Markezana <william.markezana@gmail.com>
Introduces K_MEM_SLAB_DEFINE_TYPE() and K_MEM_SLAB_DEFINE_STATIC_TYPE()
helpers to allow the user to declare slabs for types without having to
manually ensure the alignment is correct.
Manual slab alignment was very error-prone and this change fixes several
instances of misalignment that would be trapped by the undefined
behavior sanitizer when running on 64-bit targets.
Signed-off-by: Egill Sigurdur <egill@egill.xyz>
Extend the shared BFLB HCI driver with BL61x (BL616/BL618) support:
BL61x include paths and RF init routing through bflb_rf_init().
Kconfig adds BT_BFLB_BL61X with four controller variant choices, a
configurable PHY/RF retention memory size, and a 64 KB exchange memory
option for the BR/EDR variant.
Signed-off-by: William Markezana <william.markezana@gmail.com>
Implements a method for discarding fragmented extended advertising. In
order to acheive this, we need to consider past and future fragments
of the advertising report we discard.
The future fragments are on its way from the controller, and will result
in either a complete- or incomplete event. These are handled by tracking
the adv SID and address until the controller sends either a complete or
incomplete event. Once an advertising report is marked as discarded,
consecutive fragments will be silently discarded.
The past fragments are either already in the reassembler (in scan.c),
or on their way through the rx_queue. To handle these, and allow the
reassembler to recover from a in-progress reassembly which is discarded,
we add a work item which is rescheduled when each consecutive fragment
is received. The timeout is configurable through the new Kconfig option
`CONFIG_BT_EXT_ADV_REASSEMBLY_TIMEOUT`. On timeout, the reassembler will
change its state to discard incoming fragments from the same advertiser.
The reassembler will start assembling new fragments if it recognises a
new advertiser, or if a final fragment (either marked as complete
or incomplete) from the advertiser it is currently tracking is received.
This functionality needs to be added at a HCI driver level by using the
new `hci_ext_adv_report_process` function. It is added the the
IPC HCI driver to fixzephyrproject-rtos/zephyr#50786
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Add new inline function entropy_get_default_device which returns
the "zephyr,entropy" device or the architectural entropy device,
if the former is not set, and use that in all places to query the
entropy device.
This allows using architectural drivers which do not have a DT
node.
Signed-off-by: Christoph Busold <cbusold@qti.qualcomm.com>
-Add inband independent reset support for IW612, IW416 and IW610
-Add kconfig option to enable/disable IR support
Signed-off-by: Vinit Mehta <vinit.mehta@nxp.com>
Replace the placeholder help text for BT_STM32_IPM with a short
description of the driver. This makes the option clearer in Kconfig
interfaces and avoids leaving a visible TODO in user-facing text.
Signed-off-by: Manaam Rehan <manaamrehan2k19@gmail.com>
Calculate the future time correctly to avoid negative value for "value_ms".
Register the pm_policy_event when HAL_RADIO_TIMER_SetRadioTimerValue
returns success.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Since bt_hci_evt_hdr is a variable sized struct, it shall be
located at the end of the struct.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Merge the separate BL70X and BL70XL HCI drivers (hci_bflb_bl70x.c,
hci_bflb_bl70xl.c) into a single hci_bflb.c. Both SoCs share the
same on-chip HCI interface; platform differences (controller API
names, includes, RF calibration) are resolved via macros in a
single #if/#elif block at the top of the file.
Add BL70XL Kconfig (silicon revision, BLE variant selection) and
update depends lines to use the unified DT_HAS_BFLB_BT_HCI_ENABLED
combined with the SoC series.
Signed-off-by: William Markezana <william.markezana@gmail.com>
Fix two issues in the NXP HCI firmware upload code:
1. In fw_upload_wait_length(), the length complement was incorrectly
read from the same buffer offset as the length field. It should be
read from offset 2 to properly validate the length field.
2. In fw_upload_write_hdr_and_payload(), replace the call to
fw_upload_send_ack() with a direct call to fw_upload_write_data()
to send the V1_REQUEST_ACK. This ensures the ACK is sent using the
correct write function.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within:
- `drivers/adc`
- `drivers/audio`
- `drivers/bluetooth`
- `drivers/can`
- `drivers/charger`
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
- replace legacy Kconfigs with corresponding PSA_WANT ones.
- extend Mbed TLS' CMake file in order to include these legacy ecdh module
that was removed from TF-PSA-Crypto when ESP32 BT and WiFi drivers are
built.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Add an HCI driver for the BL702 on-chip BLE controller. The controller
is a precompiled binary blob communicating via vendor on-chip HCI
functions (bt_onchiphci_send/bt_onchiphci_interface_init).
The driver:
- Translates between Zephyr HCI net_buf and the vendor's internal
packet structures for both TX (commands, ACL data) and RX (events,
ACL data)
- Uses a dedicated RX thread with FIFO+semaphore to dequeue messages
from the controller callback (which may run in ISR context)
- Reads the BLE MAC address from eFuse during initialization
- Supports multiple controller binary variants via Kconfig choice
(peripheral-only, multi-role, observer, etc.)
- Provides proper open/close lifecycle with RX queue draining
Also adds the DT binding (bflb,bl70x-bt-hci) and a bt-hci node in
the BL70X SoC dtsi (disabled by default).
Signed-off-by: William Markezana <william.markezana@gmail.com>
# Conflicts:
# drivers/bluetooth/hci/CMakeLists.txt
Ble host and link layer threads initialization is no more done
during the system initialization.
Add stm32wba_ble_ctlr_thread_init() and
stm32wba_ll_ctlr_thread_init() functions calls
during ble and ieee802.15.4 driver initialization
Signed-off-by: Vincent Tardy <vincent.tardy@st.com>
With stm32wba_set_stack_options function call set
the BLE stack Options flags initialization according
to the zephyr Kconfig options.
Signed-off-by: Eric Mechin <eric.mechin@st.com>
Introduces common Kconfig configurations for the CYW55513 connectivity
module, supporting both Murata 2FY and discrete implementations.
Additionally, updates the HCI driver to include a new vendor-specific
command required for updating the SCO route to PCM
Signed-off-by: Merin George <merin.george@infineon.com>
In the bt_hci_stm32wba_send() function, in case of the function
bt_buf_get_evt() fails, call k_sem_give() before return.
Signed-off-by: Vincent Tardy <vincent.tardy@st.com>
If the clock device (i.e., RCC) failed to initialize, we have bigger
problems than trying to call clock_control_{off,on,configure} on it.
Don't bother checking to save some footprint.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Update the stm32wbax ble hci driver to integrate the new SoC-level
radio power management hook.
Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
This change renames the Infineon BT-HCI UART driver source
and binding file to allow reuse across all Infineon AIROC
connectivity chips that use HCI UART transport.
No functional changes
Signed-off-by: Merin George <merin.george@infineon.com>
This commit moves NXP Bluetooth HCI calibration data handling from the
HAL to Zephyr hci_nxp driver.
Added Kconfig choice to select antenna diversity.
Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
In current implementation, the sending buffer size is 0x10000. This
will result in a very small amount of RAM available for the
application. Actually, the maximum required sending buffer size is
4KB.
Reduce the maximum sending buffer size by changing
`SEND_BUFFER_MAX_LENGTH` from 64KB to 4KB.
And add runtime assertions to prevent buffer overflows during firmware
upload.
- Change SEND_BUFFER_MAX_LENGTH from 0xFFFF to 4096 (4 KB)
* Reflects the actual maximum FW chunk size supported by hardware
* Reduces memory footprint from 64 KB to 4 KB
- Remove unnecessary +1 from send_buffer array size
- Add __ASSERT checks in fw_upload_v1_send_data() to validate
memcpy does not exceed buffer size
- Add __ASSERT checks in fw_upload_v3_send_data() to validate
memcpy does not exceed buffer size
This prevents potential buffer overflows when copying firmware data
and ensures the buffer size matches hardware capabilities.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Enable low power mode support in the bluetooth HCI driver for
cyw20829 so that the controller can enter sleep states when idle
Signed-off-by: Merin George <merin.george@infineon.com>
This option already depends on BT_PER_ADV_RSP being enabled, so we should
have a more reasonable default for it. This way e.g. the existing PAwR
sample app should work without additional changes.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Remove local Tx buffer allocated in the
bt_hci_stm32wba_send() function.
Get Event buffer resource to store data returned
by lower layer and provide it to Host in case of
Tx packet is an HCI Command type.
Signed-off-by: Vincent Tardy <vincent.tardy@st.com>
There's a standardized way to set a public Bluetooth address in the
core, and this hardware has a vendor specific command to do just that.
Tell the core we support the operation and implement the command. This
allows applications to set a MAC by calling bt_id_create() prior to
bt_enable().
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
If the vendor driver knows how to set a public MAC, it can select
CONFIG_BT_HCI_SET_PUBLIC_ADDR and set the address in this argument,
allowing applications to set a public address with bt_id_create().
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Enable HCI_NXP_SET_CAL_DATA and HCI_NXP_SET_CAL_DATA_ANNEX100 by
default for NW612 and IW416 modules to ensure proper calibration
during HCI initialization.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Set extended advertising setting in ipm_stm32wb.c with
stm32wb_set_stack_options function call for the BLE stack
Options flags initialization according to the
zephyr Kconfig options.
Signed-off-by: Eric Mechin <eric.mechin@st.com>
Implement VS HCI commands for ESP32 BLE controllers:
- Read/Write TX power level with per-handle support
- Read version info (platform, variant, firmware version)
- Read supported commands and features
- Read static addresses from eFuse (C2/C6/H2)
- Read build info (controller version string)
For original ESP32, use the legacy esp_ble_tx_power_set/get API.
For newer variants (ESP32-S3, ESP32-C2, ESP32-C3, ESP32-C6, ESP32-H2),
use the enhanced API that supports per-connection power control.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Add new KConfig BT_STM32WBA_LIB_CONFIG specifying the configuration
of the stm32wba ble library (full or basic) depending to bluetooth
features.
Signed-off-by: Vincent Tardy <vincent.tardy@st.com>
Select BT_CTLR_PHY_CODED_SUPPORT for ESP32 variants that support
Bluetooth 5.0 coded PHY (long range). The original ESP32 series
is excluded as it only supports Bluetooth 4.2.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>