Commit graph

91496 commits

Author SHA1 Message Date
Gerard Marull-Paretas
01b43074ab modules: hal_nordic: add support for EGU020
Add HAL glue code to support EGU020.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Gerard Marull-Paretas
bc53031824 dts: nordic: nrf54h20_enga: add EGU node
Add node for EGU (Event Generator Unit).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Gerard Marull-Paretas
9c6f47d786 dts: nordic: nrf54h20_enga: add COMP node
Add node for COMP (comparator).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Gerard Marull-Paretas
f1a352d00f dts: nordic: nrf54h20_enga: add TEMP node
Add nodes for the TEMP (temperature sensor) peripheral.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Gerard Marull-Paretas
735ee4c83a dts: nordic: nrf54h20_enga: add NFCT node
Add node for the NFCT (Near Field Connect Tag) peripheral.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Gerard Marull-Paretas
720719cf80 dts: nordic: nrf54h20_enga: add QDEC nodes
Add nodes for QDEC (Quadrature Decoder).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Gerard Marull-Paretas
010519c8e3 dts: nordic: nrf54h20_enga: add TWIM nodes
Add nodes for I2C/TWIM.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Gerard Marull-Paretas
e5ef767ab2 dts: nordic: nrf54h20_enga: add SPIM nodes
Add SPIM (SPI with EasyDMA) nodes.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Gerard Marull-Paretas
f77b30fa17 soc: nordic_nrf: add support for RTC130-131
Add new Kconfig options for RTC130-131 so that the new instances can be
used.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Gerard Marull-Paretas
3dd2b0d8b3 modules: hal_nordic: add support for RTC130-131
Add new HAL glue Kconfig options for RTC130-131.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Gerard Marull-Paretas
35fecb731a dts: nordic: nrf54h20_enga: add RTC nodes
Add RTC (Real Time Counter) node.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Gerard Marull-Paretas
07d961c112 soc: nordic_nrf: add support for TIMER020-022|120-121|130-137
Add new Kconfig options so that new TIMER instances can be used.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Gerard Marull-Paretas
7dd9853382 modules: hal_nordic: add support for TIMER020-022|120-121|130-137
Add new HAL glue Kconfig options so that new TIMER instances can be
used.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Gerard Marull-Paretas
083bf7e549 dts: nordic: nrf54h20_enga: add TIMER nodes
Add nodes for TIMER peripherals (Timer/Counter).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Gerard Marull-Paretas
5adbac51ab dts: nordic: nrf54h20_enga: add missing UARTE nodes
Add missing UARTE nodes.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Gerard Marull-Paretas
04025d87db dts: nordic: nrf54h20_enga: current-speed needs to be set by boards
This is a setting that depends on the board or application, so it should
not be part of SoC definition files.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-27 12:36:54 +01:00
Christopher Friedt
c5ba34ec90 tests: posix: common: add a testsuite for pthread_mutexattr_t
Add a testsuite for testing pthread_mutexattr_t related
functions.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-27 06:11:03 -05:00
Christopher Friedt
ec27e8875d posix: mutexattr: improvements for pthread_mutexattr_t
Previously, pthread_mutexattr_gettype() and
pthread_mutexattr_settype() were non-conformant and also
less safe, as they would not check whether a pthread_mutexattr_t
had been initialized prior to manipulating them. Furthermore,
they would potentially dereference NULL pointers.

Additionally, move the pthread_mutexattr_init() and
pthread_mutexattr_destroy() functions to the library, and add
some level of checking to them so that they are more than simply
static inline / no-op calls.

Lastly, reduce the size of struct pthread_mutexattr to only
what is necessary (one byte should suffice).

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-27 06:11:03 -05:00
Christopher Friedt
986e8f0ac4 tests: posix: mutex: init and destroy mutexattr properly
Previously, the mutex attribute was not initialized prior to its
first use or subsequently destroyed.

Ensure that it is initialized by calling
pthread_mutexattr_init() and destroyed by calling
pthread_mutexattr_destroy().

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-27 06:11:03 -05:00
Grzegorz Ferenc
7645890af6 doc: ram_report: hidden and no paths
Added information about Hidden and No paths.
Made minor style edits to the page.

