Commit graph

22,555 commits

Author SHA1 Message Date
Lyle Zhu
fc6fe95ca8 Bluetooth: SDP: Notify partial records if RX buf is full
In current implementation, if the response total data length is more
than the receiving buffer size, the request cannot be completed
properly.

Improve the SDP client with the following changes,
o Notify the received completed SDP records if the case occurs, and
  then start the continuing SDP discovery,
o Stop the SDP discovery if the hold SDP record cannot be saved to the
  receiving buffer,
o Stop the SDP discovery if the `BT_SDP_DISCOVER_UUID_STOP` is
  returned by upper layer.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-09-10 08:27:01 +02:00
Lyle Zhu
aca9345ce6 Bluetooth: Classic: SDP: Refactor parsing of Service Search Pattern
In current implementation, after parsing the received service search
pattern and all matched SDP records are saved in the local variable
`matching_recs`. The max count of SDP records within its SDP
database that match the given service search pattern is
BT_SDP_MAX_SERVICES when parsing the received Service Search Pattern.
And it causes the max count registered SDP records is limited to
BT_SDP_MAX_SERVICES.

Refactor the parsing of service search pattern to remove the
limitation with the following steps.
1. Save the service search pattern to a simple buffer by calling
   the function `parse_service_search_pattern()`.
2. Traverse all registered SDP record and check for each SDP record
   if it is matched with given service search pattern by calling
   function `service_search_pattern_matched()`.
3. Use the matched SDP records to response the SDP request.

And also remove the limitation of the max count of registered SDP
records.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-09-10 08:26:50 +02:00
Lyle Zhu
cbf7576aad Bluetooth: Classic: SDP: Use slist to manage SDP records
Use slist instead of custom singly linked list to manage SDP records.

Check if the SDP record has been registered in the function
`bt_sdp_register_service()`.

Append the new SDP record to the tail of the SDP record list.

Check if the index of SDP record is overflow in the function
`bt_sdp_register_service()`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-09-10 08:26:50 +02:00
Duy Vo
0c5af6f25f crc: initial support for CRC subsystem
Migrate support from crc library to new crc subsystem
Add hardware acclerator backend for crc subsystem

Signed-off-by: Duy Vo <duy.vo.xc@bp.renesas.com>
2025-09-10 08:26:32 +02:00
Vinayak Kariappa Chettimada
02f180c052 Bluetooth: Controller: Fix Central and Peripheral ISO single timer use
Fix incorrect LLL scheduling of subsequent subevents when
using single timer implementation, due to missing call to
accumulate the last PDU end timestamp which is essential to
setup next radio start and to setup header complete timeout.

