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 net_if_ipv4_maddr_lookup_raw variant.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
In
d45cd6716bf27a26f9ec
the mayority of this code was changed to use the new native networking
API naming, but one macro was forgotten.
Let's change it now so this code builds also without
CONFIG_NET_NAMESPACE_COMPAT_MODE
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
In d45cd6716b the mayority of the
Zephyr codebased was changed to use the Zephyr native net_ prefixed
types, but some were forgotten.
Without this fix/change the code still builds as we are by now setting
CONFIG_NET_NAMESPACE_COMPAT_MODE. But when this is not set, things
fail to build.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
In d45cd6716b the mayority of this code
was changed to use the Zephyr native net_/zsock_ prefixed types/functions
but some were forgotten.
Let's fix it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the ZTESTABLE_STATIC macro to define symbols which need to be
accessible from ztests, instead of redefining STATIC which causes
trouble with some hals.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the ZTESTABLE_STATIC macro to define symbols which need to be
accessible from ztests, instead of redefining STATIC which causes
trouble with some hals.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use the ZTESTABLE_STATIC macro to define symbols which need to be
accessible from ztests, instead of redefining STATIC which causes
trouble with some hals.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Run the user provided callback for the ISR stacks, instead of ignoring
the callback and printing the summary.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Just for consistency with the code and to avoid finding them on searches,
use the actually used macro names in the log messages.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add support for CS IPT (Channel Sounding Inline PCT Transfer)
in the Bluetooth host stack.
Changes include:
* definition of new CS IPT HCI opcodes;
* handling of CS IPT control procedures;
* integration with existing CS infrastructure;
* necessary updates to public headers.
Signed-off-by: Aleksandr Mirlenko <aleksandr.mirlenko@nordicsemi.no>
This was a leftover from the previous commit that removed usage of
legacy crypto in favor of PSA API.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Before this we have a memory leak in the prep_pool when reassembly fails
in :c:func:`att_exec_write_rsp`. Now on error the buffer is dequeued and
freed, as are remaining queued prepare buffers.
Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
The send scheduler formatted LwM2M paths with `lwm2m_path_log_buf()` even
when debug logging was not enabled for the module, causing build issues
with CONFIG_LOG off.
Signed-off-by: Julien Vermillard <julien@clunkymachines.com>
zms_mount_force() behaves like zms_mount() but automatically wipes and
reinitializes the partition if the initial mount attempt fails.
A corresponding Kconfig option SETTINGS_ZMS_FORCE_MOUNT is added to the
settings subsystem to enable this behavior when using ZMS as the
settings backend.
Signed-off-by: Andreas Anderberg <andreas.anderberg@u-blox.com>
Rename it to USB buffers so we can use it in host support without
confusion. Keep the UDC_* macros for now, we can deprecate and remove
them later.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The implementation only used the receive state's PA sync state
to determine whether to call the PA sync req or PA sync term req,
but that state does not include the syncing state.
Rather than using the receive state's PA sync state, we add a local
boolean to keep track of whether the PA sync was requested, so if
we receive a mod_src with PA sync == BT_BAP_BASS_PA_REQ_NO_SYNC then
we request a termination, even if the PA sync was not established yet.
Some cleanup in the mutex handling was also done as part of this.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Make sure to check packet length check before starting the
IPv4 fragmentation reassembly process. This way we can drop the
malformed packet without consuming resources.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Delete entries in NVS are represented by an ATE with len == 0 and
no associated data.
However, when GC is triggered by a delete operation, the
propagated ATE length may become non-zero due to unconditional CRC
addition, leading to inconsistent semantics and potential mount or
space calculation issues.
Introduce nvs_data_len_with_crc() to centralize the logic of
conditionally adding the data CRC size. This ensures that delete
entries always retain len == 0 and restores consistency across write,
GC and space calculation paths.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Compiler-generated FLIX instructions are currently disabled for LLEXT due
to a historic issue with LLEXT feature that appears to be already
resolved. However, another issue with FLIX is now being investigated.
The latter issue is not related to LLEXT but userspace feature.
To mitigate impact of global complier settings, this change adds a kconfig
choice for controlling FLIX generation independently for LLEXT modules.
Signed-off-by: Wojciech Jablonski <wojciech.jablonski@intel.com>
Make sure choice option name is not same as actual config option
that is enabling it. Use _SECURITY suffix for clarity of what
choice is actually about.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
CTS is missing the Local Time Information characteristic and this
commit adds the UUID and the full characteristic to its service.
The peripheral example has been updated as well to use this and
implement it on the example so it is easy to test it out.
Signed-off-by: Martin Moya <moyamartin1@gmail.com>
- Add kconfig for HCI event synchronous buf pool to allow vendors
to configure buffer count based on the application/host platform
requirements
Signed-off-by: Vinit Mehta <vinit.mehta@nxp.com>
When receiving a DNS query, make sure that the packet contains
also query type and class fields before trying to access them.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Use ate_end_addr >= data_end_addr instead of > to ensure the
last delete ATE is scanned and recovered correctly.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Fixeszephyrproject-rtos/zephyr#103442
Origin: Original
Adds a separate TX traffic class for CDC-ECM and CDC-NCM in USBD Next
to prevent a deadlock during interface provisioning.
Tested with a custom nRF53-app firmware which combines CDC-ECM /
CDC-NCM (both tested) with mDNS with USB hosts MacOS, iPadOS, and
Alpine Linux.
Signed-off-by: Jay Beavers <jay@tolttechnologies.com>
Control read handlers handle_get_status(), handle_get_state() and
handle_upload() return value is used to set errno. Setting errno inside
the functions and then returning 0 therefore does not fail the request
as intended.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Added support for elapsed time service (ETS). The service
is introduced currently with the experimental tag.
Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
The TBS spec only specificially disallows join for calls in
the incoming state. The Alerting and Dialing state in Zephyr
were disallowed, but that fails some TBS join tests.
Removed the (implicit) checks for alerting and dialing and
updated the state changer code to be more explicitly so that
all call states, except for incoming, is explicitly handled.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Refactor bt_tbs_set_uri_scheme_list to take a single string instead
of an array of URIs. This should not affect applications much
in any way (and may actually be easier to use), but simplifies
the implementation significantly, and reduces memory footprint.
Additionally it also make the client and server more similar
as bt_tbs_client_read_uri_list just returns it as a single
string as well.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
bt_pacs_register would assert if e.g.
CONFIG_BT_PAC_SRC_NOTIFIABLE=y but param.src_pac = false.
Add checks for setting the attributes, only if the parameter
actually enables the characteristics.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Adds fixes for build and runtime issues using MWDT:
* Rename sections for llext_memblk.c buffers as MWDT cannot initialize
sys_mem_blocks struct with buffer address when the section name of
sys_mem_blocks struct (its variable name) is identical to the
buffer's section name
* Adds --no-check-sections flag for MWDT on final stages of
linking. Unlike other toolchains, MWDT's default behavior is to
strictly check and fail on section overlap. Using SLIDs requires
overlap; see llext-sections.ld
* Modifies inspect test case's ifdef around rodata sections, as
not all Harvard platforms using MWDT have .rodata_in_data sections -
their creation is triggered by passing the -Hccm flag to CCAC.
As an example, nsim/nsim_em doesn't have them and nsim/nsim_vpx5 does
* Removes -Hccm flag when building with CONFIG_LLEXT_RODATA_NO_RELOC
as it causes CCAC to mark the custom section llext.rodata.noreloc
writable (SHF_WRITE) though it has only read-only data, making it
impossible for for LLEXT to recognize it and put it in the
appropriate region; see llext_load.c's llext_map_sections
* Adds name to unnamed first argument of threads_objects_test_setup,
removing warning about omitting parameter names being a
C2x extension
Also fixes a build warning for GCC about pointer arithmetic in
the INSTR_FETCHABLE macro.
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
Avoid dereferencing `stream` in the debug log message when checking
for invalid input parameters.
The previous log printed `stream->ep` and `stream->conn` inside a
combined NULL check, which could trigger static analysis warnings
about a possible NULL pointer dereference.
Align the implementation with the existing pattern used in the file
by logging a generic "Invalid stream" message instead.
No functional change.
Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
Make nvs_flash_al_wrt_streams() non-static when CONFIG_ZTEST is
enabled so it can be unit tested.
Add test_nvs_write_stream to verify correct concatenation and
write behavior for different head/data/tail combinations.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Rework the NVS garbage collection data move path to support
write-block–aligned packing of consecutive records.
Introduce struct nvs_block_move_ctx to buffer unaligned tail
bytes during GC. Data is moved in write_block_size-aligned chunks
only, and any remaining bytes smaller than one write block are
temporarily buffered and prepended to the next write. The final
tail is flushed before GC completion.
Extend struct nvs_flash_wrt_stream to support an optional
header buffer, allowing head/data/tail segments to be written
as a single contiguous stream while respecting flash alignment
requirements.
This enables packed back-to-back data movement during GC without
introducing additional padding between records. CRCs are not
recomputed for moved data, preserving on-flash format and
compatibility.
No changes are made to normal nvs_write() alignment semantics
outside of GC.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Extend the NVS garbage collection path to optionally commit a
pending write request while GC is running.
Introduce struct nvs_gc_write_entry to describe a write operation
that may be handled during GC. When space is insufficient and GC is
triggered from nvs_write(), the write request is passed to
nvs_gc(). If the entry being updated is encountered in the sector
currently being garbage collected, the old copy is skipped and the
new data may be written directly into the active sector, provided
there is sufficient space.
This avoids unnecessary data movement where the old entry would
otherwise be copied during GC and then immediately superseded by a
new write.
The existing GC behavior is preserved when no pending write is
provided.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Introduce nvs_flash_al_wrt_streams() to support aligned flash
writes composed of a primary data buffer and an optional tail buffer.
This refactors the existing aligned write path to allow multiple
contiguous buffers to be written as a single logical stream while
respecting flash write-block alignment requirements. The new helper
enables cleaner handling of cases where data must be extended with
additional metadata (e.g. CRC) without temporary concatenation
buffers or partial pre-writes.
nvs_flash_data_wrt() is updated to use the stream-based interface
for CRC handling. The existing nvs_flash_al_wrt() API is preserved
as a thin wrapper for backward compatibility.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
iiii
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
When starting adv via handover, we log the address used
for the advertising set for debugging purposes.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Implement the validation if there is exactly one GAP service
in GATT database.
The validation is performed as soon as the GATT database
is available and forbids to enable the Bluetooth if the configuration
is not compatible with the Bluetooth Specification.
The verification may be disabled by the user for better performance
or deliberate implementation that is not compliant with the
specification.
Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
Set the unused argument of the name characteristic to NULL.
This removes the reference from GAP service to the hci_core.
Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
Rename the DEVICE_NAME_GATT_WRITABLE_ kconfig options to
BT_DEVICE_NAME_GATT_WRITABLE_.
Rename DEVICE_APPEARANCE_GATT_WRITABLE_AUTHEN to
BT_DEVICE_APPEARANCE_GATT_WRITABLE_AUTHEN.
The old options are marked as deprecated.
Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
Remove Generic Access Service implementation from gatt files and move it
into separate file in services directory.
The default service implementation can be disabled by the user in purpose
of providing the GAP implementation directly in the application.
Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
Add missing fields in arm,stmesp binding and limit Coresight STM
frontend to SoCs which have the required hardware.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Use specific alignment when STM logging frontend is used on RISCV
core (PPR or FLPR). It fixes the case where 64 bit variable were
incorrectly logged.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>