Commit Graph

19768 Commits

Author SHA1 Message Date
Phil Hindman 09574e68eb fs: littlefs: Gracefully fail when static buffers are too small
The cache_size and lookahead_size are set at compile time using the
CONFIG_FS_LITTLEFS_CACHE_SIZE and CONFIG_FS_LITTLEFS_LOOKAHEAD_SIZE values
from Kconfig, or from the cache-size and lookahead-size properties in a
'zephyr,fstab,littlefs' compatible in the devicetree.  Those values are
also used to statically allocate buffers that are pointed at by the
read_buffer, prog_buffer, and lookahead_buffer members of the lfs_config
structure.

At runtime, when using a block device, the cache_size and lookahead_size
are updated to be multiples of the underlying block device's block_size,
which may make them bigger than the original size used to allocate the
static buffers. Log an error and fail the operation when this occurs.

Signed-off-by: Phil Hindman <phindman@xes-inc.com>
2024-10-25 22:45:55 +01:00
Dominik Ermel 87ce37f7c4 storage/stream_flash: Make context const where not modified
The commit sets const qualifier struct stream_flash_ctx *ctx parameter
of Stream Flash API calls:
  stream_flash_bytes_written
  stream_flash_progress_save
  stream_flash_progress_clear

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-10-25 22:45:33 +01:00
Dominik Ermel 8714c172ed storage/stream_flash: Fix range check in stream_flash_erase_page
Added check where stream_flash_erase_page checks if requested
offset is actually within stream flash designated area.

Fixes #79800

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-10-25 22:45:14 +01:00
Emil Gydesen 1dd59ea203 Bluetooth: Audio: Remove BT_AUDIO_BROADCAST_CODE_SIZE
Removed the LE Audio specific definition and instead
refer to the value defined by iso.h as it is ISO/Core
that defines this size, and not BAP/Audio.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-25 22:43:40 +01:00
Lars Knudsen c966eac722 Bluetooth: Shell: Fix missing RX QoS param and MSE check
The bis_iso_qos.rx was missing in param sent in bt_iso_big_sync

Also, MSE = 0 is valid (fixed error check)

Signed-off-by: Lars Knudsen <LAKD@demant.com>
2024-10-25 12:55:32 -05:00
Jukka Rissanen 074b5f2ca0 shell: backend: websocket: Fix socket service creation
The NET_SOCKET_SERVICE_SYNC_DEFINE_STATIC() macro was changed
earlier but the compilation error was missed. Fixing the macro
call.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-10-25 12:50:54 -05:00
Jukka Rissanen 34bb8cb35c logging: backend: websocket: Avoid uninit variable warning
The ret variable might be used uninitialized.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-10-25 12:50:54 -05:00
Lars Knudsen 09546ff3e3 Bluetooth: Shell: Set err to 0 before shell_strtoul
The value of err was not initialized to 0 prior
to calling shell_strtoul, which only sets err
on actual error.

Signed-off-by: Lars Knudsen <LAKD@demant.com>
2024-10-25 12:50:23 -05:00
Fin Maaß cd3dcf788a net: socket: service: mark as unstable
As the socket service API is currently used by mutiple applications
(dhcpv4 server, dns, telnet), it should be marked as unstable,
according to the docs:
https://docs.zephyrproject.org/latest/develop/api/api_lifecycle.html

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-10-25 18:50:07 +01:00
Lars Knudsen c15f8edd60 Bluetooth: Shell: Fix iso sync timeout range check
Using BT_ISO_SYNC_TIMEOUT_MIN and BT_ISO_SYNC_TIMEOUT_MAX now.

Signed-off-by: Lars Knudsen <LAKD@demant.com>
2024-10-25 12:49:38 -05:00
Fredrik Danebjer f970b066d2 Bluetooth: audio: Add possibility to use static broadcast id
Removed the generation of broadcast id inside the stack. It is now up
to the application to generate this by itself. The CAP sample has
been modified to allow either a static broadcast, or a random one.
All of this is handled in the application.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2024-10-25 14:07:25 +02:00
Olivier Lesage 7e72d46e2e bluetooth: host: Add helper function for parsing PCTs
The 12-bit signed values for the results of PBR are a bit
cumbersome, so this adds a helper function to make it easier to work
with the HCI formatted steps.

Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
2024-10-25 14:06:25 +02:00
Olivier Lesage 635d03b7e0 bluetooth: host: Unit tests for bt_le_cs_step_data_parse
Add unit tests for bt_le_cs_step_data_parse.
Also exit early (without calling the function pointer) if the next
step would seem to read out of bounds.

Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
2024-10-25 14:06:25 +02:00
Emil Gydesen 16605585c0 Bluetooth: Audio: Add bt_audio_data_get_val
Add a generic function to retrieve any data based on an
assigned numbers type. This function can in theory be
used for any data type, and not just LE Audio types, but
since it relies on bt_audio_data_parse it was made
specificially for LE Audio.

