Commit graph

795 commits

Author SHA1 Message Date
Petri Pitkanen
51efc60087 silabs: drivers: bluetooth: Fix temporarily observer configuration
Link layer needs some fixing before hci driver can be minimally configured
and hence must revert conditional inclusion of core functionalities untill
new link layer is available.

Signed-off-by: Petri Pitkanen <petri.pitkanen@silabs.com>
2025-01-14 02:24:04 +01:00
Petri Pitkanen
294b7b0da0 silabs: drivers: bluetooth: Add support for controller privacy
Added support for contoroller privacy support.

Signed-off-by: Petri Pitkanen <petri.pitkanen@silabs.com>
2025-01-14 02:24:04 +01:00
Petri Pitkanen
5748738c60 silabs: drivers: bluetooth: Move configurations to Kconfig
Several driver setting were as defines in driver file which made hard to
change by application programmers. Fixed by adding
silicon labs specific Kconfig file for bluetooth driver configurations.

Also some cleaning for handling Kconfig conditional to conform
preferred style.

Signed-off-by: Petri Pitkanen <petri.pitkanen@silabs.com>
2025-01-14 02:24:04 +01:00
Johan Hedberg
5f963feed4 modules: hal_silabs: Add stubs to support CONFIG_BUILD_ONLY_NO_BLOBS
Add empty function stubs to support building with the newly introduced
CONFIG_BUILD_ONLY_NO_BLOBS option.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-12-25 03:37:53 +01:00
Sylvio Alves
3d06716a7b drivers: bt: esp32: add CONFIG_BUILD_ONLY_NO_BLOBS to allow CI tests
Adds an option to enable CI tests without binary blobs.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-12-20 23:51:16 +02:00
Valerio Setti
3fa522c720 tests/samples: remove ENTROPY_GENERATOR from BT related tests/samples
Since now Mbed TLS automatically selects ENTROPY_GENERATOR (or the
test generator, depending on the platform) we can remove this dependency
from all BT related tests and samples.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-12-19 17:53:37 +01:00
Xavier Razavet
1ac3470efb drivers: Narrow Band Unit interruption driver creation
Creation of the new zephyr\soc\nxp\common\nxp_nbu.c driver which manage
the interruption of the NBU. This modification is mandatory to support a
coex application which includes Bluetooth and 802.15.4 on the same
narrow band path.

Signed-off-by: Xavier Razavet <xavier.razavet@nxp.com>
2024-12-19 17:37:24 +01:00
Petri Pitkanen
07094783e7 silabs: drivers: bluetooth: Conditional compiling of optional components
Conditionally compile in controller features based on what features
have been enabled in Kconfig

This commit allow saving in flash size. Over 10k in peripheral_hr
and central_hr. In observer and broadcaster about 20k

Signed-off-by: Petri Pitkanen <petri.pitkanen@silabs.com>
2024-12-17 11:38:31 +00:00
Shahin Haque
544c5bf95c drivers: bluetooth: hci: add thread name to bt_spi_rx_thread
Add thread name to bt_spi_rx_thread

Signed-off-by: Shahin Haque <ShahinHaque97@outlook.com>
2024-12-12 11:38:03 +01:00
Johan Hedberg
bc086f53e2 drivers: bluetooth: silabs_efr32: Declare supported features in Kconfig
Now that we enable `HAS_BT_CTLR` we should also declare which optional
features are supported. For now, we only add the features that are
available through the current driver init routine and found on all
supported platforms.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-12-10 05:38:39 +01:00
Alessandro Manganaro
5c290d8d55 drivers: bluetooth: hci: STM32WBA: Fix pub address assignment
BLE public address assignment shall be done only when
CONFIG_BT_HCI_RAW is not enabled.

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
2024-12-09 15:10:37 +01:00
Johan Hedberg
ef82d753f5 drivers: bluetooth: Enable HAS_BT_CTLR for Silabs EFR32 driver
The controller behind the EFR32 driver is a local link layer
implementation, so it makes sense to select HAS_BT_CTLR.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-12-06 22:21:21 +01:00
Lyle Zhu
56929a26ca Driver: hci_nxp_setup: Support HCI baudrate update
Change running baudrate from `115200` from `3000000`.

Implement the function `bt_h4_vnd_setup` to update the HCI bandrate.

