Commit graph

21541 commits

Author SHA1 Message Date
Vinayak Kariappa Chettimada
abfe5f17a9 Bluetooth: Controller: 1 ms connection
1 ms connection interval support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-24 13:15:20 +01:00
Vinayak Kariappa Chettimada
e7799d4977 Bluetooth: Controller: Separate Tx/Rx frame spacing
Separate Tx/Rx frame spacing.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-24 13:15:20 +01:00
Vinayak Kariappa Chettimada
2ab1671af1 Bluetooth: Controller: Introduce deferred ACL Tx packet transmission
Introduce deferred ACL Tx packet transmission setup by radio,
so that an enqueued ACL Data packet can be transmitted with
the shortest latency.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-24 13:15:20 +01:00
Vinayak Kariappa Chettimada
ba1def1a34 Bluetooth: Controller: Add radio timer ISR usage support
Add radio timer ISR usage support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-24 13:15:20 +01:00
Vinayak Kariappa Chettimada
d9f890bfdf Bluetooth: Controller: Defines for radio timer capture/compare indices
Add defines for radio timer capture and compare indices used
in the nRF Radio HAL implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-24 13:15:20 +01:00
Vinayak Kariappa Chettimada
7db7edae3c Bluetooth: Controller: Minor updates to code comments
Minor updates and correction to code comments.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-24 13:15:20 +01:00
Daniel DeGrasse
e6fc2be803 net: l2: wifi: add explicit dependency on "app" target for pem headers
Generated PEM headers need to be created before we build the WiFi shell
when WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE is enabled, so add an
explicit dependency on the app target to be certain these headers are
created

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-24 09:29:21 +02:00
Jamie McCrae
7609a17dc3 mgmt: mcumgr: grp: zephyr_basic: Add missing FLASH_MAP dependency
Adds a missing dependency, this command requires it to erase the
storage area

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2024-10-24 05:43:42 +01:00
Gang Li
0d2f23f251 net: wifi: Fix the ap config command using the sta interface
The "wifi ap config" command uses the station interface via
net_if_get_first_wifi(), and should use the ap interface.

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2024-10-24 03:46:37 +01:00
Dominik Kilian
cbaafe209c boards: nordic: ipc: added dcache alignement
The nRF54 and nRF92 chips has data cache, which means
the ICMsg and ICBMsg must be configured to follow required
cache alignment of the shared memory.
The `dcache-alignement` needs to be defined for that.

Signed-off-by: Dominik Kilian <Dominik.Kilian@nordicsemi.no>
2024-10-24 03:45:35 +01:00
Emil Gydesen
fb6c4427b8 Bluetooth: Audio: Add helpers for broadcast name
Added helper functions to set and get broadcast name
for codec capabilities and codec configs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-23 16:54:28 +02:00
Lucas Mathias Balling
01872642f4 Bluetooth: Audio: Fix PAST support for bap_scan_delegator
Fixed PAST support for bap_scan_delegator

Signed-off-by: Lucas Mathias Balling <lutb@demant.com>
2024-10-23 16:53:58 +02:00
Lucas Mathias Balling
cb0e3a7646 Bluetooth: Controller: Implement PAST support in ULL
Implement PAST support in ULL and fixed test after changed
dependencies in ull_sync_internal.c

Signed-off-by: Lucas Mathias Balling <lutb@demant.com>
2024-10-23 16:53:58 +02:00
Lucas Mathias Balling
39fcf02181 Bluetooth: Controller: Implement Periodic Sync Procedure
Adding PDU flow for Periodic Sync Indication

Signed-off-by: Lucas Mathias Balling <lutb@demant.com>
2024-10-23 16:53:58 +02:00
Emil Gydesen
2dc1113a94 Bluetooth: CAP: Add support for handling ASE errors
If we get an error/rejection from the CAP acceptor when
performing the Unicast Audio Start or Stop procedure then
we need to abort the procedure and let the application determine
what the next step is.

This change triggered a corner case when connecting to multiple
CAP acceptors as the CAP initiatior. This was also fixed as part
of this.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-23 16:53:44 +02:00
Emil Gydesen
756f5f940c Bluetooth: BAP: Disallow bt_bap_stream_stop when CIS is not connected
When the CIS for a BAP stream is not connected, we cannot truly
be in the disabling state (the only state the stop operation
can be performed by the unicast client).

