Commit graph

22,555 commits

Author SHA1 Message Date
Yusuke Omae
ddd41480a7 net: gptp: add missing stepsRemoved assignment
The stepsRemoved of portPriorityVector was
left unassigned when receiving Announce message.

Signed-off-by: Yusuke Omae <s1413091@gmail.com>
2025-08-07 13:15:28 +02:00
Yusuke Omae
877a31ab78 net: gptp: fix comparsion of stepsRemoved
The original implementation select the port
as best_port when stepsRemoved is equal to
the one of best_vector.
When challenger is from announce message
set in GPTP_PA_INFO_SUPERIOR_MASTER_PORT,
its stepsRemoved is the same as in the message.
When challenger is from master_priority
copied in GPTP_PA_INFO_UPDATE,
its stepsRemoved is [stepsRemoved of bestVector]+1.
Thus, we should add one to the challenger's
stepsRemoved in comparsion to avoid useless
update of bestVector.

Signed-off-by: Yusuke Omae <s1413091@gmail.com>
2025-08-07 13:15:28 +02:00
Andrzej Puzdrowski
20695ed091 arch/arm/core/cortex_m: optional memory section for _cp_context
More complex suspend and resume scheme might require exactly defined
location of this variable due to platform peculiar SW and HW requirement.

DTS zephyr,memory-region node with nodelabel `pm_s2ram` shall be used to
automatic definition of linker section for such objective.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2025-08-07 13:15:08 +02:00
Bas van Loon
1dcf123e2d fs/ext2: Fix NULL dereference when fs_stat queries root.
When fs_stat() queries the root / mountpoint it should return its root
i_node but instead it tries to return the parent i_node which does not
exist. Fix this by checking if parent is set otherwise return the root
i_node.

Fixes https://github.com/zephyrproject-rtos/zephyr/issues/94000.

Signed-off-by: Bas van Loon <bas@arch-embedded.com>
2025-08-06 21:34:29 -04:00
Johann Fischer
efaaad0a09 usb: mark new stack as unstable and set it as the default
Document that the legacy stack is now deprecated.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-08-06 11:57:39 -04:00
Johann Fischer
4af7549d72 usb: deprecate legacy USB device support
Deprecate legacy USB device support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-08-06 11:57:39 -04:00
Saravanan Sekar
1a4f092348 net: ocpp: Add a support for Open Charge Point Protocol(OCPP v1.6) stack
Basic support for open charge point protocol v1.6 as native stack with
below functionality

1. Framework for ocpp stack and central system communication using RPC over
   websocket according to occp-j.
2. Core profile with basic PDU

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
Co-authored-by: Sanjay Vallimanalan <sanjay@linumiz.com>
2025-08-06 11:57:13 -04:00
Emil Gydesen
b0f1eb30fb Bluetooth: AICS: Remove bad check in handle_set_gain_op
AICS gain mode does not prevent local nor remote operations from changing
the gain setting value. The gain setting value shall simply be ignored if
in the BT_AICS_MODE_AUTO_ONLY or BT_AICS_MODE_AUTO modes, but the local
application and remote devices can still modify the gain setting value.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-08-06 17:12:27 +03:00
Sean Madigan
1b7b6af785 bluetooth: host: add frame space update support
This commit adds support for the frame space update feature
to the bluetooth host.

This is mainly just a wrapper around the frame space update
HCI command and event.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2025-08-06 17:11:04 +03:00
Sean Madigan
9bbc906b30 bluetooth: host: Fix BT_LE_LOCAL_SUPPORTED_FEATURES_SIZE define
Fix BT_LE_LOCAL_SUPPORTED_FEATURES_SIZE define, as this was
not working correctly without brackets around
CONFIG_BT_LE_MAX_LOCAL_SUPPORTED_FEATURE_PAGE.

Also fix CONFIG_BT_LE_MAX_LOCAL_SUPPORTED_FEATURE_PAGE help,
as this was talking about remote featues, where this only
applies for local features.

Also update for new CONFIG_BT_CONN_DYNAMIC_CALLBACKS kconfig

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2025-08-06 17:11:04 +03:00
Robert Lubos
0f66e9c680 net: context: Don't assert on address family mismatch
Providing a wrong address to the connect() call by the application is no
reason to assert, connect() should just return an error in such case.
Therefore remove the faulty assert and replace it with error log
instead.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-08-06 12:16:42 +03:00
Fabio Baltieri
6ebc196008 net: sockets: getaddrinfo: use k_ variants for memory allocation
The rest of the network (and generally Zephyr subsystem code) use the k_
prefixed variants for memory allocation, which results in data goin in
the _system_heap rather than the stdlib z_malloc_heap.