Add Kconfig `BT_H4_NXP_CTLR_WAIT_TIME_AFTER_BAUDRATE_UPDATE` to set
the waiting time after the controller bandrate HCI vendor specific
command sent. It is used to ensure the controller is ready to update
HCI bandrate.

Select `BT_HCI_SETUP` if `BT_H4_NXP_CTLR` is enabled.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-12-03 08:27:43 +01:00
Pieter De Gendt
e9e64bab35 drivers: bluetooth: hci: Place API into iterable section
Add wrapper DEVICE_API macro to all bt_hci_driver_api instances.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-29 14:49:53 +01:00
Sylvio Alves
a7a978a946 drivers: bluetooth: esp32: enable entropy generator by default
As BT now uses PSA crypto API instead of TinyCrypt, entropy generator
is now needed for a proper bluetooth operation.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-28 15:39:08 +00:00
Ian Morris
8e51ebf499 drivers: bluetooth: hci: add hardware reset for da1453x
Add ability to perform a hardware reset of the DA1453x during setup of
the HCI transport.

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2024-11-28 12:52:01 +01:00
Ali Hozhabri
d42fc7ae21 drivers: bluetooth: hci: Add Bluetooth HCI driver for STM32WB0x
Add Bluetooth HCI driver for STM32WB0x series.

Modify CMakeLists.txt to compile the driver based on its kconfig parameter.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-11-25 14:42:54 +01:00
Ali Hozhabri
944963933a bluetooth: Kconfig: Introduce Kconfig parameter for STM32WB0x series
Introduce Kconfig parameter for STM32WB0x HCI Bluetooth driver.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-11-25 14:42:54 +01:00
Johan Hedberg
3063f18942 Bluetooth: Host: Remove unnecessary hci_driver.h includes
None of these files actually use anything from the hci_driver.h header
file.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-11-22 11:37:12 +01:00
Valerio Setti
516886be1b mbedtls: MBEDTLS_ENTROPY_POLL_ZEPHYR default on if MBEDTLS_ENTROPY_C
As long as MBEDTLS_ENTROPY_C is enabled, Mbed TLS needs to
poll some entropy source to gather data that will then be
processed by CTR/HMAC-DRBG modules. This means that in most
of the cases, once MBEDTLS_ENTROPY_C is enabled then also
MBEDTLS_ENTROPY_POLL_ZEPHYR needs to be enabled. This was
done manually until now, as the long list of samples/tests
demonstrate.

This commit solves this dependency by defaulting
MBEDTLS_ENTROPY_POLL_ZEPHYR to on as soon as
MBEDTLS_ENTROPY_C is set. As a consequence, all manual
enablement of MBEDTLS_ENTROPY_POLL_ZEPHYR in samples/tests
are removed.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-11-20 15:59:40 -05:00
Aaron Ye
0439cbc29c drivers: bluetooth: hci: add close function for Ambiq Apollo3x
This commit adds the bt_hci_driver.close function for Ambiq
Apollo3x SoC. Also update the hal_ambiq revision including
the necessary support.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-11-16 14:57:06 -05:00
McAtee Maxwell
2fe4a37f38 Documentation: Update documenation for Infineon boards
-Update formatting and contents of index.rst for cy8ckit_062s4
	-Update formatting and contents of index.rst for cy8ckit_064s0s2_4343w
	-Update formatting and contents of index.rst for cy8cproto_062_4343w
	-Update formatting and contents of index.rst for cy8cproto_063_ble
	-Update formatting and contents of index.rst for xmc45_relax_kit
	-Update formatting and contents of index.rst for xmc47_relax_kit
	-Change all instances of "PSoC" to "PSOC" for infineon platforms

Signed-off-by: McAtee Maxwell <maxwell.mcatee@infineon.com>
2024-11-14 20:36:38 -06:00
Sylvio Alves
685c6e42b8 driver: ble: add custom espressif kconfig
Adds ESP32 custom configurations for BLE driver.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-27 20:53:48 -05:00
Reto Schneider
618d44164a bluetooth: Remove migration hints
Zephyr 3.7.0 has been released and it is time to remove the migration
code added in 9cf07bbdb5 (bluetooth:
Rename rpmsg HCI driver and sample to ipc).

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-10-25 17:37:53 -07:00
Aksel Skauge Mellbye
545e9334f7 drivers: bluetooth: hci: silabs: Configure radio for sleep
If PM is enabled, the radio must be configured to synchronize its
protocol timer with the low frequency timer.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-10-25 14:09:57 +02:00
Sungwoo Kim
88de2711ca Bluetooth: userchan: fix buffer overflow in hci_packet_complete()
hci_packet_complete(buf, buf_size) should check whether buf_size is
enough.
For instance, hci_packet_complete can receive buf with buf_size 1,
leading to the buffer overflow in cmd->param_len, which is buf[3].
This can happen when rx_thread() receives two frames in 512 bytes
and the first frame size is 511. Then, rx_thread() will call
hci_packet_complete() with 1.