The reason for this is that if the CIS is disconnected, then
the ASCS server shall transition to the QoS Configured state
regardless of whether it has received a receiver stop ready
command from the unicast client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-23 16:53:44 +02:00
Babak Arisian
7f820d59c0 Bluetooth: Audio: Update SCAN_DELEGATOR dependency to GATT_DYNAMIC_DB
Changed dependency of the BT_BAP_SCAN_DELEGATOR to GATT_DYNAMIC_DB
from 'select' to 'depends on' and solved all loop dependencies
caused by this change.

Fixes #79108

Signed-off-by: Babak Arisian <bbaa@demant.com>
2024-10-23 16:53:37 +02:00
Krzysztof Chruściński
b6f7eac00a logging: Fix LOG_IMMEDIATE_CLEAN_OUTPUT
There was a kconfig option used in v1 logging to get clean
output in the immediate mode. It was lost during the transition
to v2 but Kconfig remained. Adding spin_lock to log processing
to ensure that log messages are not interleaved in the output
in the immediate mode.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-23 16:53:30 +02:00
Emil Gydesen
25c993e5b7 Bluetooth: Host: Remove implicit conversions of own_addr_type
Remove implicit conversions and assignment to the
own_addr_type variables.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-23 16:53:23 +02:00
Emil Gydesen
da2e8c3c96 Bluetooth: Add and use missing own_addr_type defines
The own_addr_type used for various HCI commands sometimes
had a BT_HCI_OWN_ADDR_* type value or a BT_ADDR_* type
value. Those are 2 different value spaces, and if the public
address types would ever change, it would start have incorrect
behavior.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-23 16:53:23 +02:00
Babak Arisian
58d5032685 Bluetooth: Audio: add create_sink_by_name for the broadcast sink shell
Add create_sink_by_name command that scans for broadcast sources
with BT_DATA_BROADCAST_NAME matching the name given to the shell
command.

Fixes #70837

Signed-off-by: Babak Arisian <bbaa@demant.com>
2024-10-23 16:51:56 +02:00
Fin Maaß
03a5f417d1 net: sockets: socket_service: remove k_work related code
remove k_work related code and change
the argument of the callback to `struct net_socket_service_event`.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-10-23 11:32:21 +02:00
Fin Maaß
1f23e769c0 net: sockets: socket_service: optimize code
optimize code for the net socket service.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-10-23 11:32:21 +02:00
Fin Maaß
75d2a4dfcf lib: shell: net: sockets: service: don't show type
as the async type got removed, there is only
one type left, so no need to show that.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-10-23 11:32:21 +02:00
Fin Maaß
4fdcd229f2 net: sockets: remove reference to async socket service
remove reference to async socket service

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-10-23 11:32:21 +02:00
Emil Gydesen
5965ffea86 Bluetooth: BAP: Dont discover ASE CP if ASE not found
Added a check in unicast_client_ase_discover_cb that if
no ASE was discovered, then it would stop the discovery
there instead of attempting to call
unicast_client_ase_cp_discover to discover the control point
which would not be useful to use anyhow.

This terminates the discovery earlier in case of the remote
side not supporting the audio direction we are discovering.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-23 11:27:17 +02:00
Vincent van der Locht
5cbd1f6c39 usb: device_next: cdc_acm: Prevent polling for buffer in TX
In case the host doesn't pull the new data from the endpoint, the work task
would schedule itself again delayed (at the max. priority). When there is
no terminal program or active application reading the endpoint this
results in a constant polling of the endpoint burning up to 5% of the
CPU cycles.

By using a atomic flag for tx busy, the polling is solved and changed into
a postponed execution of the next work task which saves up to 5% of
CPU cycles and allows a better real-time behavior for other tasks.

Secondly, if the TX interrupt is disabled but there is still data in the TX
FIFO (ring buffer), the implementation will continue to trigger subsequent
TX work and attempt to flush the data to the host.

