Move the RAIL interrupts installer from the Bluetooth HCI driver
to the SoC layer so that it can be used by other subsystems
as well.
Signed-off-by: David Boullie <David.Boullie@silabs.com>
This makes userchan transport behavior similar to other HCI
transports (eg IPC). Improved logging gives clear overview
of what RX events are discarded helping for configuration
tuning.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Add PM support to the STM32WB0x Bluetooth HCI driver.
Implement PM event register to wake up the device for its BLE events.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
Use radio timer as the system timer when Bluetooth is used.
Modify CMakeLists.txt to compile radio timer driver when
STM32WB0_RADIO_TIMER is enabled.
Remove the common parts from hci_stm32wb0.c that are present
in the radio timer driver.
Set and retrieve the appropriate value for SYS_CLOCK_TICKS_PER_SEC and
SYS_CLOCK_HW_CYCLES_PER_SEC respectively.
Define radio_timer node and its properties.
Enable radio_timer node in nucleo_wb0x boards.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
This mimics IPC transport behavior where BR/EDR Inquiry events as
well as LE Extended Advertising Report (carring legacy PDU) are
considered discardable.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Reworking pm implementation in stm32wba ble hci driver.
Enabling "no-reset" quirk for stm32wba ble hci driver to
maintain specific configuration required for pm.
Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
Determine event discardability after parsing the HCI header and require
at least one byte before reading the LE subevent. This removes a possible
OOB read on malformed/short LE Meta events. Also mark LE Extended
Advertising Report as discardable, matching legacy Advertising Report to
reduce RX pool pressure during heavy scanning.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
The TX flow control semaphore was initialized with a count of 1 and
released again after every bt_esp32_send() call. This broke the VHCI
flow control contract and could allow sending more packets than the
controller advertised.
This prevents host/controller overruns and ensures proper synchronization
with the ESP32 VHCI interface.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
This change alignes HCI drivers behavior with Host expectation. That is:
if an HCI driver managed to send a packet to Controller, the HCI driver
also unreferences it. If the HCI driver didn't manage to send the
packet to Controller and returns an error code, it does not unreferences
buffer.
This change aligns the behavior of HCI drivers with the Host's
expectations. Specifically:
- If an HCI driver successfully sends a packet to the Controller, the
HCI driver also unreferences it.
- If the HCI driver fails to send the packet to the Controller and
returns an error code, it does not unreference the buffer.
Fixes#94445
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Implements HCI close support for the silabs efr32 HCI driver.
Calling `bt_disable()` now works as expected, which is particularly
important for multiprotocol applications.
Signed-off-by: James Smith <james@loopj.com>
The CRC32 table only needs to be generated once, so prevent it from
regenerating every time as it only required once.
Signed-off-by: Bas van Loon <bas@arch-embedded.com>
Make the common SPI CS delay property configurable from devicetree. This
can be required for using a nRF54L as a Bluetooth controller, since it
has an additional delay after waking up from the CS assertion until it
is ready to accept and transmit data (see OPS t_START_HFINT).
Signed-off-by: Jordan Yates <jordan@embeint.com>
It is not possible to build anymore in that mode, so we do not
need to support it in this driver cmake files.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Previously we always had driver to support 2M PHY regardless of
configuration. As this was fixed the missing support statemenent
caused 2M support to miss regardless of configuration.
Signed-off-by: Petri Pitkanen <petri.pitkanen@silabs.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in `Kconfig` files within the `drivers` directory.
Additionally, incorporates a fix recommended by the reviewer.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This patch allows to link the request of the linklayer for a
temperature calibration to the temperature driver.
The linklayer will then adapt and trigger its calibration related to
the current temperature.
Signed-off-by: Romain Jayles <romain.jayles@st.com>
Adds a Kconfig for the STM32WBA associated BT configuration
The first configuration added is the possibility to activate the
calibration of the radio using the temperature
Signed-off-by: Romain Jayles <romain.jayles@st.com>
In some cases UART drivers might have too high init priorities
so HCI must be initialized even later if used with those.
One example is zephyr,native-tty-uart.
Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
Fix radio IRQ priorities. With the Controller update from SiSDK,
its behavior changed so that it overwrites the IRQ priorities.
Reconfigure the priorities after the Controller is initialized.
Source interrupt numbers and priorities from devicetree.
Also set the SYNTH IRQ priority on all HW, and set either the
RDMAILBOX or HOSTMAILBOX IRQ depending on which one exists.
Signed-off-by: Jori Rintahaka <jori.rintahaka@silabs.com>
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Refactor the controller init to use the new init routines the
controller now provides. Instead of using a hardcoded set of
features, the features are now initialized based on Kconfig
values that the application selects.
Add config files under modules/hal_silabs, used by the controller
init routines in the external module hal_silabs to determine which
features to enable based on Kconfig options. This brings the
controller feature configurability to roughly parity with the
Simplicity SDK.
Signed-off-by: Jori Rintahaka <jori.rintahaka@silabs.com>
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
- Add support for default Annex-55 Bluetooth calibration data load
for both IW612 and IW416 SoC.
- Add support for default Annex-100 Bluetooth calibration data load
for both IW612 and IW416 SoC.
Signed-off-by: Nirav Agrawal <nirav.agrawal@nxp.com>
Call entropy APIs to use TRNG peripheral on STM32WB0x devices for BLE
purposes.
Enable RNG node on Nucleo-WB0x boards.
Remove RNG initialization as it's done in the entropy driver.
Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
The CYW43xxx for Infineon Controllers stops after the first LauncRAM
command. Newer Controllers like the CYW5557x update the firmware in
multiple stages, which is supported by this commit.
Signed-off-by: Matthias Ringwald <matthias@ringwald.ch>
Newer AIROC controllers like the CYW55573 don't support changing the
baudrate in Download Mode. However, a higher baud rate can be used
directly to sent HCI Reset.
This commit adds the KConfig flag CONFIG_AIROC_DOWNLOAD_MODE to enable
the new behaviour.
Signed-off-by: Matthias Ringwald <matthias@ringwald.ch>
In case of extended advertising, advertising data can be reported in
parts, so we shouldn't discard them.
Instead, only discard the legacy advertising reports.
Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
There is an issue that the buffer cannot be allocated by the function
`read_payload()` in UART ISR context. Then the UART RX will be
disabled. The H4 driver hopes to get the receive buffer in the HCI RX
thread and then open the UART RX again. However, there is a situation
where the HCI RX thread is blocked in getting the received data
buffer. However, since the UARt RX has been disabled, the HCI RX
thread cannot get the received data buffer. Therefore, the RX thread
is always blocked here, causing the Bluetooth host to not work
properly.
Add a semaphore `rx.ready` to notify new received data buffer has
been added to H4 RX queue.
Wait for the semaphore `rx.ready` instead of H4 RX queue in HCI RX
thread.
Wake up the HCI RX thread when failing to allocate the RX buffer.
Fixes#89879.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
Update all HCI drivers to use the new H:4 encoding for buffers passing
to/from drivers.
One behavioral change that's done in favor of simplicity, is that where
there's previously been switch statements that could return an error for
unsupported packet types now simply pass any received packet unchanged to
lower layers of the controller (or the HCI transport). Handling this is
now the responsibility of the lower layers, however in practice hitting
such scenarios means that there's a mismatch between configured host and
controller features.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Added IW416 SoC support to enable Bluetooth HCI driver perform
firmware load, and works with blueooth HCI interface.
Removed cmake file from bt_controller/, added support in hal_nxp
module to fetch firmware blobs for iW416/nw612 BT Only FW.
Signed-off-by: Nirav Agrawal <nirav.agrawal@nxp.com>
Even though through code-inspection there isn't a clear path where the
guard wouldn't act upon the length reaching the limit, this check is
moved up to unconditially validate it on every read.
Fixes#84731.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Add a timeout to the SPI boot process to ensure that `bt_enable` does
not block forever but instead returns an error after an appropriately
large delay. While 1 second would be sufficient under normal operation,
we also want to give the controller time to perform any application
upgrades via a bootloader.
Signed-off-by: Jordan Yates <jordan@embeint.com>