Commit graph

24,075 commits

Author SHA1 Message Date
Markus Becker
1ac99e8ae0 net: ocpp: fix statically allocated string variables are free'd
Writable string entries in ocpp_cfg_info are free'd if non NULL in
ocpp_set_cfg_val(). Thus they should not be statically allocated.
Initialise with NULL instead.

CFG_SUPPORTED_FEATURE_PROFILE is not writable and should be fine.

Signed-off-by: Markus Becker <markushx@gmail.com>
2026-03-24 10:48:00 -05:00
Markus Becker
b49498507a net: ocpp: Properly copy ocpp_cp_info from cpi to cp
BootNotification did not transport Serial Number and other information,
because the NULL check is wrong.

Signed-off-by: Markus Becker <markushx@gmail.com>
2026-03-24 10:48:00 -05:00
Fin Maaß
b476dec78d console: use zephyr ring buffer
use zephyr ring buffer and also read and write more
than one char at a time.
Also use events to notify new rx or tx.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-03-24 07:08:13 -04:00
Fin Maaß
affed57f2b console: remove selected unneded options
CONFIG_CONSOLE_GETCHAR doesn't need
`CONFIG_UART_CONSOLE_DEBUG_SERVER_HOOKS`
and `CONFIG_CONSOLE_HANDLER` since a long time.
So don't select it unnessesaryly.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-03-24 07:08:13 -04:00
Pieter De Gendt
7b0e88ac61 shell: backends: telnet: Use struct net_sockaddr_storage
A struct net_sockaddr should be considered an incomplete type, replace by
using net_sockaddr_storage.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-03-24 07:07:17 -04:00
Emil Gydesen
d66266dfa7 Bluetooth: GATT: Fix bad error from bt_gatt_attr_read_included
If `attr` or `attr->user_data` is NULL, then the include
characteristic is invalid. However the function,
bt_gatt_attr_read_included, should not return an errno value, but
a GATT error. The reason why errno cannot be used, is that the
return value is parsed through err_to_att which would make
-EINVAL become 0x16 (depending on the libc implementation),
which is an invalid ATT error code.

This was incorrectly introduced by commit
5a8189bf2a.

Changed the return value from errno to a proper GATT/ATT error.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-24 07:07:06 -04:00
Fin Maaß
27cec4c935 net: net_if: make addr in net_if_set_link_addr() const
When providing a addr in net_if_set_link_addr() it should be
constant, as this function should not change the address
in the pointer.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-03-24 07:05:38 -04:00
Alberto Escolar Piedras
87d5f6c9d9 manifest: Update nRF hw models to latest
Update the HW models module to:
63ccab2988bf4c144b3cd324a0277e03206fa413

Including the following:
63ccab2 RADIO: Adjust Tx rampup timings
72d7680 RADIO: Correct note

AND

Adjust Bluetooth controller radio hal timings to match this new timings.

AND

Change the random seed in a very long test which is relatively sensitive
to timing, and fails due to this rampup timing change.

Repeat of note from 63ccab2:
--
IMPORTANT!: This commit changes the timing of the radio model, and
therefore requires controller SW to adjust its constants accordingly.
Even after such an adjustment it is likely some tests timing will change
marginally (if for example some advertisement event anchoring is done
as soon as possible by the controller or the like), and therefore that
some tests execution will change, and that too time sensitive test may
fail.
--

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-03-24 09:54:27 +01:00
Fin Maaß
062facbab2 net: dsa: remove NET_DSA_DEPRECATED
remove the deprecated NET_DSA_DEPRECATED.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-03-23 15:01:57 -05:00
Jan Kowalewski
e69cafdbb4 mgmt: hawkbit: add missing CONFIG_ prefix
Adds missing CONFIG_ prefix to HAWKBIT_USE_STATIC_CERT_TAG ifdef.

