Commit graph

64412 commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada f755550ec0 samples: Bluetooth: Remove explicit Ext and Periodic Adv Kconfig enable
Remove the explicit enable of Extended and Periodic
Advertising support in Controller, the feature is no
longer experimental in the Controller and is now enabled
by default when application uses them by enabling as
Host feature.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-16 18:25:14 +02:00
Vinayak Kariappa Chettimada 79dbfc108a Bluetooth: Controller: Remove experimental from Ext and Periodic Adv
Remove experimental label from Advertising Extensions and
Periodic Advertising features in the Controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-16 18:25:14 +02:00
Martí Bolívar 3fcd22b7b9 release: Zephyr 3.1.0-rc1
Release tag for Zephyr v3.1.0-rc1

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-05-16 09:04:54 -07:00
Andries Kruithof 0c8f73da18 Bluetooth: controller: set refactored LLCP as default for DF
This PR sets the refactored LLCP as the default instead of legacy
so that more people will use this, giving us more feedback

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2022-05-16 18:02:20 +02:00
Carlo Caione 11f0bb9d1a ipc: static_vrings: Add -ENOMEM case
Sometimes it is important to know when the backend fails to send out
data because no memory / buffers are available. Return -ENOMEM in that
case.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-05-16 16:56:33 +02:00
Matthias Wauer ba14fc4745 mgmt: img_mgmt: fix typo in variable name
The correct variable name is 'action'

Signed-off-by: Matthias Wauer <matthiaswauer@gmail.com>
2022-05-16 16:56:18 +02:00
Mariusz Skamra fd87b39d80 Bluetooth: ascs: Fix compilation warning
This fixes uninitialized `ret` variable compilation warning.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-05-16 16:56:11 +02:00
Mariusz Skamra d5147803f0 tests: btshell: Fix the HAS server shell dependency
Enable HAS shell only if preset support is enabled. Otherwise there are
no functions yet that can be exposed if the preset support is disabled.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-05-16 16:56:11 +02:00
Mariusz Skamra 8f1c4f36ba Bluetooth: has: Fix compliation warning
Fix unused `ccc_cfg_changed` function warning that shows up when
preset support is disabled.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-05-16 16:56:11 +02:00
Mariusz Skamra e5aad57fc5 Bluetooth: has: Introduce BT_HAS_PRESET_SUPPORT helper symbol
Introduce invisible helper symbol that could simplify and make more
readable condiitional code checks.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-05-16 16:56:11 +02:00
Sjors Hettinga c3158804d4 tests: net: socket: tcp: Add test to validate obstructed close
When there is no response from the server, a client side close
is obstructed, it should terminate and clean the context. This
tests breaks the connection after the accept and validates
this behavior.

Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
2022-05-16 16:55:51 +02:00
Sjors Hettinga ae31773ddd drivers: net: loopback: Add counting of number of dropped packets
When the loopback drops driver packets, the number of dropped
packets is counted and can be requested externally.

Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
2022-05-16 16:55:51 +02:00
Chen Peng1 ca08d2e4a6 twister: ignore serial device SerialException.
For some boards, like up_squared and ehl_crb, they need do a
power off/on operation and use bios to load and execute zephyr
test binary, during the power off, it may meet this SerialException,
but the serial object still works well after power on, we can continue
to get all results from serial, so we don't need to close it,
it's ok to ignore this exception.
BTW, even if we ignore this exception here, it doesn't influence twister
function, because if it was really caused by disconnection, the test would
still be judged as failed due to timeout and serial would be closed later
in main thread, it doesn't impact results.
On the contrary, close serial directly in the monitor serial thread, it
will cause later tests failed due to mismatch errors.

Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
2022-05-16 16:55:42 +02:00
Asbjørn Sæbø af607bb886 Bluetooth: Gatt: Update users of write callback in subscription params
Update the users of the "write" callback in the
bt_gatt_subscribe_params to use the new "subscribe" callback instead.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-05-16 16:54:27 +02:00
Asbjørn Sæbø bf361aff21 Bluetooth: Gatt: Replace callback in gatt subscription callback.
Add a "subscribe" callback in the bt_gatt_subscribe params, and
deprecate the "write" callback.