==5==ERROR: AddressSanitizer: global-buffer-overflow on address
0x000000ad81c2 at pc 0x0000005279b3 bp 0x7fffe74f5b70 sp 0x7fffe74f5b68

READ of size 2 at 0x000000ad81c2 thread T6
    #0 0x5279b2  (/root/zephyr.exe+0x5279b2)
    #1 0x4d697d  (/root/zephyr.exe+0x4d697d)
    #2 0x7ffff60e5daa  (/lib/x86_64-linux-gnu/libc.so.6+0x89daa)
(BuildId: 2e01923fea4ad9f7fa50fe24e0f3385a45a6cd1c)

0x000000ad81c2 is located 2 bytes to the right of global variable
'rx_thread.frame' defined in 'zephyr/drivers/bluetooth/hci/userchan.c'
(0xad7fc0) of size 512
SUMMARY: AddressSanitizer: global-buffer-overflow
(/root/zephyr.exe+0x5279b2)
Thread T6 created by T2 here:
    #0 0x48c17c  (/root/zephyr.exe+0x48c17c)
    #1 0x530192  (/root/zephyr.exe+0x530192)
    #2 0x4dcc22  (/root/zephyr.exe+0x4dcc22)

Thread T2 created by T1 here:
    #0 0x48c17c  (/root/zephyr.exe+0x48c17c)
    #1 0x530192  (/root/zephyr.exe+0x530192)
    #2 0x4dcc22  (/root/zephyr.exe+0x4dcc22)

Thread T1 created by T0 here:
    #0 0x48c17c  (/root/zephyr.exe+0x48c17c)
    #1 0x52f36c  (/root/zephyr.exe+0x52f36c)
    #2 0x5371dc  (/root/zephyr.exe+0x5371dc)
    #3 0x5312a6  (/root/zephyr.exe+0x5312a6)
    #4 0x52ed7b  (/root/zephyr.exe+0x52ed7b)
    #5 0x52eddd  (/root/zephyr.exe+0x52eddd)
    #6 0x7ffff6083c89  (/lib/x86_64-linux-gnu/libc.so.6+0x27c89)
(BuildId: 2e01923fea4ad9f7fa50fe24e0f3385a45a6cd1c)

==5==ABORTING

Signed-off-by: Sungwoo Kim <iam@sung-woo.kim>
2024-10-25 13:54:36 +02:00
Jordan Yates
573c18f42a bluetooth: hci: dedicated symbols for SPI variants
Add dedicated Kconfig symbols for the two SPI backend variants. This
allows enabling the symbols by default from devicetree, and cleans up
the cmake logic.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-25 08:55:07 +02:00
Johan Hedberg
393ecf4426 drivers: bluetooth: Rename Silabs HCI driver
Rename the Silabs HCI driver to hci_silabs_efr32.c to better indicate what
hardware it supports. Also rename the associated devicetree binding and
Kconfig options to be consistent with the new driver name.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-10-23 16:50:39 +02:00
Yassine El Aissaoui
c002e7880a drivers: bt_nxp: delete non monolithic support
Current code does no longer support
the non monolithic feature.
Hence, removing unnecessary code.

Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2024-10-18 17:45:07 +01:00
Yassine El Aissaoui
89709ee382 drivers: hci: Update NXP HCI driver
Add updates to support MCXW71
Add support if RX data are received in ISR context
Add support to set BT address using Vendor command

Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2024-10-17 09:45:42 +02:00
Sylvio Alves
59f0418d2e soc: esp32: unify runtime heap usage
This commit applies several changes in the way "heap_runtime"
feature is used. It can't be split due to bisectability issues.

Whenever the feature is enabled, a new heap is created and
custom malloc/calloc/free functions are added into the build
system. Those functions are currently used for internal Wi-Fi and BLE
drivers only.

Such changes are described below:

1) Rename heap.c to esp_heap_runtime.c for better readability.
2) Rename RUNTIME_HEAP to HEAP_RUNTIME to make it similar to what is
available in Zephyr.
3) Add runtime heap to BT as such as Wi-Fi.

Fixes #79490
Fixes #79470

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-17 09:45:02 +02:00
Sylvio Alves
882ac1d088 drivers: esp32: wifi/bt: modify init call return error
Update both Wi-FI and BLE init codes to return proper
error code and logging when it is missing heap.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-17 09:45:02 +02:00
Sylvio Alves
7a57d55c76 drivers: bt: airoc: fix compliance check
Fix compliance check related to "symbols without children".
Using regular 'config' entry.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-14 13:03:28 +02:00
Jori Rintahaka
a3f2ba1928 drivers: bluetooth: silabs: move code from module to main tree
The code that handles passing events to and from the controller
resided in the hal_silabs module. This is an integral part of the
HCI driver that it can't work without, and logically belongs in
the driver.

Signed-off-by: Jori Rintahaka <jori.rintahaka@silabs.com>
2024-10-02 13:42:56 -05:00
Armin Brauns
6ba6c66ab5 hci_spi_st: send ACI config synchronously
There's no reason to send these async, and since the reply isn't waited for
anywhere, this can cause the HCI buffer pool to be exhausted and
`bt_enable()` to fail.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2024-09-30 12:10:20 +01:00
Aksel Skauge Mellbye
e77d082b4e drivers: bluetooth: silabs: Initialize PHY
Initialize PHY as part of controller init sequence.

Disable 2M and coded PHYs for now, as they cause issues on devices
that don't support them. This should be made configurable in the future.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-09-26 03:33:38 -04:00
Nazar Palamar
eb406f80bc driver/bluetooth / cyw208xx: enable CYW20829_BT_FW_TX10DBM_POWER
Enable CYW20829_BT_FW_TX10DBM_POWER by default to get
best user experience experience out of the box.

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-09-02 11:58:18 +02:00
Nazar Palamar
9a112dc474 driver/bluetooth: Add setup of PUBLIC ADDR
Added setup of PUBLIC ADDR

NOTE: By default, the CYW208xx controller sets some
hard-coded static address.

To avoid address duplication, let's always override
the default address by using the HCI command
BT_HCI_VND_OP_SET_LOCAL_DEV_ADDR. So

1. when cyw208xx_setup gets BT_ADDR_ANY from the host,
   it will overwrite the default address, and the host
   will switch to using a random address (set in the hci_init
   function).

2. If user set the static address (by using bt_id_create)
   before bt_enable, cyw208xx_setup will set user defined
   static address.

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-09-02 11:58:18 +02:00
Nazar Palamar
5a113ca271 driver/bluetooth / cyw208xx: update condition for select PAwR FW
Select PAwR if enabled following features:
- BT_PER_ADV_RSP
- BT_PER_ADV_SYNC_RSP

Remove dependency BT_AIROC_CUSTOM for AIROC_CUSTOM_FIRMWARE_HCD_BLOB

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-09-02 11:58:18 +02:00
Lyle Zhu
5eda8e7136 Driver: hci_nxp_setup: Change log message to LOG_DBG
Due to it is a normal firmware downloading sequence,
it should be a debug log instead of error log.

Change LOG_ERR to LOG_DBG for this case.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-09-02 09:05:34 +02:00
Johan Hedberg
c15957e753 Bluetooth: drivers: Add module blobs dependencies to Kconfig
Now that there is an actual Kconfig symbol generated for blobs presence,
take advantage of that and declare appropriate dependencies to it. Also add
helpful CMake output if the blobs are missing by taking advantage of the
zephyr_blobs_verify() CMake function.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-08-30 11:45:56 -04:00
Erwan Gouriou
a078b4ee6b drivers: bluetooth: hci: Remove prompt on non user selectable symbols
Most of BT_FOO symbols that are designed to select the hci driver
implementation which will drive the comunication with controller are
selected based on device tree compatible and should not be made available
as an configurable option to the user.
To do this, remove the prompt on these symbols.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-08-26 11:04:45 -04:00
Valerio Setti
98ddf107fa mbedtls: rename CONFIG_MBEDTLS_ZEPHYR_ENTROPY and move it
- Slightly improve the name of this kconfig adding the suffix
  _POLL in order to highlight that this adds a callback
  function used to poll data.