Relates to commit 373dc0db71 ("Bluetooth: Controller:
Single timer use Extended Advertising nRF54L support").

Relates to commit 6e8f081385 ("Bluetooth: Controller: Fix
peripheral assert under single timer use").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-09-09 20:42:55 -04:00
Vinayak Kariappa Chettimada
aef0aee0b4 Bluetooth: Controller: Minor update to conditional compile comment
Minor update to conditional compile comment.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-09-09 20:42:55 -04:00
Jordan Yates
c1e9f41710 dfu: img_util: limit slot1_ns_partition usage
Only upload to `slot1_ns_partition` if we're building for TF-M nonsecure
and we're doing split images. Single images need to upload to the whole
`slot1_partition`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-09 20:42:38 -04:00
Emil Gydesen
59ae1595ba Bluetooth: BAP: Merge 2 if's to make sonarcloud happy
Sonarcloud suggests to merge the 2 if statements, which
makes sense to do.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-09 20:42:01 -04:00
Muhammad Waleed Badar
df6c1831de net: wifi: Add default for max managed interfaces
This default value 2 of WIFI_NM_MAX_MANAGED_INTERFACES
ensures WiFi network manager can properly handle both
access point and station interfaces.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2025-09-09 22:00:08 +02:00
Kristoffer Skøien
2faf1aa86d tracing: Added board qualifier to SEGGER SystemView
Added CONFIG_BOARD_QUALIFIERS as target core to SEGGER SystemView config

Signed-off-by: Kristoffer Skøien <kristoffer.skoien@nordicsemi.no>
2025-09-09 17:28:10 +02:00
Emil Gydesen
9f5c4790d9 Bluetooth: CSIP: Fix restore of CSIS on unregister
The bt_csip_set_member_unregister function unregisters
a CSIS instance and restores the attributes to the original
state (the attributes may change during registration).

The previously solution had some issues with a check when
using picolib (‘__ssp_bos_check3’ undeclared), and this
fixes that by using a proper variable for the memcpy.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-09 17:27:52 +02:00
Emil Gydesen
5734d7e5cd Bluetooth: Audio: Use generic sys_count_bits to count bits
Instead of re-implementing or assuming that POPCOUNT is available
we now use the generic function from Zephyr.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-09 17:27:15 +02:00
Emil Gydesen
ceb567a62b Bluetooth: ISO: Cleanup BIG before stopped callback
Modify the big_disconnect function to do cleanup_big before
calling the `stopped` callback. This will allow the ISO channels,
as well as the BIG itself, to be reused for other purposes directly
in the stopped callback, without having to offload such actions
to a separate thread.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-09 14:52:46 +02:00
Dawid Niedzwiecki
6fddc44d59 mgmt: ec_host_cmd: add USB backend
Add a new ec_host_cmd backend based on USB. The backend uses the new USB
device stack.

The backend implements a vendor-specific (Google) USB interface. It uses
three endpoints:
- bulk OUT to transfer a host command request
- bulk IN to transfer a host command response
- interrupt IN to signal an event and readiness of the response

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2025-09-09 12:18:52 +01:00
Dawid Niedzwiecki
da61ccc4e3 mgmt: ec_host_cmd: add buffer alignment config
Add a new config to specify an alignment for the buffers defined by the
ec_host_cmd handler.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2025-09-09 12:18:52 +01:00
Fin Maaß
d1b6795d34 mgmt: hawkbit: move variable declaration out of if
move variable declaration out of if,
because it will be optimized away, when
optimisation is enabled and leads to
undefined and unwanted behavior.

In my case `send_buf`  of `http_client_req`
was put at the same address and the
http request was malformed.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-09-09 11:45:16 +02:00
Anas Nashif
f5d7081710 kernel: do not include ksched.h in subsys/soc code
Do not directly include and use APIs from ksched.h outside of the
kernel. For now do this using more suitable (ipi.h and
kernel_internal.h) internal APIs until more cleanup is done.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-09-09 11:45:06 +02:00
Emil Gydesen
19651491f3 Bluetooth: BAP: Fix compile issue with ep->status.state
The ep->status.state is now just ep->state.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-09 11:44:03 +02:00
Emil Gydesen
e9b6d62908 Bluetooth: BAP: Server: Verify that ep is from ASCS
Adds a function that verifies if an endpoint pointer is
part of ASCS before performing CONTAINER_OF operations on it.

Adds checks for this in the BAP Unicast server public API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-09 10:30:45 +02:00
Emil Gydesen
ed74992799 Bluetooth: ASCS: Fix minor sonarqube issue with missing else
Add missing else.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-09 10:30:45 +02:00
Emil Gydesen
40644e75a3 Bluetooth: ASCS: Use ASE_ID where applicable
Use the ASE_ID where applicable instead of ase->ep.id

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-09 10:30:45 +02:00
Emil Gydesen
ce9e8f8b9e Bluetooth: BAP: Fix bad use of bt_ascs_ase_status
The bt_ascs_ase_status was stored directly in the
struct bt_bap_ep, which was an issue as
bt_ascs_ase_status is a variable sized struct.
The struct could have been moved to the end of
bt_bap_ep to avoid the issues it caused, but
there is no actual reason to use that struct
rather than storing the ID and state as
seperate values.

The ascs_ep_get_state exists but was not widely
used in ascs. Modify places to use the function
instead of directly accessing the state.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-09 10:30:45 +02:00
Daniel DeGrasse
c7e60346a0 tracing: ctf: take IRQ lock before generating timestamp
CTF tracing relies on all packet timestamps being increasing- if a
timestamp of a later packet is less than the prior packet, the CTF
parser assumes the timestamp field has overflowed and adds to the
overall timestamp to account for this.

When taking a timestamp for a CTF packet, it was possible for an interrupt
to occur before the packet was submitted to the tracing core framework
but after the timestamp was generated. The interrupt itself would
generate a tracing event with a later timestamp then the packet in
question, leading to the packets being recorded out of order.

To resolve this, take an IRQ lock before generating the timestamp and
release it after submitting the packet to the tracing core.

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
2025-09-08 15:54:35 -04:00
Fabio Baltieri
8366365c03 util: move utf8 utils to a separate header
This moves the declaration of the utf8 utils defined in lib/utils/utf8.c
in their own header. Main reason to do this is that the current setup
requried adding an include for sys/types.h in util.h, which can result
in a build falure due to a circular header depdenecy when using:

CONFIG_POSIX_API=y
CONFIG_NEWLIB_LIBC=y
_GNU_SOURCE

the loop and error are:

- include/sys/types.h:50: <- this is a NEWLIB one
- include/zephyr/posix/sys/select.h:9:
- include/zephyr/posix/posix_types.h:30:
- include/zephyr/kernel.h:17:
- include/zephyr/kernel_includes.h:25:
- include/zephyr/sys/atomic.h:18:

include/zephyr/sys/util.h:705:1:
error: unknown type name 'ssize_t'

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-09-08 11:11:40 -04:00
Mandus Börjesson
8409c87e36 mgmt: hawkbit: Add option to not reboot system after update
Some applications might require cleanup prior to performing a system
reboot. Add an option that disables hawkbits automatic reboots so that
it can be postponed until the application is ready.

Signed-off-by: Mandus Börjesson <borjessonmandus@gmail.com>
2025-09-08 16:01:18 +02:00
Vinayak Kariappa Chettimada
aefeeb922b Bluetooth: Controller: Fix missing ISO Receiver address capture
Fix missing ISO Receiver access address capture that caused
ISO PDU reception error. Missing access address capture for
subsequent subevent when prior subevent did not have an
anchor point sync prevent proper drift compensation hence
causing ISO PDU reception error for the entire BIG event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-09-08 16:01:09 +02:00
Vinayak Kariappa Chettimada
85f4f0483b Bluetooth: Controller: Fix ISO Sync Receiver subevent jitter
Fix the jitter considered in the PDU reception in the
subevents of ISO Sync Receiver to not exceed such that the
reception is scheduled late (causing assertion).

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-09-08 16:01:09 +02:00
Jeppe Odgaard
c6f31346d2 net: config: sntp: add resync interval range
RFC4330 section 10 states:

A client MUST NOT under any conditions use a poll interval less then 15
seconds.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-09-08 14:41:25 +02:00
Kai Cheng
62a4506c6d Bluetooth: SDP: fix sdp record not uninitialized
sdp matching_recs maybe filled with uninitialized record. if
sdp_svc_search_req come from remote with invalid max_rec_count,
which is greater than num_services, matching_recs would response
uninitialized record result.

Signed-off-by: Kai Cheng <chengkai@xiaomi.com>
2025-09-08 14:37:29 +02:00
Aaron Ye
229fdf0fe7 logging: backends: Use CMSIS 6 register defines in SWO initialization
ARM CMSIS 6 has different ITM and TPI register definition comparing
with CMSIS 5. Update the swo initialization to use CMSIS 6 defines.
For the Cortex-M cores which are higher than Cortex-CM7, the LAR
has been removed from ITM.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2025-09-08 09:48:44 +02:00
Appana Durga Kedareswara rao
7542107048 arm64: Add new CPU_CORTEX_A78 configuration for Cortex-A78 support
Introduce a new Kconfig option CPU_CORTEX_A78 to enable support for the
Arm Cortex-A78 CPU architecture within Zephyr. This configuration can be
selected by boards or SoCs that utilize the Cortex-A78 core, enabling
architecture-specific features and optimizations as needed.

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
2025-09-05 16:48:38 -04:00
Øyvind Hagen
27e5a8fcf5 usb: device: fix CDC ACM serial state notification for Rx Carrier
Use the actual value instead of the flag.

Signed-off-by: Øyvind Hagen <oyvinha@ifi.uio.no>
2025-09-05 17:11:16 +02:00
Mark Wang
0e86cb85f2 bluetooth: avdtp: fix the issue of registering same endpoint
return error when the already registered endpoint is registered again.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-09-05 17:10:41 +02:00
Josuah Demangeon
916c6e60ef usb: host: wrap the mutex lock with a helper
Hide the mutex lock details inside a wrapper call, like done for the
device stack API. This is not used for the per-device lock of the host
stack which use a different mutex lock.

Signed-off-by: Josuah Demangeon <josuah.demangeon@nordicsemi.no>
2025-09-05 13:45:30 +02:00
Josuah Demangeon
e8ecb6c3af usb: host: check that descriptor is in bound before dereferencing
In the while loop parsing descriptors, check that the descriptor is past
the end just before dereferencing it to check if it is seemingly valid.

Signed-off-by: Josuah Demangeon <josuah.demangeon@nordicsemi.no>
2025-09-05 13:45:30 +02:00
Josuah Demangeon
a6faa0ca32 usb: host: rename "struct usbh_contex" to "usbh_context"
Make the struct name match the device naming for ease of use, although
slightly longer name. Propagate the change to the subsystem, includes,
tests and samples.

Signed-off-by: Josuah Demangeon <josuah.demangeon@nordicsemi.no>
2025-09-05 13:45:30 +02:00
Samuel Tsai
07dc0ad40d Bluetooth: host: adv: revert 39cb574 to fix spurious error log
Commit 39cb574 changed the log level from LOG_DBG to LOG_ERR in
bt_le_adv_resume(). This causes the error log
"No valid legacy adv to resume" to appear during normal connection
establishment when using bt_le_ext_adv_start(), even though the
system is functioning correctly.

Revert the change to restore the original LOG_DBG level.

Fixes: #94954

Signed-off-by: Samuel Tsai <stsai@atmosic.com>
2025-09-05 12:27:45 +02:00
Mark Wang
06dfa99980 bluetooth: a2dp: fix the process of failed cmd
If the cmd fail to receive response (for example: timeout), the buf is
NULL, then need to callback the result.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-09-05 12:27:29 +02:00
Bjarki Arge Andreasen
682c835113 pm: device_runtime: put_sync_locked: fix usage count on err
If pm action fails within put_sync_locked, usage count should be
reset to reflect the state of the device.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-09-05 07:44:08 +02:00
Sean Kyer
e4fb01c66b cpu_freq: Add CPU Frequency Scaling subsystem
Add a CPU frequency scaling subsystem, allowing a policy
algorithm to control the frequency of a given SoC/MCU
automatically at runtime.

Implement a basic, "on-demand" policy algorithm which
iterates through the P-states supported by the SoC and
selects the first P-state where it's trigger threshold is
less than the CPU load.

The CPU frequency scaling subsystem does not currently
support SMP. The CPU load measurement can be made to support
SMP since statistics are measured from the scheduler.

Co-authored-by: Eric Hay <Eric.Hay@analog.com>
Signed-off-by: Sean Kyer <Sean.Kyer@analog.com>
2025-09-05 07:43:56 +02:00
Eric Hay
73ce03246b cpu_load: Add CPU Load subsystem
Implement CPU load measurement subsystem. The statistics
used to calcualte the load are taken from the scheduler.
Specifically, the number of cycles used by the idle thread.

Co-authored-by: Sean Kyer <Sean.Kyer@analog.com>
Signed-off-by: Eric Hay <Eric.Hay@analog.com>
2025-09-05 07:43:56 +02:00
Diego Herranz
7489a38e3b fb: cfb_shell: fix draw circle help text
HELP_DRAW_CIRCLE existed, but HELP_DRAW_RECT was used instead.

Signed-off-by: Diego Herranz <diegoherranz@diegoherranz.com>
2025-09-04 20:08:27 -04:00
Victor Brzeski
a52966b3bc uac2: rate limit ops->get_recv_buf error log
Rate limit the get_recv_buf() callback from the application to
reduce system trash when buffer pressure gets high.

Signed-off-by: Victor Brzeski <vbrzeski@gmail.com>
2025-09-04 16:46:17 +02:00
Jamie McCrae
d12c6888e3 mgmt: mcumgr: grp: img_mgmt: Add support for SHA512 in images
Adds support for images signed with SHA512.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-09-04 14:43:26 +02:00
Yangbo Lu
263911d79e net: net_if: use simple vlanX for vlan interface name
Used simple vlanX for vlan interface name. What interface the
vlan interface was attached to could be checked by "net iface"
or "net vlan".

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-09-04 11:34:15 +02:00
Yangbo Lu
0948812f70 net: vlan: drop current vlan interface naming
There were two problems about vlan interface naming currently.

1. When there were more than 1 vlan interfaces. It's not able to
   initialze name for all of them to same name VLAN-<free>.
2. When enabled vlan with tag, the name VLAN-xxx was used.
   However we may need to support multiple physical interfaces
   in the future. So, it's not able to use same name VLAN-xxx
   either for same tag on different physical interfaces.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-09-04 11:34:15 +02:00
Yangbo Lu
3fc03623ad net: shell: vlan: fix tag/attached info showing
There was call trace to execute "net vlan" if vlan interface
hadn't been enabled. Fixed it.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-09-04 11:34:15 +02:00
Emil Gydesen
aa27460880 Bluetooth: CCP: Add support for set/get provider name
Add support for setting and getting the bearer provider
name. For now the name will be duplicated by the TBS
implementation, but will be optimizied in the future
so only one copy of the name exists.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-04 11:30:36 +02:00
Johann Fischer
1d282539a3 usb: device_next: avoid false error logging in CDC ECM/NCM
The interface descriptor and its associated string descriptor are shared
between different speed configurations. Do not try to add a string
descriptor if it has already been added and the index is not zero.

Similar to commit ec851ba7c7
("usb: device_next: avoid false error logging in CDC ACM").

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-09-03 17:04:39 +02:00
Benjamin Cabé
0132ea07fb doc: fix spelling errors tree-wide
fix some spelling errors in code comments and Kconfig helps

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00