The purpose of this is to be able to return the subscription
parameters in the callback.  The write callback
- (in principle) returns write parameters
- in fact returns nothing - the pointer is set to NULL

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2022-05-16 16:54:27 +02:00
Stephanos Ioannidis b744130735 tests: timer_monotonic: Use volatile for timing variables
This commit adds the `volatile` qualifier to the timing variables, in
order to ensure that the compiler does not try to optimise the test in
a way that can affect the execution time measurements.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-16 09:43:52 -04:00
Henrik Brix Andersen a195f98265 soc: arm: gigadevice: undefine CAN_MODE_NORMAL
The GigaDevice HAL defines CAN_MODE_NORMAL, which conflicts with the
zephyr/drivers/can.h header definition. Undefine it in soc.h.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-05-16 12:56:50 +02:00
Henrik Brix Andersen 957000c9d8 soc: riscv: privilege: gd32vf103: undefine CAN_MODE_NORMAL
The GigaDevice HAL defines CAN_MODE_NORMAL, which conflicts with the
zephyr/drivers/can.h header definition. Undefine it in soc.h.

Fixes: #45611

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-05-16 12:56:50 +02:00
Nazar Palamar 90a0dd6d6f modules: hal_infineon: fix CMake Warning when build non Infineon device
Problem:
pull/43494 is causing the CMake warning
No SOURCES given to Zephyr library: modules_hal_infineon

modules_hal_infineon library was defined even if none of the
below subdirectories is added; so, when not building for
Infineon/Cypress devices, the source list for this library
will be empty.

Fix:
Added 'zephyr_library_named(modules_hal_infineon)' under condition
'if(CONFIG_HAS_XMCLIB OR CONFIG_SOC_FAMILY_PSOC6)'

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2022-05-16 10:17:29 +02:00
Piotr Pryga 0a497fcd55 Bluetooth: Controller: df: Fix wrong ant after switch pattern exhausted
Direction finding functionality does antenna switching during CTE
reception in AoA mode and CTE transmission in AoD mode. Antennas are
switched according to user provided antenna switch pattern. If a CTE
length is enough to exhaust all antenna ids in a switch pattern then
radio should loopback to reference antenna and continue from switching
from that. Current implementation loops back to antenna that is just
after reference antenna in the switch pattern.

The commit fixes that by insertion of the reference antenna
at the end of switch pattern. Radio will operate as it was before,
it will restart switching from the same index in a switch pattern.
At the same time reference antenna will be inserted into the loop
if switching pattern is exhausted. That also means, the maximum
number of antenna ids in a switch pattern has to be decreased by
one.

The commit also fixes lower bound in the BT_CTLR_DF_MAX_ANT_SW_PATTERN-
_LEN that should be equal two. It was set to three, because in the
past the antenna at index zero was used for reception of a PDU.
Now this antenna ID is provided by device tree configuration.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-16 10:08:48 +02:00
Piotr Pryga 5a6ed86d46 Bluetooth: df: Split CTE filtering SYNC_STAT_READY_OR_CONT_SCAN
The SYNC_STAT_READY_OR_CONT_SCAN state into two: SYNC_STAT_READY
and SYNC_STAT_CONT_SCAN. The connected state was used for two
cases:
- synchronization with periodic advertising is already established,
- CTE type is wrong but periodic advertising list is used to filter
synchronized devices.
In the past states were connected because there was only one difference
between them. In case of sync already established, Controller generated
sync report notification to host.The sync was not terminated when
Controller was about to continue search for other periodic advertiser.

The state was split because now Controller terminates sync ticker and
continues search for other periodic advertised. The split improves
readability and makes code easier to understand.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-16 10:08:06 +02:00
Piotr Pryga 3715241bde Bluetooth: Controller: fix per sync hang if wrong cte and list filter
In case of use of filtering based on: periodic advertising list and
CTE type, the synchronization can hang. That is possible if a periodic
advertiser uses wrong CTE type. In such situation the sync is not
released in ull_sync_done call. What more the sync->timeout_reload
is not cleared and Host is not able to cancel the synchronization.
The periodic advertising is in a semi-sync-established state.
There are no reports send to Host. Host can't use the sync set to
synchronize with other device. It is only able to terminate the
sync (call to ll_sync_terminate).