- Description was also updated to point out that this symbols
  might not only use the (secure) entropy driver, but also
  generic number generators, some of which are not really
  secure.

- The symbol was move from Kconfig to Kconfig.tls-generic because
  this is where MBEDTLS_ENTROPY_C is located and since
  MBEDTLS_ENTROPY_HARDWARE_ALT depends on the former (it only
  makes sense if the entropy module is also enabled), we add
  also the "depends on".

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-08-24 07:16:51 -04:00
Valerio Setti
e3e13fb40b mbedtls: rename MBEDTLS_ENTROPY_ENABLED as MBEDTLS_ENTROPY_C
ENABLED suffix does not really makes much sense for a kconfig
so it should be removed. Also other MBEDTLS symbols were recently
updated accordingly.
Moreover having it named exactly the same way as in Mbed TLS
symplifies the understanding of what this kconfig is doing.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-08-24 07:16:51 -04:00
Declan Snyder
6e7f86ce86 soc: nxp: Move connectivity defaults to common
Move default of monolithic and fw loader, options, etc to the
common kconfig files rather than defaulting in soc file.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-08-22 09:14:24 +02:00
Henrik Brix Andersen
69fe9b0c50 net: buf: remove use of special putter and getter functions
Convert users of net_buf_put() and net_buf_get() functions to use
non-wrapped putters and getters k_fifo_put() and k_fifo_get().

Special handling of net_bufs in k_fifos is no longer needed after commit
3d306c181f, since these actions are now
atomic regardless of any net_buf fragments.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-08-16 09:55:11 +02:00
Alberto Escolar Piedras
ad0fc3b5b1 drivers/bluetooth/userchan: Fix dependency
The driver can run in either native_posix or native_sim.
Let's make sure to set the dependencies acordingly.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-08-14 09:14:10 -04:00
Alberto Escolar Piedras
ee08327b4c Bluetooth: drivers: userchan: Fix gcc 13 overflow warning
gcc 13 produces a build warning (see below), as it seems to
believe the number of read bytes may overflow the frame_size
type.
Let's increase the frame_size bitwidth to avoid this.
(Any 32bit type, signed or unsigned, avoids this warning)

The build warning:
```
In file included from /usr/include/features.h:502,
                 from bits/libc-header-start.h:33,
                 from /usr/include/stdint.h:26,
                 from include/stdint.h:9,
                 from zephyr/include/zephyr/types.h:11,
                 from zephyr/include/zephyr/kernel_includes.h:21,
                 from zephyr/include/zephyr/kernel.h:17,
                 from zephyr/drivers/bluetooth/hci/userchan.c:9:
In function ‘read’,
    inlined from ‘rx_thread’ at drivers/bluetooth/hci/userchan.c:201:9:
/usr/include/i386-linux-gnu/bits/unistd.h:28:10: warning: ‘__read_alias’
specified size between 4294902273 and 4294967295 exceeds maximum object
size 2147483647
[-Wstringop-overflow=]
   28 |   return __glibc_fortify (read, __nbytes, sizeof (char),
      |          ^~~~~~~~~~~~~~~
drivers/bluetooth/hci/userchan.c: In function ‘rx_thread’:
drivers/bluetooth/hci/userchan.c:187:32: note: destination object allocated
  here
  187 |                 static uint8_t frame[512];
      |                                ^~~~~
/usr/include/i386-linux-gnu/bits/unistd-decl.h:29:16: note: in a call to
  function
‘__read_alias’ declared with attribute ‘access (write_only, 2, 3)’
   29 | extern ssize_t __REDIRECT_FORTIFY (__read_alias, (int __fd, void
      |                ^~~~~~~~~~~~~~~~~~
```

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-08-12 12:43:01 +02:00
Declan Snyder
d4d56de4d4 drivers: bt_nxp: Use DT code partition if needed
Remove the logic from the board level about overriding the
flash load size and instead just select to use the DT code
partition if app is not expected to be able to occupy the
whole flash space because of the firmware image being
loaded separately.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-08-05 18:37:35 -04:00
Alessandro Manganaro
4fc77248de drivers: bluetooth: hci: Fix stm32wb BLE behavior
Enabling BT_HCI_SETUP for STM32WB55 to have a
correct and proper initialization procedure to fix
#75318 issue

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
2024-08-05 11:32:17 +02:00