The code in getaddrinfo use the z_ ones as well apart from the actual
getaddrinfo implementation, which seems like an oversight, change it to
use k_calloc and k_free as well.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-08-06 12:15:49 +03:00
Jisheng Zhang
13bdae0ad0 arch: arm: Add initial support for Cortex-M52 Core
Add initial support for the Cortex-M52 Core which is an implementation
of the Armv8.1-M mainline architecture.

The support is based on the Cortex-M55 support that already exists in
Zephyr.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
2025-08-06 12:15:23 +03:00
Emil Gydesen
eef2aa88b3 Bluetooth: CTS: Fix issue with writing without subscription
The write_ct function calls bt_cts_send_notification and if
bt_cts_send_notification fails to send a notification (e.g.
if there are no clients subscribed), it would return an
error, and thus send a ATT error response to the client,
even if the value was actually written.

This commit changes the behavior so that the notification
does not affect the return value (as it is not directly
linked to the write itself), but rather just logs it if
it fails to send the notification.

The notification can failed to be send for 2 main reasons:
1) The application returns an error on fill_current_cts_time
2) bt_gatt_notify fails to notify due to missing buffers

The first we cannot do much about. For the latter we can
either just live with the missing notification, or implement
a retry if we run out of buffers. For this simple fix the
former was chosen, but can be revisited if it turns out
to be a significant problem.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-08-06 12:12:07 +03:00
Emil Gydesen
8e5e9922c5 Bluetooth: ISO: Fix sonarcloud issues in valid_chan_qos
Fixes some sonarcloud issues relating to the if statements.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-08-05 13:37:13 -04:00
Emil Gydesen
3a963e5286 Bluetooth: ISO: Remove check for SDU size
Since the SDUs are now allocated by the application
and the host does not care about the SDU sizes, the check
is useless.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-08-05 13:37:13 -04:00
Yago Fontoura do Rosario
ca06a1d80d Bluetooth: Add configuration to control the dynamic connection callbacks
This commit allows to the user to control the use or not of dynamic
connection callbacks.
The stack is not using the dynamic connection callbacks so they are
only needed if the applications want to use it.
Setting it to true for backwards compatibility.

With dynamic connection callbacks

           FLASH:      176600 B       512 KB     33.68%
             RAM:       27428 B        64 KB     41.85%
        IDT_LIST:          0 GB        32 KB      0.00%

Without dynamic connection callbacks

           FLASH:      176376 B       512 KB     33.64%
             RAM:       27428 B        64 KB     41.85%
        IDT_LIST:          0 GB        32 KB      0.00%

Signed-off-by: Yago Fontoura do Rosario <yafo@demant.com>
2025-08-05 13:28:06 -04:00
Yago Fontoura do Rosario
e0d22a308e Bluetooth: Host: Conn callbacks registration with BT_CONN_CB_DEFINE
This commit registers the connection callbacks using BT_CONN_CB_DEFINE,
which ensures they are set up at link time rather than runtime.

Signed-off-by: Yago Fontoura do Rosario <yafo@demant.com>
2025-08-05 13:28:06 -04:00
Yago Fontoura do Rosario
b1eaf02ec1 Bluetooth: Audio: Conn callbacks registration with BT_CONN_CB_DEFINE
This commit registers the connection callbacks using BT_CONN_CB_DEFINE,
which ensures they are set up at link time rather than runtime.

Signed-off-by: Yago Fontoura do Rosario <yafo@demant.com>
2025-08-05 13:28:06 -04:00
Maochen Wang
3ad0b53003 net: l2: wifi: fix the build error of hostapd enterprise
Fix the build error when hostapd enterprise is enabled, it should use
new wifi_set_enterprise_credentials API, instead of
wifi_set_enterprise_creds.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-08-05 13:24:02 -04:00
Tim Pambor
be37d72a40 net: tcp: Avoid casting unaligned address to struct in_addr
This change addresses an alignment problem reported by UBSAN by
using a copy of the address. This avoids the need for extensive
rework to support *_raw variants in the routing layer.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-08-05 13:23:21 -04:00
Seppo Takalo
05dfc7145f net: lwm2m: Fix string truncation on some content formatters
LwM2M engine does not allow strings to be truncated as it would
lead to invalind UTF-8 strings.

