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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
-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>
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>
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>
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>
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>
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>
Current code does no longer support
the non monolithic feature.
Hence, removing unnecessary code.
Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
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>
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#79490Fixes#79470
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>