Signed-off-by: Grzegorz Ferenc <Grzegorz.Ferenc@nordicsemi.no>
2024-02-27 11:38:30 +01:00
Gerard Marull-Paretas
f0b975032a drivers: misc: nordic_vpr_launcher: fix address handling
When CONFIG_XIP=y, execution address may come from a partition, so its
absolute address is needed. Fix code by using VPR_ADDR() macro in all
cases: execution and source addresses.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-26 21:39:30 +01:00
Matthias Alleman
4a72cb16cf net: mgmt: Fix for wrong IPV6 DHCP event code
Fix wrong net event base for ipv6 dhcp events

Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
2024-02-26 15:13:15 +01:00
Tomi Fontanilles
a738bfa7f4 net: l2: ppp: ipv6cp: add assert to check the link address length
This ensures that the configured link address is
at least as big as the part of it that is used.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-02-26 14:43:07 +01:00
Pavel Vasilyev
d1da07144e tests: bsim: bluetooth: mesh: Add short delay before suspending stack
The stack manages to suspend the advertiser before it finishes
transmitting the Outbound PDU Report message to confirm the transmission
of a Provisioning PDU. The test requires the server to become
unresponsive when the Provisioning PDU is sent to the unprovisioned
device to test timeout of the provisioning protocol.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-02-26 14:34:58 +01:00
Pavel Vasilyev
febff796bb Revert "bsim: Bluetooth: Mesh: fix provision timeout"
This reverts commit c1bbd48659.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-02-26 14:34:58 +01:00
Pavel Vasilyev
d6ce3e88b6 tests: bsim: bluetooth: mesh: Suspend advertiser from the start callback
Now, when the deadlock is removed from `bt_mesh_adv_disable` function,
the advertiser can be disabled from the `bt_mesh_send_cb`
callbacks.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-02-26 14:34:58 +01:00
Pavel Vasilyev
4c9ee14572 Bluetooth: Mesh: Allow to suspend mesh from bt_mesh_send_cb callbacks
This commit allows to suspend the mesh stack from `bt_mesh_send_cb`
callbacks by removing the deadlock caused by `k_work_flush` in the
extended advertiser.

In case of the extended advertiser there are 2 cases:
- when the `bt_mesh_adv_disable` is called from any of `bt_mesh_send_cb`
  callbacks which are called from the advertiser work item, or
- when it is called from any other context.

When it is called from `bt_mesh_send_cb` callbacks, since these
callbacks are called from the delayable work which is running on the
system workqueue, the advertiser can check the current context and its
work state. If the function is called from the advertiser work, it can
disable the advertising set straight away because all ble host APIs have
already been called in `adv_start` function. Before sending anything
else, the advertiser checks the `instance` value in `adv_start`
function, which is also reset to NULL in `bt_mesh_adv_disable` call, and
aborts all next advertisements. The `ADV_FLAG_SUSPENDING` tells the
advertiser work to abort processing while `bt_mesh_adv_disable` function
didn't finish stopping advertising set. This can happen if the work has
been already scheduled and the schedler ran it while sleeping inside
the `bt_le_ext_adv_stop` or `bt_le_ext_adv_disable` functions.

When `bt_mesh_adv_disable` is called from any other context or from the
system workqueue but not from the advertiser work, then `k_work_flush`
can be called safely as it won't cause any deadlocks.

The `adv_sent` function is inside the `bt_mesh_adv_disable` function to
schedule the advertiser work (`send_pending_adv`) and abort all pending
advertisements that have been already added to the pool.

In case of the legacy advertiser, if the `bt_mesh_adv_disable` is called
form the advertiser thread (this happens when it is called from
`bt_mesh_send_cb.start` or `bt_mesh_send_cb.end` callbacks), then
`k_thread_join` returns `-EDEADLK`. But the `enabled` flag is set to
false and the thread will abort the current advertisement and the
pending advertisements.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-02-26 14:34:58 +01:00
Rubin Gerritsen
360d49a348 samples: bluetooth: iso: Extend sample documentation
Extend the sample documentation for the central and peripheral
iso samples so that they become easier to get started with.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-02-26 14:34:07 +01:00
Rubin Gerritsen
ffabb09c1a samples: bluetooth: central_iso: Remove the CONFIG_BT_SMP=y
Some SoCs in the nRF52 series do not support encrypting and decrypting
isochronous channels packets.