However, some content formatters were truncating, so I fixed at least
these
* plain text
* TLV
* SenML CBOR
* SenML JSON
* JSON
* CBOR

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-08-05 13:20:57 -04:00
Daniel DeGrasse
188d78b109 mgmt: update img_mgmt_slot_in_use for ramload with revert mode
We should not block erasing pending images when using ramload with
revert mode, because uploading multiple confirmed images with the same
version would brick the device (preventing future FW updates). Update
the dependencies of img_mgmt_slot_in_use to account for this.

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
2025-08-05 11:53:58 +01:00
Daniel DeGrasse
2ed1ec9e33 dfu: boot: mcuboot: fix boot_fetch_active_slot
boot_fetch_active_slot needs to map the slot number to a flash ID, as
this is what the DFU subsystem expects when interacting with the flash
partition.

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
2025-08-05 11:53:58 +01:00
Daniel DeGrasse
e1173afe7d dfu: mcuboot: update dependencies for RAMLOAD_WITH_REVERT
Much like in RAMLOAD mode, RAMLOAD_WITH_REVERT requires that mcuboot
subsystem fetch bootloader information via the retention subsystem.

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
2025-08-05 11:53:58 +01:00
Vinayak Kariappa Chettimada
c8d4016e04 Bluetooth: Controller: Fix minimal Kconfig depends and defaults
Fix default value of BT_TICKER_REMAINDER_GET, it will be
selected based on enabled Controller features. This is not
needed by minimal peripheral role.

Fix depends on for BT_CTLR_CONN_RANDOM_FORCE as it is
applicable when more than one simultaneous connections is
supported. Again, this is not needed by minimal peripheral
role.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-04 17:02:19 -04:00
Mark Wang
f19e7983d0 bluetooth: remove the unnecessary macro wrapper in header files
It eliminates the possibility of using IS_ENABLE(), so it is better to
remove them.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-08-04 19:57:30 +01:00
Chaitanya Tata
59ff12656f net: l2: wifi: Fix the default keepalive value
30s is too aggressive for most APs, and hostapd also uses 5mins as the
default value.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-08-04 19:55:27 +01:00
Malte Werschy
6ceb672194 net: sockets: ensure socket obj core is only linked once
Repeated linking of socket object cores can corrupt the linked list.

Fixes: #93587

Signed-off-by: Malte Werschy <werschy.m@gmail.com>
2025-08-04 11:55:34 +01:00
Venetia Furtado
44b4fff164 logging: backend: mqtt: Fixed MQTT compiler warning
Added const qualifier to fix the compiler warning

Signed-off-by: Venetia Furtado <venetiarosita@gmail.com>
2025-08-04 11:53:39 +01:00
Håvard Reierstad
7debc8a8f5 Bluetooth: Host: Add conn rsp param check
Check whether the connection response parameters both with and without
ECRED are within the valid ranges from the Bluetooth Core Specification
(part 3.A.4 v6.0). Changes validation checks in requests to match the
same pattern.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2025-08-04 11:52:01 +01:00
Bas van Loon
88a09e6379 fs: Implement fstab devicetree integration for EXT2
Device tree and/or automount support was not present and might be useful
when for example the settings module needs early access to a filesystem.
This patch adds support to mount an EXT2 filesystem automatically. The
implementation chosen is to provide the drive name matching a disk
drive specified in the device tree ie on an (e)MMC or SD card.

Signed-off-by: Bas van Loon <bas@arch-embedded.com>
2025-08-02 13:18:15 +02:00
Jamie McCrae
77f19eb1b5 fs: zms: Add FLASH_MAP dependency
ZMS does not work without this and gives compilation errors, fix
this by adding the correct dependency

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2025-08-01 19:38:48 +01:00
Anas Nashif
6c85528cbe tracing: ctf: fix arguments for timer_status_sync
In the metadata, found that timer_status_sync_pending was missing the
timeout parameter. Noticed when tracing tests/kernel/common.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-08-01 19:38:40 +01:00
Anas Nashif
d794732087 tracing: ctf: add missing k_sleep events
In a096b34835 which introduced tracing of k_sleep, the events in the
metadata file were missed causing issues when running with babeltrace.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-08-01 19:38:40 +01:00
Emil Gydesen
8788f8ba26 Bluetooth: BAP: Add target latency and phy to codec_cfg
The codec configuration operation for unicast (ASCS) contain
both a target PHY and a target latency value that was previously
just hardcoded by the client and unavailable by the server.

This commit adds them to the bt_audio_codec_cfg struct so that
applications can both set and get these values.

The default values used by BT_AUDIO_CODEC_CFG use the same
values as the client would previously set.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-08-01 19:37:31 +01:00
Lauren Murphy
c792d78cb3 llext: add fixes for various tests on mwdt / harvard arch
Adds fixes to get LLEXT tests to work for NSIM VPX on MWDT.