Signed-off-by: Vincent van der Locht <vincent@synchronicit.nl>
2024-10-22 22:46:59 -04:00
Pisit Sawangvonganan
17e62bc24b net: shell: ping: streamline parse_arg function by using shell_strtol
Switch from using direct `strtol` calls to `shell_strtol`.
This change leverages the extensive error handling provided
by `shell_strtol`.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-10-22 22:46:36 -04:00
Pisit Sawangvonganan
edaf94ec37 net: shell: ping: correct argument count for net ping command
Since `<host>` is a mandatory argument, the (_mand, _opt) values
should be adjusted to 2 and 12, respectively.
Note that `_mand` includes the number of mandatory arguments,
including the command name (`ping` itself).

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-10-22 22:46:36 -04:00
Piotr Koziar
51e0130a74 ipc: icmsg: increase stack size of RX work queue thread
Increases default size of stack used by work queue RX thread
from 1024 to 1280 to avoid memory issues.

After adding the buffer with the default size of 128
that is allocated on the thread's stack (see #77552),
there is too little stack left during heavy stress.

Signed-off-by: Piotr Koziar <piotr.koziar@nordicsemi.no>
2024-10-22 20:40:57 +02:00
Jukka Rissanen
d3fbc366ea net: shell: mem: Add net_pkt allocation statistics printout
The "net mem" command can show extra information for net_pkt
allocations.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-10-22 20:38:57 +02:00
Jukka Rissanen
67be3a166b net: pkt: Collect net_pkt allocation statistics
If CONFIG_NET_PKT_ALLOC_STATS is enabled, then "net mem" command
can show net_pkt allocation statistics like succeed / failed
allocation counts, average sizes and allocation time.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-10-22 20:38:57 +02:00
Maximilian Deubel
e7ce0f5dab net: lib: wifi_credentials: add connect-stored feature
This patch adds a feature to directly connect to stored Wi-Fi
credentials without having to compose the NET_MGMT commands yourself.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2024-10-22 08:21:04 -04:00
Maximilian Deubel
f6d305a529 net: lib: add wifi_credentials library
Upstream NCS's library for storing Wi-Fi credentials.
This library allows storage of Wi-Fi credentials
using different backends.
Either the Zephyr settings subsystem
or the PSA secure backend can be used.
For testing purposes, credentials can be defined statically.

Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
Signed-off-by: Gregers Gram Rygg <gregers.gram.rygg@nordicsemi.no>
Signed-off-by: Kaja Koren <kaja.koren@nordicsemi.no>
Signed-off-by: Simen S. Røstad <simen.rostad@nordicsemi.no>
Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2024-10-22 08:21:04 -04:00
Brandon Allen
bb24c83d70 net: lib: lwm2m: lwm2m_rw_senml_cbor: only assign time on get_s64() success
Currently GCC complains that temp64 may be used uninitialized in this
 function. Adds a check to ensure time is valid before assignining
 and fixes GCC warning.

Signed-off-by: Brandon Allen <brandon.allen@exacttechnology.com>
2024-10-22 14:12:48 +02:00
Nithin Ramesh Myliattil
b717488be2 bluetooth: BAS: add battery critical status char to bas service
Added the battery critical status char to bas service
as per bas_1.1 spec. Updated BSIM test for BAS service
to test the INDs of BAS critical characteristic.

Signed-off-by: Nithin Ramesh Myliattil <niym@demant.com>
2024-10-22 14:06:35 +02:00
Dominik Kilian
131229b2c4 icbmsg: Allow deregistration of the endpoints
This is implementation of ICBMsg endpoint deregistration.
The underlying ICMsg instance and blocks are not affected by
deregistration, so it is possible to reuse the same address
during the re-registration of the same endpoint.

Signed-off-by: Dominik Kilian <Dominik.Kilian@nordicsemi.no>
2024-10-21 18:43:22 -05:00
Phil Hindman
eea128aa8d fs: shell: Allow retries after a mount failure
Clean up if the mount command fails, such as due to a typo in the mount
point name, so that it can be retried.

Signed-off-by: Phil Hindman <phindman@xes-inc.com>
2024-10-21 18:38:37 -05:00
Gerhard Jörges
372b3a9b8d net: lib: http: add missing includes
filesystem includes, that are required by the static_fs_resource, were
missing.

Signed-off-by: Gerhard Jörges <joerges@metratec.com>
2024-10-21 16:00:14 +02:00
Gerhard Jörges
fc30792b48 net: lib: http: add missing zsock_ prefix
the zsock_ prefix is missing at one setsockopt call