To make it easier to get started with the central_iso sample,
we want to turn of SMP by default. Without this config,
the sample still serves its purpose.
Encrypting the isochronous channel is as simple as
enabling BT_SMP.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-02-26 14:34:07 +01:00
Rubin Gerritsen
f086afd47c samples: Bluetooth: Only connect to devices with rssi below -50
When the Bluetooth central samples in an open air environment
it is very likely that there are multiple devices nearby with
a received signal strength stronger than -70 dBm.

To avoid connecting to the wrong device, make the check stricter.

For tests using those samples, the NtNcable attenuation is changed
from the default 60 dBm to 40 dBm to satisfy the new requirement.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-02-26 14:34:07 +01:00
Abderrahmane Jarmouni
4affeaab20 drivers: serial: uart_stm32: fix for async_rx_buf_rsp
uart_stm32_async_rx_buf_rsp() does not return the necessary errors when
rx_next_buffer is already set & when async uart rx is disabled.
This patch was submitted by @mkaranki

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-02-26 14:30:27 +01:00
Christopher Friedt
1a3bb3fd5c posix: mqmeue: do not return NULL after pthread_exit()
pthread_exit() does not return and therefore it does not make
sense to return NULL after it in mq_notify_thread(), and that
would constitute dead code.

Rather than explicitly exiting the thread, simply return
gracefully from the thread function, and allow the pthread to
terminate in the usual way.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-26 08:12:29 -05:00
Benjamin Cabé
9d1df132b1 script: gen_isr_tables: remove unnecessary warning log
Remove a message that had a typo in it but, more importantly that was
not needed.
The CONFIG_ISR_TABLES_LOCAL_DECLARATION already selects EXPERIMENTAL so
a user is properly alerted about the consequences just like any other
EXPERIMENTAL features if they enable WARN_EXPERIMENTAL.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-02-26 11:55:59 +00:00
Pavel Vasilyev
a35bb6608d settings: nvs: Fix first write issue with cache
Issue:

When the setting nvs cache is disabled and `settings_nvs_save` is
called, the function reads all stored setting name entries from NVS
until either finds the desired setting name entry or reaches the last
stored setting name entry.

With the settings nvs cache enabled, `settings_nvs_save` runs through
the cached setting name entries first. If the cached entry matches with
the desired one, it immediately writes the new setting value to NVS
that corresponds to the cached setting name entry.

However, if the setting name entry is not found in the cache (which is
the case for a new entry), `settings_nvs_save` reads all stored setting
name entries from NVS again. This means that even if the number of
stored entries in the settings is less than the cache size, for each
new setting entry to be stored `settings_nvs_save` will first run
through the cache, then read all stored setting name entries from NVS
and only then will pick the next free name id for this new setting name
entry and will finally store the new setting entry.

This makes the cache ineffiсient for every new entry to be stored even
when the cache size is always able to keep all setting entries that will
be stored in NVS.

Use-case:

In the Bluetooth mesh there is a Replay Protection List which keeps
sequence numbers of all nodes it received messages from. The RPL is
stored persistently in NVS. The setting name entry is the source
address of the node and the setting value entry is the sequence number.
The common use case is when RPL is quite big (for example, 255 entries).

With the current settings nvs cache implementation, every time the node
stores a new RPL entry in settings (which is the first received message
from a particular source address), `settings_nvs_save` will always check
the cache first, then also read all stored entries in NVS and only then
will figure out that this is a new entry. With every new RPL entry to be
stored this search time increases. This behavior results in much worse
performance in comparison with when the corresponding entry was already
stored. E.g. on nRF52840, with bare minimal mesh stack configuration,
when the cache is bigger than number of stored entries or close to it,
storing of 255 RPL entries takes ~25 seconds. The time of subsequent
store of 255 RPL entires is ~2 seconds with the cache.

Solution:

This commit improves the behavior of the first write by bypassing the
reading from NVS if the following conditions are met:
1. `settings_nvs_load` was called,
2. the cache was not overflowed (bigger than the number of stored
entries).

As long as these 2 conditiones are met, it is safe to skip reading from
NVS, pick the next free name id and write the value immediately.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-02-26 11:55:33 +00:00
Adam Kondraciuk
fd20639c08 modules: hal_nordic: nrfx: Fix DPPI support for nRF54L15
Add required DPPIC interconnect files for nRF54L15 SoC.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-02-26 11:55:10 +00:00
Emil Gydesen
4298b0a267 Bluetooth: BAP: Shell: BA fix add_pa_sync command
The command would attempt to parse the BASE and enter the
subgroup information in a NULL pointer.