The function can be used in cases where
bt_audio_codec_cfg_get_val, bt_audio_codec_cfg_meta_get_val,
bt_audio_codec_cap_get_val or
bt_audio_codec_cap_meta_get_val (or their derivation)
are not easily applicable due to the type constrainst.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-25 14:01:42 +02:00
Jamie McCrae 973ba91487 mgmt: mcumgr: transport: Add LoRaWAN MCUmgr SMP transport
Adds a transport that uses LoRaWAN for receiving and responding
to messages

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2024-10-25 14:00:48 +02:00
Hui Bai aaebe38db9 net: Increase net_mgmt task priority
Originally, the net_mgmt task priority is very low. Based on roaming
implementation, roaming is triggered in net_mgmt task. When running UDP
test while doing roaming, the net_mgmt task won't have much chance to
run and roaming can't be triggered.
Increase it to 3, which is same value of supplicant task.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-10-25 13:53:49 +02:00
Hui Bai 83812f213f modules: hostap: add 11k/v/r roaming support
Added new ops and events in glue layer to support roaming.
Added new flag WIFI_NM_WPA_SUPPLICANT_ROAMING to control roaming
feature.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-10-25 13:53:49 +02:00
Hui Bai 91ec46e961 modules: hostap: add IEEE80211R support
Add 80211R support in hostap.
Add cmd wifi connect option '-R' to enable 80211R.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-10-25 13:53:49 +02:00
Hui Bai 7c167c67c3 modules: hostap: add 11k cmd support
Add 11k cmds support. User can issue 11k cmds to enable/disable 11k and
send Neighbor Report Request packet.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-10-25 13:53:49 +02:00
Chaitanya Tata cef6b69a39 net: lib: capture: Fix build error
The CONFIG_ prefix was missed.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-25 08:52:22 +02:00
Laczen JMS 95fa167e45 settings: introduce priority for commit
A priority is introduced to allow scheduling of commit routines.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2024-10-24 22:04:07 +01:00
Riadh Ghaddab d4e246dfa1 fs: introduce ZMS a new Memory storage system
ZMS is the abreviation of Zephyr Memory Storage.
It is a storage developed to target especially the non erasable devices.

The new memory storage system inherit from the NVS storage multiple
features and introduce new ones :
* Inherited features :
 - light key-value based storage
 - cache for entries
 - Wear Leveling of flash memory
 - Resilience to power failures
* New features :
 - cycle counter for non erasable devices (instead of erase emulation)
 - Keys up to 32-bit
 - Built-in support of CRC32 for data
 - Small size data (<= 8 bytes) integrated within entries

Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
2024-10-24 16:57:12 +01:00
Grzegorz Swiderski bcf6a91689 logging: stmesp: Do not append strings on nRF54H20 EngB VPRs
Just like on nRF54H20 EngC.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-10-24 16:55:44 +01:00
Troels Nilsson eab3f49247 Bluetooth: Controller: Introduce scan_aux_chain context
Introduces the concept of ll_scan_aux_chain, that allows for
keeping track of several advertising chains with a minimal
overhead. This replaces using several scan aux sets each with
an associated ticker IDs

Only one ticker is used for following chains; This is achieved
by having the scheduled chains in a sorted list and restarting
the ticker when the first in the list expires

EVENT_DONE_EXTRA_TYPE_SCAN_AUX now includes a pointer to the lll
structure to identify which chain to flush (to avoid race
conditions)

New implementation is hidden behind a config for now (defaults
to off): BT_CTLR_SCAN_AUX_USE_CHAINS

Other minor changes:
- rx_incomplete node pointer was moved to ll_sync_set
- data_len removed from ll_sync_set (it uses the chains instead)

Signed-off-by: Troels Nilsson <trnn@demant.com>
2024-10-24 16:55:35 +01:00
Gerard Marull-Paretas 578008cd47 pm: policy: allow using latency API in standalone mode
This option allows using the pm_policy_latency* APIs to gather latency
requirements on systems that do not support PM (e.g. systems whithout
CPU idle states). Because the API has a subscription mechanism, it can
be useful to perform system-level adjustments based on latency
requirements gathered from multiple system components.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-10-24 17:50:44 +02:00
Gerard Marull-Paretas 6f4bb118a8 pm: policy: split policy APIs implementations
policy.c has grown organically, it contained many independent pieces of
code. This patch splits each logical unit into its own C file, making it
easier to browse the code.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-10-24 17:50:44 +02:00
Alberto Escolar Piedras a5e3a33b39 ipc: icmsg & icbmsg: Fix alloc_tx_buffer() doxygen description
The return values were not correct, and the parameters descriptions
were not too easy to understand.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-10-24 13:15:35 +01:00
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