Excludes prelocated extensions for MWDT for now.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2025-08-01 19:36:59 +01:00
Lauren Murphy
a444f7ded8 llext: add reloc and symbols for mwdt
Adds relocation and symbols generated by MWDT while using it
for NSIM VPX5.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2025-08-01 19:36:59 +01:00
Lauren Murphy
a4274f884b llext: dynamic heap support for harvard arch
Adds support for LLEXT_HEAP_DYNAMIC with Harvard architecture.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2025-08-01 19:36:59 +01:00
Lauren Murphy
944aa8174c llext: run on harvard arch with static heaps
Splits LLEXT static heap into an instruction heap placed in
instruction memory and a data heap placed in data memory.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2025-08-01 19:36:59 +01:00
Lauren Murphy
92db7bcf11 llext: compile llext with arc mwdt on nsim vpx5
Allow users to compile LLEXTs with the MetaWare Design Toolchain.
Provides utility to dramatically shrink bloated extensions by removing
unused section names left behind by MWDT strip. Test extensions will
not fit in NSIM VPX5 memory otherwise; each is reduced from ~16k to ~1k.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2025-08-01 19:36:59 +01:00
Håvard Reierstad
2b42a1d81d Bluetooth: Host: Add l2cap credit param checks
Adds a missing requirement from Core Spec V6.0 Vol 3.A chapters 10.1
and 10.2 to ignore L2CAP_FLOW_CONTROL_CREDIT_IND packets with the
credit value set to 0.

Matches existing credit-related functions by checking that the CID
is in the dynamic range (you can't add credits to fixed channels).

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2025-08-01 12:20:43 -04:00
WenBin Zhang
b54f4386bd net: shell: Move to a separate Kconfig file
Move it to a separate Kconfig file and move it under the net/lib/shell.
When using menuconfig, it helps to reduce the confusion of network
configuration options.

Signed-off-by: WenBin Zhang <freey7955@gmail.com>
2025-08-01 07:46:11 -04:00
Seppo Takalo
d0cba34c7f net: lwm2m: Prevent QUEUE_RX_OFF while waiting for CoAP Ack
The LwM2M RD client state machine have no knowledge of ongoing
observations or any other CoAP traffic and might trigger
QUEUE_RX_OFF state while engine is still waiting for Ack.

This can happen if CoAP Ack timeout is longer than
CONFIG_LWM2M_QUEUE_MODE_UPTIME and response is lost or taking
longer than QUEUE_MODE_UPTIME.

When observation is lost, CoAP Ack may be send, but socket is not
listening anymore if its closed or not polled while in RX_OFF and this
stops observation.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-08-01 07:39:16 -04:00
Emil Gydesen
b76f09dc04 Bluetooth: ISO: Fix issue with BIS tx_complete
BIS termination as broadcaster is handled different
than ACL and CIS, and in rare chances the
tx_complete for BIS may not have been completed in
the system workqueue before iso_new was called for the
same bt_conn struct (e.g. via bt_iso_cig_create), which
would perform

k_work_init(&conn->tx_complete_work, tx_complete_work);

but where conn->tx_complete_work still existed in
the system workqueue, which would cause the list
of pending items on the system workqueue to be removed
as the `next` pointer would be NULL.

This also adds an assert in bt_conn_new to prevent this
issue from appearing again.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-07-31 17:14:21 -04:00
Jonas Spinner
91ec38d7e0 Bluetooth: Classic: SDP: Replace magic numbers
Replace magic UUID sizes with `sizeof(uint8_t) +
BT_UUID_SIZE_{16,32,128}`.

Signed-off-by: Jonas Spinner <jonas.spinner@burkert.com>
2025-07-31 17:10:57 -04:00
Jukka Rissanen
6797fa642d net: sockets: Allow test to override DNS timeout
The minimum 1 sec timeout for getaddrinfo() call is too long
when executing queries from network tests. So allow test to override
the minimum and set it to very low value.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-07-31 17:10:45 -04:00
Jukka Rissanen
80e458ce7b net: dns: Resolve localhost name
Allow user to query localhost name and get a localhost address
127.0.0.1 or ::1 back. This is only enabled if loopback driver
is used as the use case does not make much sense otherwise.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-07-31 17:10:45 -04:00
Jukka Rissanen
cb163d1f28 net: dns: Resolve local hostname
Make sure that if user has enabled hostname support, we are
able to query it and get a local IP address back.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-07-31 17:10:45 -04:00
Jonas Spinner
6fd48df18f rtio: workq: Remove unused Kconfig option
* Remove `RTIO_WORKQ_STACK_SIZE` as it is no longer used.
* Fix description of `RTIO_WORKQ_THREADS_POOL_STACK_SIZE`.

Signed-off-by: Jonas Spinner <jonas.spinner@burkert.com>
2025-07-31 16:51:14 -04:00