The BASE copy was also done incorrectly, as it did not
properly take the UUID into account (which should be
moved to a helper function if we expect users to do this).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-26 11:54:56 +00:00
Dino Li
6b0b63b3a7 ITE: drivers/i2c target mode: Fix racing condition
The finish interrupt after the previous transaction is completed may
occur in the next transaction. To do hardware reset at this time could
potentially lead to the failure of the transaction.
Therefore, removing the hardware reset upon completing the transaction
helps to avoid a race condition.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2024-02-26 11:54:13 +00:00
Brian Moran
b411094b85 shell: Add a configuration for not printing shell messages
The shell currently prints out `: command not found` and
`Please specify a subcommand.` when invalid commands are
sent.

This can cause issues in certain situations, such as if a U-Boot
console in interactive mode is on the other end of the shell's
UART, where the U-Boot console will stop booting the device
if it receives any characters, and it will print out strings that
the shell then sees as commands. This causes the shell to send
out the messages above, preventing the device running
U-Boot on the other end from booting up.

I added the configurations
`CONFIG_SHELL_MSG_SPECIFY_SUBCOMMAND` and
`CONFIG_SHELL_MSG_CMD_NOT_FOUND` to allow disabling
these messages.

Signed-off-by: Brian Moran <brian.moran@sabantoag.com>
2024-02-26 11:53:58 +00:00
Peter Mitsis
ebec1500ff tests: latency_measure: Add condition variables
Adds condition variables to the latency measure benchmark.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-02-26 11:53:44 +00:00
Juha Ylinen
5a9a221687 doc: release-notes: Add lwm2m change
Add new API function lwm2m_set_bulk.

Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
2024-02-26 11:53:29 +00:00
Juha Ylinen
514fb3f245 tests: lwm2m: Add test case
Add test case for lwm2m_set_bulk() function.

Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
2024-02-26 11:53:29 +00:00
Juha Ylinen
884291e533 samples: lwm2m: Set temperature sensor resource values
Add an example how to set multiple resource values using
lwm2m_set_bulk() function.

Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
2024-02-26 11:53:29 +00:00
Juha Ylinen
f38ecb7a09 net: lwm2m: Add API to set multiple resource values
Add new API lwm2m_set_bulk() to set multiple resource values in
one function call.

Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
2024-02-26 11:53:29 +00:00
Emil Gydesen
849dbf40d9 Bluetooth: ISO: Replace UNICAST | BROADCAST with CONN_TX
Replaced checks for
CONFIG_BT_ISO_UNICAST || CONFIG_BT_ISO_BROADCASTER with
CONFIG_BT_CONN_TX, as they are effectively the same.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-02-26 11:52:37 +00:00
Łukasz Duda
6e31820f4c net: ipv6: nbr: Expose API for reporting neighbor reachability
This commit extends Zephyr's networking API to allow higher layers to
report on neighbor reachability.

Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no>
2024-02-26 11:51:42 +00:00
Gerard Marull-Paretas
2dbb4a013b twister: drop riscv32/64 support
riscv32/64 are no longer supported, as both are the same arch: riscv.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-26 12:49:06 +01:00
Gerard Marull-Paretas
6810a53297 twister: s/riscv(32|64)/riscv
Only riscv is supported now, any 32/64-bit requirements need to use
CONFIG_64BIT now.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-26 12:49:06 +01:00
Gerard Marull-Paretas
6c0a5cac06 twister: add support for riscv arch
So that we can stop using the artificial riscv32/64 dual naming. This
patch temporarily allows using both, riscv or riscv32/64.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-26 12:49:06 +01:00
Gerard Marull-Paretas
6884e10fae arch: riscv: always use 'riscv' for CONFIG_ARCH
Because the riscv32/riscv64 is redundant, one can get the same
information combining CONFIG_ARCH + CONFIG_64BIT.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-26 12:49:06 +01:00
Jukka Rissanen
1899c0c5c7 tests: net: ip-addr: Check IPv6 private addresses
Add a test that checks that the private address checker works
as expected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-02-26 11:41:55 +00:00