Signed-off-by: Jan Kowalewski <jkowalewski@cthings.co>
2026-03-23 15:00:10 -05:00
Tim Pambor
c84c573837 fs: shell: increase max repeat limit for tests
Increase the maximum allowed repeat count for read and write/erase
test commands from 10 to 10000. This allows for more accurate
measurements over longer test durations.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-03-23 14:57:27 -05:00
Jukka Rissanen
f611a4e4d4 net: shell: wg: Add setup command
Add a way to add private key, peer endpoint and keepalive
when setting up the wireguard connection using the shell.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Jukka Rissanen
3af900c600 net: shell: wg: Use SHELL_HELP() macro for help texts
This can save flash usage by allowing string sharing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Jukka Rissanen
6c27239865 net: wg: Make remaining PSA crypto helpers static
Couple of PSA crypto helper functions were not static so fix that.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Jukka Rissanen
688d84b59a net: wireguard: Make blake2s private
Make blake2s private so that it cannot be used (easily) by other parts
of Zephyr codespace. The blake2s is part of the code until PSA will
have support for it. At that point the code will be removed and
replaced by the PSA calls.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Jukka Rissanen
684653fd04 net: wireguard: Use PSA key management
Instead of using buffers for keys, use PSA key management to
store the keys. This is more safe than handling buffers in
the code directly.

Do some cleanup of the code structure and make the functions
in wg_psa.c static to disallow use outside of Wireguard.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Jukka Rissanen
dbcf7ef5e2 net: wireguard: Support RTC with native_sim board
If running wg in native-sim, use the host clock to get the
current time. This helps to have a proper handshake when
connecting even after restarting the zephyr.exe process.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Jukka Rissanen
984ddc51c1 net: wireguard: Make getting current time extensible
Allow user to provide a function that will need to get
the current time from a RTC or SNTP or similar.
Wireguard handshake replay prevention needs a monotonic
time so the application should get it from somewhere.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Jukka Rissanen
7a8348af4b net: wireguard: Send network events for VPN activity
Send peer add/del network event when the peers is either added
to the system or deleted from the system.
Send VPN connected / disconnected event when a VPN connection
is successfully established or the peer connection is disconnected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Jukka Rissanen
d09cee002f net: shell: wg: Print detailed peer information
The "net wg show 1" will show detailed information of the peer
id 1. This is useful when debugging connectivity issues.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Jukka Rissanen
d4020814e2 net: shell: wg: Add VPN statistics support
Show VPN statistics support if enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Jukka Rissanen
14ced6a59f net: wireguard: stats: Add statistics support
Collect Wireguard VPN statistics and allow user to fetch it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Jukka Rissanen
cf40236791 net: shell: Add Wireguard VPN support
Add commands to manipulate Wireguard connectivity.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Jukka Rissanen
bcffe6a0e1 net: wireguard: Add crypto support
The crypto code is taken from wireguard-lwip project at
https://github.com/smartalock/wireguard-lwip
and is BSD-3-Clause licensed code.