To fix the issue following changes should be applied:
- isr_rx_adv_sync_estab should call isr_rx_done_cleanup
with sync_term parameter in case the sync_ok isn't SYNC_STAT_ALLOWED.
In any case the CTE type is wrong, no matter is the periodic
advertising list filtering is enabled or not.
- ull_sync_established_report should set sync->is_term to true
in case the CTE type is not allowed. That change is required for devices
that do not support Direction Finding Extension. For those devices CTE
type based filtering is done in ULL by ull_sync_established_report
function. The sync->is_term should be set unconditionally, hence is
moved up in the function.

With these two changes done, ull_sync_done function will execute
sync_ticker_release in case the CTE has wrong type. ULL, depending on
notifications prepared by ull_sync_established_report, will follow up
on sync termination if required.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-05-16 10:08:06 +02:00
Katsuhiro Suzuki 154b5a1319 boards: hifive1_revb: add pinctrl configs for spi
This patch adds lack pinctrl configs for spi1 and spi2.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
2022-05-16 09:41:40 +02:00
Erik Brockhoff 876772f82e Bluetooth: controller: llcp: terminate conn. on past instant for chmu
In case a channel map is requested for an instant in the past
connection is terminated.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-05-16 09:41:23 +02:00
Wael Barakat 4b3fe99b83 drivers: gpio: nrf: fix pin number used in getting GPIOTE channel
Incorrect GPIOTE channel was being freed because the pin number
being used is not the absolute pin but the pin within the port.

Signed-off-by: Wael Barakat <waelsbarakat@gmail.com>
2022-05-16 09:41:04 +02:00
Erik Brockhoff 9498310c53 Bluetooth: controller: Implement cross connection CPR mutual exclusion
Porting mechanism as used in legacy LLCP to refactored CPR.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-05-16 09:40:36 +02:00
Erik Brockhoff 4ae3dc8cb2 Bluetooth: controller: Impl. check for active remote initiated CPR
Checking if a remote initiated CPR is currently active on given conn

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-05-16 09:40:36 +02:00
Erik Brockhoff 84a8294624 Bluetooth: test: Implementing mechanism to emulate multiple connections
Expanding the test helpers for unit tests to allow for emulation of
multiple connections.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-05-16 09:40:36 +02:00
Erik Brockhoff 3e5b004d62 Bluetooth: controller: moving CPR cross connection serialization
Moving to allow using the mechanism with refactored LLCP

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2022-05-16 09:40:36 +02:00
Jordan Yates 782480313e tests: pm: device_runtime: test PM unsupported behaviour
Test the behaviour of the PM device_runtime API on devices that do not
support power management.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-15 21:34:46 +02:00
Jordan Yates e83e9b08b5 pm: device_runtime: return -ENOTSUP if PM not supported
Return `-ENOTSUP` on calls to device_runtime functions if the underlying
device does not support power management.

Fixes #45648.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-05-15 21:34:46 +02:00
Felipe Neves b3611b4cd0 samples: net: wifi: add mikroe wifi bt click
as supported wifi interface for this sample.

Signed-off-by: Felipe Neves <felipe.neves@linaro.org>
2022-05-15 21:34:32 +02:00
Felipe Neves 7dfd56a855 boards: arm: b_u585_iot02a: enable arduino
serial bus in the arduino connector.

Signed-off-by: Felipe Neves <felipe.neves@linaro.org>
2022-05-15 21:34:32 +02:00
Felipe Neves 2494db7191 boards: arm: lpcexpresso5569: enables mikrobus
serial connector in its dts file.

Signed-off-by: Felipe Neves <felipe.neves@linaro.org>
2022-05-15 21:34:32 +02:00
Felipe Neves 44631ebada drivers: wifi: esp_at: add support for firmware
V2.1 for ESP At and make it to coexist
with the current versions.

Signed-off-by: Felipe Neves <felipe.neves@linaro.org>
2022-05-15 21:34:32 +02:00
Felipe Neves ddfceb6ad5 boards: mikroe_wifi_bt_click: added support
For MikroElektronika WIFI plus BT shield

