Commit graph

21541 commits

Author SHA1 Message Date
Neal Jackson
d07f8eed55 mgmt: hawkbit: do not prepend custom controllerId
This commit changes how the controllerId is generated based on device
id, and disentangles the two. The controllerId is what hawkbit uses to
uniquely identify a device, and is not necessarily the same as the
device id, and should be fully customizeable by the user if needed.
Previously, all custom device ids were being prepended with
`CONFIG_BOARD`. When a user selects `CONFIG_HAWKBIT_CUSTOM_DEVICE_ID`,
they should be able to specify the full controllerId used with hawkbit,
without a forced prepend.

Signed-off-by: Neal Jackson <neal@blueirislabs.com>
2025-05-28 11:09:10 +02:00
Vinayak Kariappa Chettimada
ff26592272 Bluetooth: Controller: Remove conn context NULL check
Remove conn variable NULL check before calling
ull_cp_release_tx() to support conditional compilation of
LLCP_TX_CTRL_BUF_QUEUE_ENABLE variant.

Relates to commit 1ff458ec87 ("Bluetooth: controller:
llcp: fixing tx buffer queue handling").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-05-28 11:09:01 +02:00
Vinayak Kariappa Chettimada
c3f107596a Bluetooth: Controller: Add ll_conn_get() return value check
Add ll_conn_get() return value check for valid connection
context.

Build command:
cmake -GNinja -DBOARD=nrf52833dk/nrf52833
 -DEXTRA_CONF_FILE=overlay-all-bt_ll_sw_split.conf
 -DDTC_OVERLAY_FILE=boards/nrf52833dk_nrf52833_df.overlay
 -DSNIPPET="bt-ll-sw-split" ../../samples/bluetooth/hci_uart
ninja

Before:
Memory region         Used Size  Region Size  %age Used
           FLASH:      283716 B       512 KB     54.11%
             RAM:      109752 B       128 KB     83.73%
        IDT_LIST:          0 GB        32 KB      0.00%

After:
Memory region         Used Size  Region Size  %age Used
           FLASH:      284992 B       512 KB     54.36%
             RAM:      109752 B       128 KB     83.73%
        IDT_LIST:          0 GB        32 KB      0.00%

After (use of `conn != NULL`):
Memory region         Used Size  Region Size  %age Used
           FLASH:      285044 B       512 KB     54.37%
             RAM:      109752 B       128 KB     83.73%
        IDT_LIST:          0 GB        32 KB      0.00%

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-05-28 11:09:01 +02:00
Vinayak Kariappa Chettimada
a396bdd30a Bluetooth: Controller: Fix missing connection handle invalidate
Fix missing connection handle invalidate on Controller
power up.

The connection context are zero-initialized on startup and
calls to `ll_connected_get()` would incorrectly return a
valid connection context pointer for connection handle 0.

Relates to commit fa02dc4d02 ("Bluetooth: Controller: Fix
missing reset of connection handle").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-05-28 11:09:01 +02:00
Neal Jackson
2ef1ddea73 mgmt: hawkbit: interface support for ip addresses and domain name
Previously, hawkbit interface only supported a url/hostname and a port,
and internally it resolves to an IP address. This does not work for
network layers that rely on NAT64, like OpenThread.  Zephyr's
implementation of `getaddrinfo` is not aware of NAT64.  DNS will resolve
an IPV4 address that needs to be converted to IPV6 with the NAT64
prefix.

This commit alters the Hawkbit interface to allow providing an explicit
domain name as a string via `server_domain`, and an already resolved IP
address as `server_addr`.

This commit changes the usage of `hawkbit_runtime_config.server_addr` to
point to either an IP address or domain name. It adds a new Kconfig
(`HAWKBIT_USE_DOMAIN_NAME`) to specify an explicit domain name and adds
a new variable `hawkbit_runtime_config.server_domain`. If
`HAWKBIT_USE_DOMAIN_NAME` is enabled and a user provides an IP address
to `server_addr`, the user must provide a domain name to
`server_domain`.

Signed-off-by: Neal Jackson <neal@blueirislabs.com>
2025-05-28 11:08:53 +02:00
Jukka Rissanen
e44ed8dbb8 net: ipv6: Make sure we do not access link address past array length
It is possible to manually set link address length past 6 at runtime
and trying to generate IPv6 IID address that way. This should fail
as we could read two bytes past the address buffer. There is no issues
in the copying as the target buffer has plenty of space.

Coverity-CID: 516232

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-05-28 10:05:21 +02:00
Alberto Escolar Piedras
da6742b776 subsys/fs/fuse: Fix adding missing stddef header
Instead of relaying on stddef.h being included by other headers
let's include it explicitly, following a report of it being
missing for Ubuntu 22.04 (glibc 2.35)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-05-28 01:48:13 +02:00
Vytautas Virvičius
087267a0ff drivers: modem: add support for Quectel EG800Q
Added support for Quectel EG800Q LTE Cat 1bis modem.

Signed-off-by: Vytautas Virvičius <vytautas@virvicius.dev>
2025-05-28 01:47:56 +02:00
Fin Maaß
4d7e35be1c mgmt: hawkbit: reset action ID after successful update report
reset action ID after successful update report.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-05-27 16:45:21 +02:00
Mark Wang
18c18c6905 bluetooth: shell: pairing_accept callback access NULL pointer
pairing_accept callback is called with feat as NULL in
the bt_hci_io_capa_req.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-05-27 16:44:28 +02:00
Szymon Janc
5e0d3cce8b Bluetooth: Host: L2CAP: Fix checking signaling packets size
Recent test specification added additional test for validating
invalid packet sizes on L2CAP signaling channel. IUT is allowed
to either disconnect link, ignore packet, reject packet or
issue a warning to upper tester if other action is taken.

To keep things in line with previous check for too small size
simply ignore fixed size packets of invalid length.

This was affecting L2CAP/COS/CED/BI-11-C qualification test.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-05-27 16:44:17 +02:00
Tomi Fontanilles
18b14e7a2c secure_storage: its: transform: improve expandability
Instead of checking whether a custom implementation is present, check
whether the AEAD one is used.
This allows downstream users to expand the implementation choice with
more options.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-05-27 15:46:37 +02:00
Tomi Fontanilles
001d054bc3 secure_storage: its: make definitions available outside of transform.h
Some ITS store module implementations may make use of them.
This is the case of the custom one in the
secure_storage.psa.its.secure_storage.custom.store test.

Instead of making transform.h conditionally available, move the definitions
to common.h and simply make them available whenever the ITS transform
module is enabled.

At the same time, remove unneeded/redundant includes/build asserts.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-05-27 15:46:37 +02:00
Tomi Fontanilles
9379678fcf secure_storage: its: transform: aead: improve expandability
Instead of checking for CONFIG_SECURE_STORAGE_ITS_TRANSFORM_AEAD_*_CUSTOM,
check for any of the existing providers.
This allows downstream users to expand the choices with more options

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-05-27 15:46:37 +02:00
Tomi Fontanilles
b87befb36b secure_storage: its: improve return codes
Some minor improvements.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-05-27 15:46:37 +02:00
Emil Gydesen
52f089af23 Bluetooth: CSIP: Set member: Fix issue with re-registration
The bt_csip_set_member_register kept a counter that was not
decreased when bt_csip_set_member_unregister was called.
This meant that we could register and unregister CSIS,
but we could not re-register once it had been unregistered.

This commit fixes this by removing the counter and instead
rely on the service instance state, which also requires restoring
the original service definition, as well as adding a test that would
have failed with the previous version.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-05-27 14:45:15 +02:00
Flavio Ceolin
437b56d22e pm: device_runtime: Make async optional
Async now uses its own work queue, which means it consumes more
resources. Since not all applications need the async API, we can make
it optional without any penalty for those applications.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-05-27 14:45:07 +02:00
Flavio Ceolin
64e38bab55 pm: device_runtime: Allow to use a dedicated wq
Device runtime is using the system workqueue to do operations
that are mostly blockers (suspend a device). This should not happen.

This commit adds an option to use dedicated queue for the device runtime
async operations.

The test for this API was assuming that the system workqueue
priority (which is cooperative) so we need to change the test priority
to be lower than the device runtime workqueue priority.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-05-27 14:45:07 +02:00
Emil Gydesen
f24ba75aba Bluetooth: BAP: BA: Add check for mixing NO_PREF with specific BIS
Based on a dicussion on the Bluetooth SIG GAWG reflector, it is
not allowed for a broadcast assistant to request specific BIS
indexes as well as BT_BAP_BIS_SYNC_NO_PREF in the same
request.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-05-27 12:02:16 +01:00
Emil Gydesen
de4752c393 Bluetooth: BAP: SD: Add check for mixing NO_PREF with specific BIS
Based on a dicussion on the Bluetooth SIG GAWG reflector, it is
not allowed for a broadcast assistant to request specific BIS
indexes as well as BT_BAP_BIS_SYNC_NO_PREF in the same
request.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-05-27 12:02:16 +01:00
Chen Tao
b513e08271 net: wifi: fix the bug by non-wifi network call
Added network type check to fix the system crash caused by non-wifi
network card calling wifi api interface

Company:BSH Crop
Signed-off-by: Chen Tao <ct05342@163.com>
2025-05-27 11:51:23 +02:00
Damian Krolik
391290e67d net: shell: udp: allow sending packet when bound
"udp bind" and "udp send" commands use the same net context
variable and they fail early if the context is already used.

This prevents from using "udp send" after "udp bind", which
makes the commands hard to use for testing bidirectional
communication. Make "udp send" reuse the already bound
context if possible, and resort to allocating temporary one
otherwise.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2025-05-27 11:51:11 +02:00
Lyle Zhu
81141b1618 Bluetooth: Shell: Improve command bt connections to support BR conn
When execute `bt connections`, only the peer device address of selected
LE connection is flagged with `*`.

Improve the command `bt connections` to support BR connections.
Regardless of the connection type, `*` will be shown to indicate the
peer address of the current connection if the peer device address is
the peer address of selected connection.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-05-27 11:50:58 +02:00
Neal Jackson
f9701a1a21 mgmt: hawkbit: remove DNS_RESOLVER requirement for server_addr
This commit removes the requirement for DNS_RESOLVER. If DNS_RESOLVER is
enabled, hawkbit uses `CONFIG_DNS_RESOLVER_MAX_QUERY_LEN` for the
server_addr buffer, if disabled it uses `CONFIG_INET6_ADDRSTRLEN`.
This adheres to #89533 which removes the requirement for DNS_RESOLVER.

Signed-off-by: Neal Jackson <neal@blueirislabs.com>
2025-05-27 11:50:52 +02:00
Neal Jackson
64de800aa9 mgmt: hawkbit: use sizeof in server_addr length checks
Simplify length checks by using sizeof for the server_addr array.

Signed-off-by: Neal Jackson <neal@blueirislabs.com>
2025-05-27 11:50:52 +02:00
Neal Jackson
d9be126eca mgmt: hawkbit: add check for valid domain name length
This commit adds a `strnlen` length check for `server_addr` to ensure that
it will not be truncated and result in a silent failure. Instead, the
call to `hawkbit_set_config` will return -EINVAL if the supplied
`server_addr` is too long for the internal buffer.

Signed-off-by: Neal Jackson <neal@blueirislabs.com>
2025-05-27 11:50:52 +02:00
Neal Jackson
f75a11d22a mgmt: hawkbit: replace DNS_MAX_NAME_SIZE with DNS_RESOLVER_MAX_QUERY_LEN
The hawkbit subsystem was erroneously using DNS_MAX_NAME_SIZE as the
maximum query length. This limited query strings to only 20 bytes,
truncating many domain names.

Signed-off-by: Neal Jackson <neal@blueirislabs.com>
2025-05-27 11:50:52 +02:00
Jianxiong Gu
0a8aa23c7c usbc: Enable VBUS measurement before VBUS check level
Enable VBUS measurement before checking the VBUS level and
disable it when unattached.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-05-27 11:50:29 +02:00
Shrek Wang
b5a31dcb49 net: tcp: Move the CLOSED state to the front
In enum tcp_state {}, the CLOSED state was put at the last one.
When we do Sequence & Ack validation, we will need to skip the
CLOSED, LISTEN, SYNSENT states. It is easier for coding if we
put the CLOSED to the front, e.g. if state > SYNSENT. And, in
other OSes, the state sequence is normally defined like this.

Signed-off-by: Shrek Wang <inet_eman@outlook.com>
2025-05-27 06:51:46 +02:00
Yonas Alizadeh
440de0dde0 fs: nvs: fix invalid block compare when data CRC is enabled
When nvs_write is called, the nvs_flash_block_cmp is used to check if
the new data to be written matches the data already on flash. This check
always fail when CONFIG_NVS_DATA_CRC is enabled, caused by the
NVS_DATA_CRC_SIZE being added to the len parameter. The pointer to the
new data does not already have the CRC part added, while the data on
flash does, and the size to be compared includes CRC section.
By removing the addition of NVS_DATA_CRC_SIZE to the compare size, only
the data without CRC is compared, which will make the compare work in
both cases.

Signed-off-by: Yonas Alizadeh <yonas.alizadeh@alfalaval.com>
2025-05-26 09:19:54 +02:00
Jiawei Yang
623479cc3c Bluetooth: RFCOMM: Fix CR bit in DISC frame
The CR bit in DISC frames should be set as a command rather than a
response.
This patch fixes the rfcomm_send_disc function to correctly use
BT_RFCOMM_CMD_CR instead of BT_RFCOMM_RESP_CR when setting the CR bit in
the address field of DISC frames.

Signed-off-by: Jiawei Yang <jiawei.yang_1@nxp.com>
2025-05-26 09:19:35 +02:00
Robert Lubos
3572c9f825 net: http: client: Allow to abort download from response callback
Update the response callback function signature to allow the callback to
return an error code, which in turn will cause the HTTP client to abort
the download.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-05-23 17:20:24 +02:00
Robert Lubos
73e248f6cf net: zperf: Make UDP upload report retransmission count configurable
Add a Kconfig option to configure the maximum retransmission count of
the UDP upload report.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-05-23 17:20:10 +02:00
Robert Lubos
02530beeda net: zperf: Fix invalid zsock_recv() error check
The return value can only be -1, errno value should be verified instead
for the actual error code.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-05-23 17:20:10 +02:00
Benjamin Cabé
75d50742a7 Revert "testsuite: ztest: Add validation of zassert strings"
This reverts commit 6deca93285.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-05-22 11:58:43 -04:00
Maochen Wang
804e6a22ce net: l2: wifi:fix the parameter count error when start SAP
During previous commit of adding interface arg, wrongly change the
parameter count of 'wifi ap enable' to a small one. Change the value
to 47 can fix this issue and match the need of adding interface arg.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-05-22 17:03:39 +02:00
Krzysztof Chruściński
6deca93285 testsuite: ztest: Add validation of zassert strings
Add noncallable printf with string used for ztest assert/assume
macros to ensure printf-like argument validation at compile time.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-05-22 16:17:23 +02:00
Robert Lubos
2bb9aef4b1 net: sockets: tls: Add new option to register certificate verify cb
Add new TLS socket option, TLS_CERT_VERIFY_CALLBACK, which allows to
register an application callback to verify certificates obtained during
the TLS handshake.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-05-22 13:44:43 +02:00
Robert Lubos
887e8e0e7e net: sockets: tls: Add new option to retrieve cert verification result
Add new TLS socket option, TLS_CERT_VERIFY_RESULT, to obtain the
certificate verification result from the most recent handshake on the
socket. The option works if TLS_PEER_VERIFY_OPTIONAL was set on the
socket, in which case the handshake may succeed even if certificate
verification fails.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-05-22 13:44:43 +02:00
Tom Chang
797779d4c2 mgmt: ec_host_cmd: npcx: remove the SHI enable in the init
This commit removes the SHI enable in the initialization. It can be
enabled by the application explicitly calling it when needed. The SHI
backend relies on the application layer to provide a data buffer for EC
Host Commands. If SHI is enabled before this buffer is initialized,
there is a risk that the driver may access a NULL buffer, leading to a
system panic.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2025-05-22 11:31:47 +02:00
Jordan Yates
b212fb91bd net: ip: net_pkt: conditional net_if_get_by_iface
Don't reference `net_if_get_by_iface` if `CONFIG_NET_RAW_MODE=y`, since
`net_if.c` is not compiled in that case, leading to linker errors.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-05-22 04:53:08 +02:00
Lauren Murphy
7bbe425fe4 llext: basic x86 support
Adds basic x86 support for LLEXT.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2025-05-21 19:57:20 +02:00
Alberto Escolar Piedras
bb085820fc subsys/portability/cmsis_rtos_v2: Fix code compliance issues
Fix issues detected by checkpatch

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-05-21 12:35:28 +02:00
Alberto Escolar Piedras
44699baff5 subsys/net/lib/shell: Fix code compliance issues
Fix issues detected by checkpatch

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-05-21 12:35:28 +02:00
Zhaoxiang Jin
1b230f8741 pm: policy: default: Removed unused code
Removed unused code

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-05-21 12:35:08 +02:00
Markus Lassila
5357013768 modem: backend: uart: Alignment check to recv buf
Receive buffer must be aligned to word when
CONFIG_MODEM_BACKEND_UART_ASYNC_HWFC=y is set.

Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
2025-05-21 12:34:44 +02:00
Chaitanya Tata
3611d5eeaf net: l2: wifi: Add interface arg for all commands
In order to support working with multiple VIFs (e.g., STA + AP) add
interface as an option for all commands.

The interface can belong to same chipset or different (hypothetical).

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-05-21 12:34:22 +02:00
Jukka Rissanen
4f1095206f net: if: Add debug prints for IPv6 prefix selection
Useful to see what prefix is being selected for a given
IPv6 address if debugging is enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-05-21 09:30:22 +02:00
Jukka Rissanen
75860479cd tests: net: ipv6: Fix deprecated address selection
Make sure the IPv6 address selection works as specified.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-05-21 09:30:22 +02:00
Jukka Rissanen
da13b5184c net: if: Prefer always preferred IPv6 address
Always prefer preferred IPv6 address over deprecated one
regardless of prefix length. This works now same way as in
Linux.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-05-21 09:30:22 +02:00