Commit graph

77774 commits

Author SHA1 Message Date
Aleksandr Khromykh e7f1856143 Bluetooth: Mesh: add experimental support mbedtls psa
Commit adds experimental support mbedtls psa as crypto
backend for ble mesh. It were run only on bsim tests.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-04-17 16:31:20 +02:00
Aleksandr Khromykh 77c72aa67b Bluetooth: Mesh: get rid of host dependency for dh key for mesh
Commit gets rid of host dependency to generate DH key.
Mesh uses its own function for it that has synchronous
behavior and correct endianism. It simplifies the provisioning
state machine since it doesn't require waiting for the host HCI
handler.
Also, it removes hidden cross-dependency between BLE Mesh and
SMP in the aspect of competition for the same DH key
(https://github.com/zephyrproject-rtos/zephyr/issues/23292)

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-04-17 16:31:20 +02:00
Aleksandr Khromykh 3f08bd335f Bluetooth: Mesh: split crypto on seclib dependent and independent parts
Commit splits mesh crypto module on security library dependent
and independent parts.
Independent part includes security toolbox implementation.
Dependent part includes security algorithms usage based on
API third party security library.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2023-04-17 16:31:20 +02:00
Martin Jäger d655d00e8c drivers: eeprom: at2x: initialize after I2C/SPI
Introduce dedicated init priority for AT2X EEPROMs connected via
I2C or SPI to ensure they are initialized after I2C/SPI by default.

Signed-off-by: Martin Jäger <martin@libre.solar>
2023-04-17 16:31:00 +02:00
Daniel Nejezchleb 663b684fea net: socket: fix hanging net contexts
Calls put instead of unref on net contexts
in the socket accept function.
Mere unref didn't subtract the reference
count of net context which leaves
it in used state. This situation happens
in case of accepting already
closed connection.

Signed-off-by: Daniel Nejezchleb <dnejezchleb@hwg.cz>
2023-04-17 15:12:41 +02:00
Filip Kokosinski e9e5498a51 samples/bluetooth/central: fix error code reporting
`bt_conn_le_create` returns a signed value. Error message format string
expects an unsigned value.

This commit changes the expected value in the format string to a signed
one, to match what `bt_conn_le_create` returns.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2023-04-17 15:12:32 +02:00
Jaska Uimonen bdffde3695 soc: xtensa: intel_adsp: do power off only with custom pm policy
The power off sequence in cavs is meant to be used only by custom pm
policy handler thus guard it with proper ifdefs.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2023-04-17 15:12:24 +02:00
Stephanos Ioannidis 43fc0f5184 samples: drivers: spi_flash_at45: Add missing return statement
The `main` function now returns `int` instead of `void` and therefore
must return a value.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-04-17 20:19:36 +09:00
Stephanos Ioannidis db91e81ffe samples: stm32: backup_sram: Fix main function return statement
The `main` function now returns `int` instead of `void` and therefore
any return statements inside it must return a value.

Note that any return values other than 0 are currently reserved.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-04-17 20:19:19 +09:00
Matthias Hauser 6789c0d400 drivers: sensor: Added driver for the Würth Elektronik WSEN-PADS sensor
Added driver for the absolute pressure sensor WSEN-PADS

Signed-off-by: Matthias Hauser <Matthias.Hauser@we-online.de>
2023-04-17 11:49:35 +02:00
Robert Hancock c99900acfd tests: drivers: build_all: add build for i2c_xilinx_axi
There is currently not an in-tree Zephyr board which enables the
i2c_xilinx_axi driver as part of its standard configuration. (It can be
enabled fairly easily with the Digilent Arty board, but that requires
modifying the ARM-provided FPGA block design in Vivado and rebuilding
the FPGA image, so it cannot be used with the default FPGA image.)

Add a build_all target to provide build coverage for this driver.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2023-04-17 11:39:21 +02:00
Robert Hancock b1c0bf8499 drivers: i2c: add Xilinx AXI I2C driver
Add a driver to support the Xilinx AXI IIC Bus Interface logic core, as
described in Xilinx document PG090. This can be configured for use on
most Xilinx FPGA-based platforms such as the Digilent Arty.

Both the 2.00a and 2.1 versions of the core are supported. The 2.00a
revision has a bug causing dynamic read mode to not be reliable. With
this version of the core the driver falls back to reading only 1 byte
per interrupt.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2023-04-17 11:39:21 +02:00
Robert Hancock 0526fe0575 dts: bindings: i2c: Added Xilinx I2C driver
Added device tree bindings for the Xilinx I2C driver (both 2.00a and 2.1
IP core revisions).

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2023-04-17 11:39:21 +02:00
Daniel Nejezchleb ee720b5412 net: socket: asynchronous connect
Added a feature of socket connect
being asynchronous. If socket is set
to nonblock with O_NONBLOCK flag,
then connect() is non-blocking aswell.
App can normally poll the socket to
test when the connection is established.

Signed-off-by: Daniel Nejezchleb <dnejezchleb@hwg.cz>
2023-04-17 11:35:20 +02:00
Daniel Nejezchleb 42854bdf7b tests: net: socket: asynchronous connect
Added tests to check async socket connect

Signed-off-by: Daniel Nejezchleb <dnejezchleb@hwg.cz>
2023-04-17 11:35:20 +02:00
Thomas Stranger 8178807b31 tests: drivers: clock_control: stm32 common: also test get_status
Add clock_control_get_status checks to the stm32_common_devices adc
and i2c tests, to verify that checking the status of gating clocks and
domain clock sources works.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2023-04-17 11:33:15 +02:00
Thomas Stranger f8a439561f drivers: clock_control: stm32 common: implement get_status api
The get_status api allows to query whether clock is turned on or off.
Like the get_rate call, the status of gated clocks (for specific
peripherals), as well as domain clock sources(HSE, PCLK, PLL_P,..)
can be checked this way.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2023-04-17 11:33:15 +02:00
Johann Fischer 4c6a5e0fa3 usb: add a note about the return value of usb_transfer_sync()
The transfer completion callback does not provide a way to pass
transfer status to the transfer submitter.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-04-17 11:30:48 +02:00
Johann Fischer 0ad1eef4b7 usb: device: Revert "fix possible deadlock in usb_transfer_sync()"
This reverts commit cd7461495f,
introduced to fix possible deadlock as result of changes in
commit f206170c65
("usb: device: Do not call callback when transfer is cancelled")
which is now reverted.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-04-17 11:30:48 +02:00
Nickolas Lapp 81e4934ebd usb: device: Revert "Do not call callback when transfer is cancelled"
This reverts commit f206170c65
introduced as workaround for nRF USBD device controller in PR
https://github.com/zephyrproject-rtos/zephyr/pull/16193.

This commit may be reverted due to changes made in
commit e326c58399
("usb: device: Do not cancel transfers on suspend").

Signed-off-by: Nickolas Lapp <nickolaslapp@gmail.com>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-04-17 11:30:48 +02:00
romain pelletant eab19663a9 net: lwm2m: add callback for send confirmation
Issue #52328

Signed-off-by: romain pelletant <romainp@kickmaker.net>
2023-04-17 11:29:14 +02:00
Andrzej Głąbek 8cc7ca1208 samples: drivers: adc: Update console output specification
This is a follow-up to commit 9fa35bc9a0.

Align specification of the expected console output with the changes
done to the sample in the above commit.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2023-04-17 11:24:44 +02:00
Vinayak Kariappa Chettimada 3a9e233089 samples: Bluetooth: hci_rpmsg: Fix stack sizes based on profiling
Fix stack size requirement in hci_rpmsg sample based on
profiling using thread analyzer.

Below is the observed stack usages now under Connected ISO
audio application on nrf5340_audio_dk_nrf5340_cpunet:
Thread analyze:
 0x21001968          : STACK: unused 248 usage 264 / 512 (51 %); CPU: 1 %
      : Total CPU cycles used: 102725
 HCI rpmsg TX        : STACK: unused 560 usage 592 / 1152 (51 %); CPU: 0 %
      : Total CPU cycles used: 73484
 BT RX               : STACK: unused 208 usage 432 / 640 (67 %); CPU: 2 %
      : Total CPU cycles used: 198386
 BT RX pri           : STACK: unused 200 usage 184 / 384 (47 %); CPU: 1 %
      : Total CPU cycles used: 147340
 thread_analyzer     : STACK: unused 544 usage 480 / 1024 (46 %); CPU: 1 %
      : Total CPU cycles used: 169843
 sysworkq            : STACK: unused 208 usage 304 / 512 (59 %); CPU: 0 %
      : Total CPU cycles used: 1
 idle                : STACK: unused 208 usage 48 / 256 (18 %); CPU: 91 %
      : Total CPU cycles used: 8529054
 main                : STACK: unused 144 usage 368 / 512 (71 %); CPU: 1 %
      : Total CPU cycles used: 107724
 ISR0                : STACK: unused 192 usage 832 / 1024 (81 %)

Below is the observed stack usages now under Broadcast ISO
audio application on nrf5340_audio_dk_nrf5340_cpunet:
Thread analyze:
 0x21001968          : STACK: unused 248 usage 264 / 512 (51 %); CPU: 2 %
      : Total CPU cycles used: 622241
 HCI rpmsg TX        : STACK: unused 240 usage 912 / 1152 (79 %); CPU: 2 %
      : Total CPU cycles used: 504720
 BT RX               : STACK: unused 464 usage 176 / 640 (27 %); CPU: 0 %
      : Total CPU cycles used: 3
 BT RX pri           : STACK: unused 200 usage 184 / 384 (47 %); CPU: 0 %
      : Total CPU cycles used: 212981
 thread_analyzer     : STACK: unused 544 usage 480 / 1024 (46 %); CPU: 1 %
      : Total CPU cycles used: 419593
 sysworkq            : STACK: unused 336 usage 176 / 512 (34 %); CPU: 0 %
      : Total CPU cycles used: 1
 idle                : STACK: unused 208 usage 48 / 256 (18 %); CPU: 91 %
      : Total CPU cycles used: 22065557
 main                : STACK: unused 144 usage 368 / 512 (71 %); CPU: 1 %
      : Total CPU cycles used: 388285
 ISR0                : STACK: unused 304 usage 720 / 1024 (70 %)

Relates to commit 3f7fa919d9 ("samples: Bluetooth: hci_rpmsg:
Fix RAM overflow building for DF feature").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-04-17 11:22:00 +02:00
Vinayak Kariappa Chettimada 64b4c6ddbd Bluetooth: Controller: Fix Adv PDU RAM usage for direction finding
Fix Advertising PDU size calculation when direction finding
feature is enabled and PDU fragment count includes the
maximum CTE PDU chained. Fix removes redundant PDU count
included for Extended Advertising. Only Periodic advertising
PDUs chain CTE requires number of additional PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-04-17 11:22:00 +02:00
Henrik Brix Andersen 1cfc85bab8 modules: segger: move Kconfig to modules/segger
Move the Segger RTT module Kconfig to modules/segger/kconfig. The Segger
debug library is not a driver and should not reside under drivers/debug.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-04-17 11:21:48 +02:00
Keith Packard b5caccb2ba lib/picolibc: Use zephyr_libc_link_libraries to find toolchain lib
When using the toolchain C library, that must be added to the link command
after all other libraries and modules in the system to resolve undefined
symbols.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-17 11:13:17 +02:00
Keith Packard 87a30609da cmake: Add zephyr_libc_link_libraries function
This function allows subsystems to define libraries which get added to the
link command after all other libraries and modules. It's useful when using
a toolchain library, like libc or libgcc, as those can get added when
processing the 'lib' directory, before any module libraries and hence might
not get used to resolve symbols from modules.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-17 11:13:17 +02:00
Ryan McClelland 2808711e35 arch: arm: aarch32: include m55 for fp16 support
The M55 supports half-precision floating point.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-04-17 10:20:17 +02:00
Peter Johanson 1432b6e870 drivers: sensor: qdec_nrfx: Typo fix from trigger work.
Fix a typo introduced during move to store pointer to the
user supplied trigger.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2023-04-17 10:20:06 +02:00
Kumar Gala 39ec490534 toolchain: common: iterable sections: Add generic type macros
Add a set of macros that can be utilized for any type and redefine
the struct macros to utilize these macros.  While the majority of
uses for iterable sections are for structs, there are some cases
where the elements of the section might be a union or some other
type.

Also added <STRUCT|TYPE>_SECTION_<START|END>_EXTERN helper macros to
give a common means to handle setting externs in rare case they
are needed.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-04-17 10:19:53 +02:00
Alberto Escolar Piedras 8fd3507769 nrf52_bsim: Stop disabling temperature sensor
The HW models now include the temperature sensor,
let's stop excluding it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-04-17 10:19:33 +02:00
Alberto Escolar Piedras 0c3fc69830 manifest: nrf hw models: Update to latest w TEMP HW
Update to the latest HW models which include models
of the TEMP peripheral

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-04-17 10:19:33 +02:00
Alberto Escolar Piedras 83377046ba drivers: temp_nrf5: Fix warning in ISR prototype
The ISR prototype was changed some time ago
(6df8b3995e)
to (const void*) => fix isr function definition
to avoid a compile warning.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-04-17 10:19:33 +02:00
Alberto Escolar Piedras c9d500cd2e tests bsim net echo_test: Minor fixes
Two minor fixes:
* The wait time mention in the description was wrong.
* The possible argument passed to the scripts is meant to target the
  phy itself, but it was sent to the channel library.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-04-17 10:19:25 +02:00
Alberto Escolar Piedras 87911544d9 tests bsim bap_bass_client_sync: Set script as executable
Test scripts need to have executable permissions.
Otherwise, run_parallel will change the mode in CI,
and users need to set them locally which results
in a not clean git workspace.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-04-17 10:19:13 +02:00
Andrei Emeltchenko 607a56585a samples: ivshmem: Use device_is_ready()
Fix sample to use device_is_ready(dev) when checking for device.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-04-17 10:18:46 +02:00
Rubin Gerritsen e7262771f0 samples: bluetooth: hci_rpmsg: Discard too long incoming packets
Avoid hitting the assert
```
__ASSERT_NO_MSG(net_buf_simple_tailroom(buf) >= len);
```
when the provided buffer is longer than we can fit. Instead discard the
packet and log an error.

This handling is similar to packets are discarded in hci_uart

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2023-04-17 10:18:36 +02:00
Rubin Gerritsen 19547e815b Bluetooth: Increase HCI CMD buffer size when ISO Central is used
When ISO Central is enabled it is allowed to configure many CISes at
once. For this a large command buffer is needed. This is also tested
by HCI/CIS/BI-05-C.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2023-04-17 10:18:27 +02:00
Ajay Parida d961a483c3 net: wifi_mgmt: fix for function name mismatch
changes for mismatch between .h and .c file in
function name..

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2023-04-17 10:17:37 +02:00
Andrew Hedin 07652f5acc boards: arm: bl5340_dvk: Fix address mismatch
Fix unit and first address mismatch.

Signed-off-by: Andrew Hedin <andrew.hedin@lairdconnect.com>
2023-04-17 10:17:19 +02:00
Kenny Johansson 353e5f2577 net: tcp: Fix IPv6 TCP MSS issue
Fixes #56657, incorrect TCP MSS calculation for IPv6.

Previously the supported MSS would incorrectly returned as the MTU if it
was less than the MTU, probably to account for the case where
the network interface MTU check returns 0.

New behaviour is to return the supported MSS as MTU minus header length,
using default MTU for this calculation if network interface MTU check
returns 0.

Signed-off-by: Kenny Johansson <wirehell@gmail.com>
2023-04-17 10:17:09 +02:00
Kenny Johansson 76e2b346e5 tests: net: Set explicit loopback MTU for TCP tests
Set explicit loopback MTU for TCP tests for clarity,
 and to avoid breaking tests if changed elsewhere.

Signed-off-by: Kenny Johansson <wirehell@gmail.com>
2023-04-17 10:17:09 +02:00
Kenny Johansson 10386f02f3 tests: net: Add tests for large IPv6 TCP messages
Add tests for lage IPv6 messages, reusing similar IPv4 test structure.

Signed-off-by: Kenny Johansson <wirehell@gmail.com>
2023-04-17 10:17:09 +02:00
Jonathan Rico 6857755292 tests: Bluetooth: fix privacy/device test case
Fixes two problems:

1. bad argument type, leading to wrong test vector values

2. The central side was not verifying the type of the scan report. When
running with a different controller, it was then too quick to stop the
scanner, before the peripheral had received a scan request.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-04-17 10:16:31 +02:00
Alberto Escolar Piedras 26590cbf9e tests bsim EDTT: Remove references to the bridge
The EDTT bridge use was removed in e20862f0e8
Now the EDTT bsim transport connects directly to the simulated
devices.
So let's change the code and comments accordingly.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-04-17 10:16:22 +02:00
Amit Kucheria 15191192c9 input: Add header file to the longpress example
Add the header file required for the example to work. Users get the
following error due to unresolved INPUT_BTN_* values otherwise:

parse error: expected number or parenthesized expression

Signed-off-by: Amit Kucheria <amitk@kernel.org>
Signed-off-by: Amit Kucheria <amit@mbedrock.com>
2023-04-17 10:16:07 +02:00
Krzysztof Kopyściński 893de36842 Tests: Bluetooth: Mesh: Add BLOB Server persistent storage BSim tests
These tests stop BLOB Transfer after BLOB Server reaches every phase
by rebooting devices. After restart, Server recovers transfer and client
continues to the next one. On second pass, Server stops after first
block completes and suspends itself, and after reboot continues to
completion.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2023-04-17 10:15:56 +02:00
Krzysztof Kopyściński 0d5c33b045 Bluetooth: Mesh: Fix recovery of WAITING_FOR_START BLOB Server state
If device running BLOB Server called `bt_mesh_blob_srv_recv`,
but rebooted before it received `XFER_START` message from BLOB Client,
it was wrongly "recovered" into Suspended phase, which would lead to
Server try to resume transfer on `XFER_START`. It would not be possible,
because `srv->state.xfer` was not set with acual values yet.

Set phase again to BT_MESH_BLOB_XFER_PHASE_WAITING_FOR_START, which will
allow to accept new transfer.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2023-04-17 10:15:56 +02:00
Marc Desvaux 3392eb6af3 drivers: hwinfo: modification into hwinfo_get_reset_cause()
add retrieve flag SB into hwinfo_get_reset_cause()
add Clear flag SB into clear_reset_cause()

Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
2023-04-17 10:15:35 +02:00
Marc Desvaux cbd9e2172f samples: boards: stm32: pm: standby_shutdown: use hwinfo_get_reset_cause()
use hwinfo_get_reset_cause() instead of LL_PWR_IsActiveFlag_SB()
remove LL_PWR_ClearFlag_WU() not  mandatory

Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
2023-04-17 10:15:35 +02:00