Signed-off-by: Felipe Neves <felipe.neves@linaro.org>
2022-05-15 21:34:32 +02:00
Martin Jäger 2554f04464 doc: services: storage: add flash_img API
Doxygen comments were existing, but they were not rendered anywhere in
the docs. The code is located under DFU, but I think it makes sense
to document it under storage, next to similar flash-related APIs.

Signed-off-by: Martin Jäger <martin@libre.solar>
2022-05-15 21:33:54 +02:00
Reto Schneider 3bd8355ca0 doc: Fix settings_handler_static::h_export example
Callback takes a const data pointer.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2022-05-15 21:33:22 +02:00
Dominik Ermel 578cb132ff mgmt/mcumgr/lib: Make version string work with CONFIG_NEWLIB_LIBC
By default the newlib does not compile with %hhu processing,
to avoid turning on additional options for newlib compilation
this commit changes formatting string to use %hu instead.
The commit fixes problem with malformed version string being
returned, by smp_svr, when CONFIG_NEWLIB_LIBC=y is set together
with CONFIG_NEWLIB_LIBC_NANO=y.

Fixes #45261

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-05-15 21:33:05 +02:00
Dominik Ermel 0c051d0dd6 mgmt/mcumgr/lib: Fix astray dot in image version
Removed the dot.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-05-15 21:33:05 +02:00
Emil Gydesen f34c9132d6 Bluetooth: Sample: Add iso get info use to iso connected benchmark
Add a call to bt_iso_chan_get_info for each CIS in the sample
to ensure that we don't attempt to send any data on a CIS
that is RX only.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-15 21:32:19 +02:00
Emil Gydesen bcfb4df390 Bluetooth: ISO: Modify and add more debug for setup iso data path
Modify the function slightly to take a different
argument, and add more debugging to the function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-15 21:32:19 +02:00
Emil Gydesen f67e12ae8e Bluetooth: ISO: Add check for can_send in bt_iso_chan_send
Ensure that we don't attempt to send any data to the
controller if `can_send` is not set, and return an
error code to the application instead.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-15 21:32:19 +02:00
Emil Gydesen 24e38e90db Bluetooth: ISO: Use can_send, can_recv when setting up data paths
Besides checking for the rx/tx pointer, we now also validate
the can_send and can_recv values to ensure that we do
not setup a useless data path.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-15 21:32:19 +02:00
Emil Gydesen 54fac0323c Bluetooth: ISO: Expose can_send and can_recv in bt_iso_chan_get_info
The application can get the information about can_send
and can_recv in the bt_iso_chan_get_info function.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-15 21:32:19 +02:00
Emil Gydesen 2660c17c31 Bluetooth: ISO: Set can_send/can_recv for broadcast channels
Set the can_send to true and can_recv to false for broadcaster.
Set the can_send to false and can_recv to true for the sync
receiver.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-15 21:32:19 +02:00
Emil Gydesen b88b25adac Bluetooth: ISO: Extract and store information about RX and TX
Instead of relying only on the `tx` and `rx` qos pointers,
we extract further information from the
bt_hci_evt_le_cis_established event to properly determine if we
can actually send or receive data.

This is useful to help determine which data paths to setup,
and whether to reject requests to send.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-15 21:32:19 +02:00
Alexej Rempel 476d199752 logging: shell: fix shell stats null pointer dereference
If CONFIG_SHELL_STATS is disabled, shell->stats is NULL and
must not be dereferenced. Guard against it.

Fixes #44089

Signed-off-by: Alexej Rempel <Alexej.Rempel@de.eckerle-gruppe.com>
2022-05-15 21:32:10 +02:00
Keiya Nobuta 5d662ae3f8 drivers: kscan: Add CAP1203 driver
Add driver for Microchip CAP1203 3-Channel Capacitive Touch Sensor

datasheet: https://ww1.microchip.com/downloads/en/DeviceDoc/00001572B.pdf

Signed-off-by: Keiya Nobuta <nobuta.keiya@fujitsu.com>
2022-05-15 21:31:54 +02:00
Anas Nashif a6f924db7f twister: add support for platform_type filter
Instead of relying on runtime filter to limit scope to emulation
platforms, use the type attribute for each platform and do the filtering
very early on. This will speed things up for tests where we only run on
emulation platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-14 14:49:59 -04:00