The Blake2 RFC 7693 and XChaCha20 (from
https://datatracker.ietf.org/doc/html/draft-arciszewski-xchacha-03)
cannot currently use PSA APIs.

The XChaCha20 is found in PSA 1.2 but Zephyr is not yet using that
version.

All the other crypto usage is converted to use PSA APIs.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Jukka Rissanen
598806fe26 net: wireguard: Add DiffServ DSCP values
As described in https://www.wireguard.com/protocol/
set DSCP to AF41 for handshake messages. The transport data
DSCP is set to 0.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Jukka Rissanen
a239800f1a net: wireguard: Add initial implementation
Wireguard is a VPN implementation. See https://www.wireguard.com/
for details.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-23 13:58:58 -04:00
Emil Gydesen
ec15acb69c Bluetooth: BAP: Add callback and subscribe of supported ctxs
The supported contexts were read but never provided to the
upper layers. Additionally if the supported contexts are
notifible we also subscribe to it.

This commit also fixed some other various things related
to the change to supported contexts.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 12:33:18 -05:00
Fabio Baltieri
d0067a18c9 shell: add missing dependency for KERNEL_THREAD_SHELL_UNWIND
The option needs a dependency to THREAD_MONITOR, fix a build breakage
with, for example:

west build -p -b nrf52dk/nrf52832 samples/subsys/shell/shell_module -- \
-DCONFIG_EXTRA_EXCEPTION_INFO=y -DCONFIG_THREAD_MONITOR=n

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2026-03-23 12:32:52 -05:00
Chaitanya Tata
449ad67f19 net: l2: wifi: Add band info to set channel
With 6GHz band, channel numbers are not unique anymore, channel 1 can
mean both 2.4GHz or 6GHz, so, take the band info as the argument from
the user.

Keep auto-detection for backwards compatibility sake.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Assisted-by: Cursor:Auto
2026-03-23 12:32:25 -05:00
Josuah Demangeon
8d7bb597fc usb: uvc: use uvc_device_ in API and add _enable()/_shutdown()
Use a different API call to complete the function rather than
relying on USB .init() to terminate the configuration.
This allows to set the endpoint descriptors before usbd_init()
is called.

Signed-off-by: Josuah Demangeon <josuah.demangeon@nordicsemi.no>
2026-03-23 12:31:57 -05:00
Tomasz Leman
465f488b6a logging: mtrace: Enable thread ID prefix support
Add support for the LOG_OUTPUT_FLAG_THREAD flag in the ADSP mtrace
backend's format_flags() function. When CONFIG_LOG_THREAD_ID_PREFIX is
enabled, this allows log messages to display the thread name or ID as a
prefix.

This enables displaying information about running threads and their
priorities, which can be useful debug information for analyzing system
behavior and thread execution patterns.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2026-03-23 12:31:00 -05:00
Tomasz Leman
4f7a485af7 logging: mtrace: Enable core ID prefix support
Add support for the LOG_OUTPUT_FLAG_CORE flag in the ADSP mtrace
backend's format_flags() function. When CONFIG_LOG_CORE_ID_PREFIX is
enabled, this allows log messages to display the originating CPU core ID
as a prefix.

This is particularly useful in multicore ADSP systems where deferred
logging may format messages on a different core than where they were
created. The core ID prefix helps identify which core generated each log
message.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2026-03-23 12:31:00 -05:00
Tomasz Leman
e254a97cf1 logging: add CONFIG_LOG_CORE_ID_PREFIX for multicore systems
Add support for displaying the CPU core ID that generated each log
message. This is particularly useful for debugging multicore embedded
systems where identifying the originating core is critical.

Key implementation details:
- Add CONFIG_LOG_CORE_ID_PREFIX Kconfig option (depends on SMP or
  MP_MAX_NUM_CPUS > 1)
- Capture arch_proc_id() at log message creation time to ensure the
  correct core ID is recorded, even when log processing happens on a
  different core
- Add core_id field to log_msg_hdr structure
- Add LOG_OUTPUT_FLAG_CORE flag (BIT 9)
- Display format: "[core %d]" prefix in log output
- Add log_msg_get_core_id() accessor function

The core ID is captured when the log message is created (not when
formatted), which is essential for deferred logging where the processing
thread may run on a different core than the one that generated the log.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2026-03-23 12:31:00 -05:00
Tony Han
587c212277 subsys/mgmt: declare PROCESSOR_NAME for arm926ej-s
Add the declaration of PROCESSOR_NAME for arm926ej-s CPU.

Signed-off-by: Tony Han <tony.han@microchip.com>
2026-03-23 12:27:55 -05:00
Andrzej Głąbek
db6409f473 sd: mmc: Respect host limits when changing bus frequency
Take into account the maximum frequency indicated in host capabilities
when changing the bus frequency, to avoid failing calls to sdhc_set_io()
when an MMC device is capable of working with higher frequencies than
the host can handle.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2026-03-23 10:40:22 -04:00
Emil Gydesen
0962ac8759 Bluetooth: TBS: Make originate consistent between local and remote
If we get a remote request to originate a call via a control
point write, we lookup a TBS instance based on the URI.
However for the local API function bt_tbs_originate we did
not, so the same operation, if the target bearer was GTBS,
had different behavior depending on whether it was locally or
remotely invoked.

This commit makes the two behave the same.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 10:40:11 -04:00
Szymon Janc
49edc839d2 bluetooth: host: Allow to tune L2CAP RTX timer value
This allows to tune L2CAP RTX timer value for L2CAP connection
requests. Allowed range is 1-60 seconds while defaults to 40.
Since this is mainly useful for BI (behavior invalid) qualification
tests allows to tune it only if BT_TESTING is selected.

This is required for running L2CAP/COS/CED/BI-29-C qualification
test in reasonable time since it requires 255 iterations of
failed (timed out) connection requests.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2026-03-23 10:37:57 -04:00
Szymon Janc
8617f73e16 bluetooth: host: Fix typo in Kconfig.l2cap description
This is for L2CAP options.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2026-03-23 10:37:57 -04:00
Maximilian Zimmermann
69e2ab8152 Bluetooth: TBS: clear pending GTBS notifications on disconnect
Add missing notification clearing for the GTBS instance
in the disconnected callback.

Fixes #104568

Signed-off-by: Maximilian Zimmermann <gitmz@posteo.de>
2026-03-23 08:56:23 -04:00
Hanliang Xu
baaf8fb0b4 Bluetooth: TBS: Clear pending notifications on unsub
If the client removes its subscription to any of the TBS
characteristics at any time, the pending appropriate flags
are now being cleared.

Fixes zephyrproject-rtos/zephyr#104511

Signed-off-by: Hanliang Xu <leonxu2004@outlook.com>
2026-03-23 08:56:14 -04:00
Emil Gydesen
4cf2cc054d Bluetooth: BAP: Dont attempt disconnect on detach
This removes dead code. Since bt_bap_stream_detach sets
stream->ep = NULL then the call to bt_bap_stream_iso_chan_get
will always return NULL since stream->ep is NULL, and thus
the call to bt_bap_stream_disconnect would always be a no-op.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 08:56:05 -04:00
Emil Gydesen
2b198cf2cc Bluetooth: Audio: Make "foreach" functions consistent
Modify foreach functions in LE Audio to follow the same pattern:
Return true to continue iterating.
Return false to stop iterating.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 08:53:33 -04:00
Emil Gydesen
c9a0257e8f Bluetooth: Host: Replace CHECKIF with if
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 08:49:13 -04:00
Emil Gydesen
735f101c95 Bluetooth: Mesh: Remove checks in bt_rand
Remove the NULL and 0-length checks in bt_rand, as they
are probably not necessary.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 08:49:02 -04:00
Emil Gydesen
8070ee277b Bluetooth: Mesh: Replace CHECKIF with if
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 08:49:02 -04:00
Savo Saicic
e7038cb864 net: lwm2m: add IPSO Magnetometer object support
Add support for the IPSO Magnetometer object version 1.0 (Object ID
3314) which allows an LwM2M server to read magnetic field values from
a 1-3 axis magnetometer.

The object is enabled in tests/net/all/prj.conf to ensure it is
built as part of the CI all-in networking build.

Signed-off-by: Savo Saicic <savo.saicic@gmail.com>
2026-03-23 08:48:35 -04:00
Emil Gydesen
60f8fac0dd Bluetooth: Classic: Replace CHECKIF with if
The usage of CHECKIF has been replaced with a regular
if. The reason for this is that higher layer may depend
on some of the checks defined by the API, and the higher
layers cannot do that properly if the checks can be
removed via a Kconfig option.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 10:25:36 +01:00
Pisit Sawangvonganan
2ea93f9e10 bluetooth: fix typo
Use a code spell-checking tool to detect and fix spelling errors in
the files under `subsys/bluetooth`.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-03-23 10:25:26 +01:00
Emil Gydesen
e35cc4e6cd Bluetooth: CCP: Make CCP server thread safe
Guard any calls that accesses the bearer with a mutex

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-23 10:15:25 +01:00
Joel Holdsworth
a737213c98 tests: Add basic test-set for OpenRISC architecture port
The OpenRISC 1000 architecture can be tested through the qemu_or1k emulated
SoC and board. Because this emulated device has minimal external hardware
by default, this patch enables a minimal suite of tests covering core
kernel features for the CPU architecture.

When running the test suite, OpenRISC was found to require additional stack
space to prevent an overflow. Therefore, a minimal additional amount of
storage: 128-bytes, was added that was found in practice to allow tests to
complete.

Note that Qemu version 9.2.0 or newer is required so as to include the
following commit:

    commit 3eb43aeb164f1f83c97ff693c7d464b49755110c
    Author: Joel Holdsworth <jholdsworth@nvidia.com>
    Date:   Fri Jun 7 15:29:33 2024 -0700

        hw/openrisc: Fixed undercounting of TTCR in continuous mode

This fixes a bug in the implementation of the emulated OpenRISC Tick Timer
which prevents the Zephyr OpenRISC port from task-scheduling properly.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2026-03-21 07:50:57 -05:00