Signed-off-by: Gerhard Jörges <joerges@metratec.com>
2024-10-21 16:00:14 +02:00
Troels Nilsson
6f64f77557 Bluetooth: Controller: Remove incorrect check of RFU bit
RFU bits has to be ignored according to the spec; In addition,
some MediaTek devices seems to have it set (by mistake I assume),
so having the check means we cannot sync to these devices

Signed-off-by: Troels Nilsson <trnn@demant.com>
2024-10-18 17:47:14 +01:00
Vinayak Kariappa Chettimada
b4182caf77 Bluetooth: Controller: Fix Periodic Adv Chain PDU channel indices
Fix missing population of channel indices for Periodic
Advertising Chain PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-18 17:46:23 +01:00
Vinayak Kariappa Chettimada
1eb74c43df Bluetooth: Controller: Fix Extended Adv Chain PDU channel indices
Fix missing population of channel indices for Extended
Advertising Chain PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-18 17:46:23 +01:00
Pavel Vasilyev
8acb1cc577 bluetooth: host: conn: Check if *conn is not NULL
This commit adds a warning and a Kconfig option to `bt_conn_le_create`
and `bt_conn_le_create_synced` functions which are meant to warn a user
of a potential leakage of an active connection object.

This change is implemented due to frequent incorrect use of the
connection pointer where a pointer to an existing connection object
is overwritten by `bt_conn_le_create` and `bt_conn_le_create_synced`
functions which in turns leads to sporadic critical bugs. See
https://github.com/zephyrproject-rtos/zephyr/pull/78284#discussion_r1754304535
for more details.

The Kconfig option is introduced instead of always returning the error
to not affect current implementations. However, it is recommended to
keep this option enabled to avoid potential bugs.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-10-18 17:46:04 +01:00
Andrzej Puzdrowski
17c15e3b4e susbys/dfu/img_util: refined ERASE PROGRESSIVELY implementation
Moved MCUboot trailer's status erase ahead any write operation,
which is step which helps with addition of support for devices
don't require explicit pager erase.
For these kind of devices flattening of mcuboot image status in
the trailer was introduced.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2024-10-18 08:19:28 -04:00
Mustafa Abdullah Kus
d482e3ddfc net: add initial prometheus client library
The library provides Prometheus metrics
types, collector and exposion formatter.
The library isn't thread-safe for now.
The next first pull request will support
that. Can be use exposion formatted
output with Zephyr Http server.

Signed-off-by: Mustafa Abdullah Kus <mustafa.kus@sparsetechnology.com>
2024-10-18 14:17:11 +02:00
Adam Cavender
18f508144e bluetooth: host: CS support for various HCI commands
Adds HCI support for:
- LE CS Security Enable
- LE CS Procedure Enable
- LE CS Set Procedure Parameters
- LE CS Set Channel Classification
- LE CS Read Local Supported Capabilities
- LE CS Write Cached Remote Supported Capabilities
- LE CS Write Cached Remote FAE Table

Signed-off-by: Adam Cavender <adam.cavender@nordicsemi.no>
2024-10-18 14:15:49 +02:00
Vinayak Kariappa Chettimada
ee844550b7 Bluetooth: Controller: Fix short prepare timeout start (2nd attempt)
Fix to setup correct short prepare timeout when preempt
callback does not find the prepare in the head of the
pipeline. In this case, find the short prepare and setup
a fresh preempt timeout for the determined short prepare
present in the pipeline.

Relates to commit 7d1bc1789e ("Bluetooth: Controller: Fix
short prepare preempt timeout start").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-18 14:15:23 +02:00
Vinayak Kariappa Chettimada
ccec1d5150 Bluetooth: Controller: Fix delayed ULL scheduling aux PDU reception
Fix delayed ULL scheduling an auxiliary PDU reception by
skipping it. When many bufferred ADV_EXT_IND are to be
processed, the ULL scheduling could get late and then cause
the scan aux LLL to detect increased overhead start timing.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-18 14:15:23 +02:00
Vinayak Kariappa Chettimada
7d21a61f64 Bluetooth: Controller: Fix to reschedule at window start
Fix to reschedule at window start when there are no more
tickers in the list to check for overlap.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-10-18 14:15:23 +02:00