Add a new Kconfig option CONFIG_LOG_RUNTIME_DEFAULT_LEVEL that allows
setting the initial runtime filter level at system startup, independent
of compile-time log levels.
This enables a common use case where firmware needs to:
1. Compile with DEBUG level (to include all log macros)
2. Boot with minimal logging (e.g., ERROR only for quiet startup)
3. Allow dynamic runtime increases via IPC or other mechanisms
Previously, autostart backends were always initialized with
CONFIG_LOG_MAX_LEVEL, which meant compile-time and initial runtime
levels were coupled. This change decouples them when runtime filtering
is enabled.
Changes:
- Add CONFIG_LOG_RUNTIME_DEFAULT_LEVEL Kconfig option under
LOG_RUNTIME_FILTERING, defaulting to LOG_DEFAULT_LEVEL
- Update z_log_runtime_filters_init() to use the new config for initial
aggregated filter levels
- Update autostart backend initialization in z_log_init() and
activate_foreach_backend() to use CONFIG_LOG_RUNTIME_DEFAULT_LEVEL
instead of CONFIG_LOG_MAX_LEVEL when runtime filtering is enabled
This allows firmware to start with ERROR-level logging while keeping
full DEBUG compile-time capability, then dynamically increase verbosity
as needed without recompilation.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
This will save flash memory by 1489 bytes and make usage help look
uniform in different commands.
Re-order the shell commands to alphabetical order. This has been
done before but has bitrotted over time.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The standard format "frame-based payload" was abused as a way to get
generic descriptors that match all other format and frame types.
This is not accurate as some fields do not match, causing misalignment
of some struct fields in some case.
Correct the misuse by introducing new valid structs and refactoring the
descriptor parsing to use them instead.
Signed-off-by: Josuah Demangeon <me@josuah.net>
Only bind to a controller after probing. Wait that a class is matching and
assigned to a device to assign a host controller to a class. This allows
a class to be used by any of the controller in place.
Remove the `c_data->uhs_ctx` field, not used anywhere, in favor of using
`c_data->udev->ctx`.
Signed-off-by: Josuah Demangeon <me@josuah.net>
This will save flash memory by 646 bytes and make usage help look
uniform in different commands.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Make sure to check packet length check before starting the
IPv6 fragmentation reassembly process. This way we can drop the
malformed packet without consuming resources.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Previously the name was only set when CONFIG_NET_L2_PPP_LOG_LEVEL >=
LOG_LEVEL_DBG. NET_ERR/NET_WRN in ipv6cp (and others) use fsm->name
as %s at any log level, which could pass NULL into the logger and
crash in cbprintf/strlen. Always assign the name so logging is safe.
Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>
Add check in valid_unicast_audio_start_param to verify
that the ep connection matches the member_conn.
Instead of declaring the endpoints in the unit tests, we
not define them in the mock unicast client and use the
discover function to get pointers.
This allows for a proper implementation of
bt_bap_unicast_client_has_ep as well as makes the tests more similar
to a normal application.
This change required a significant change in the unicast_stop
unit tests as well, which uncovered a small bug in the implementation.
The bug was fixed as part of this commit.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
There's no use of k_poll in the host stack anymore, so remove leftovers
and related definitions.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
The Bluetooth Mesh code depends on k_poll, so it should have the
appropriate select statement in its Kconfig.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Any leading -D passed to target_compile_definitions on an item will
be removed, here remove them to make code style consistent.
Signed-off-by: Paul He <pawpawhe@gmail.com>
NVS calculates required_space for an entry by summing data size, ATE size
and CRC size. However, the CRC size is assumed to be 4 bytes and the
calculation does not account for the flash write block size.
On flashes with write_block_size greater than 4 bytes (e.g. 8 or 16),
the data + CRC payload must be padded to the write block size. The
current logic underestimates the required space, which may cause writes
to cross sector boundaries and corrupt adjacent entries or ATEs.
Fix this by aligning the data + CRC payload size to the flash write
block size before adding the ATE size to required_space.
This makes NVS space accounting consistent with flash write granularity
and prevents sector overflow on non-4-byte write block devices.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
Fix draw_char_htmono() to compute byte offsets with row-based
HTILED addressing and keep g_y controlled by the outer loop.
This avoids row-skips and broken rendering near clipping boundaries.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Fix cfb_framebuffer_finalize() to invert the software framebuffer
only when pixel format polarity and cfb inversion state differ.
This restores the expected behavior for MONO01/MONO10 finalize output.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Handle both VTILED and HTILED framebuffer layouts in cfb_invert_area().
Also update the basic cfb test helper to read pixels correctly for
HTILED buffers.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Update ll_data_path_tx_pdu_release() to have return -ENOTSUP
so that the node_tx is released using the fallback method to
use the MFIFO from LLL to ULL_HIGH context.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add the 'net dns browse <service>' command to resolve multiple hosts of a
certain service type.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Add an entry to the DNS cache for DNS_RESPONSE_DATA messages, and return
dns_read with DNS_EAI_ALLDONE instead of DNS_EAI_NODATA.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
In large networks there can be many DNS responses, make the DNS info queue
size configurable to prevent dropping messages
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
When modem_pipe_notify_closed() is removed from pipe->close() call,
we rely on the UART callback to notify when the UART is closed.
If we call uart_rx_disable() twice, we might lose the callback,
and the pipe status stays open.
This happens when modem_cellular_run_shutdown_script_event_handler() calls
modem_pipe_close_async() followed by modem_cellular_enter_state(IDLE)
which also calls modem_pipe_close_async().
Prevent side-effects of calling the close twice, by checking the already
existing atomic bit.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Use SHELL_HELP macro for help strings to ensure consistency across
various shell modules.
This also documents the usage for each command.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Rather than manually checking the number of arguments and printing an
error message, let the shell subsytem handle the validation for us by
indicating all arguments as required.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Convert USB device shell command help strings to use the
SHELL_HELP() macro instead of inline help text.
This aligns the USB device shell with the updated shell help
formatting used across the tree and ensures consistent
presentation of command descriptions and argument usage.
Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
The "@funcprops" Doxygen alias was originally introduced to list all
the function properties that apply to a given function (e.g. isr_ok,
etc.) in the form of a bullet list. However, since commit a258ab32d1
that is no longer the case and all the properties are rendered as
qualifiers (https://www.doxygen.nl/manual/commands.html#cmdqualifier)
and therefore no longer need to be grouped in a separate list.
This commit also ensure all aliases for the actual qualifiers use
`@qualifier` notation instead of `\qualifier` to be consistent with
our Doxygen guidelines.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The net_buf was always initialized with net_buf_simple_init_with_data
which was a bit wasteful as we only need to do that once. Since `inst`
is `static`ally allocated, we can check for `.data == NULL`.
Additionally the read callbacks expect the buffer to be 0-initialized
between each usage, which wasn't the case. We can use the `buf.len`
to determine how many bytes we need to reset to `0`.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This check was asserting on the wrong struct size and was not taking in
the architecture configured cache line size. The build assert now checks
the right struct size and takes into account the configured cache line
size or sets a default.
Additional makes the check entire opt in.
Signed-off-by: Tom Burdick <thomas.burdick@infineon.com>
OP_DELAY requires embedding in the submission queue entry a _timeout
struct which can push the struct size over the specified 64 byte (cache
line) limit.
Signed-off-by: Tom Burdick <thomas.burdick@infineon.com>
zsock_send() does not necessarily have to send the entire data. Use the
recently introduced function zsock_send_all().
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Depending on the server, functions, and client application, we may
get out of transfers very quickly. To throttle here may allow
submitted transfers to be finished.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
UHC transfer handling and assignment of completed transfers to URB
sequences relies on the buf->size. For that, we can just use variable
net_buf pools instead of fixed. Perhaps it gives us also better
utilization of the buffer.
Add Kconfig optons to configure pool size and number of buffers
and use large default pool size for native_sim platform.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Make request completion handling a bit more robust when, for whatever
reason, the connection has been closed. Do not implicitly clear the USB
device pointer on client disconnect, to allow the completion callback to
clean up. Before handling USBIP_RET_SUBMIT, check whether the device is
still exported, and if not, just drop completed transfer.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The mutex should be held when calling dns_resolve_init_locked as mentioned
in a comment above the function.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
The current way of setting the public address using
`bt_hci_driver_api::setup` does not work well in split builds
where host and controller runs on different cores/socs/boards.
This approach requires each HCI driver and each `hci_<transport>`
application to implement the setup and pass the information on
to the next layer.
Zephyr already defines a vendor-specific command that can be used
to set the public address (`bt_hci_cp_vs_write_bd_addr`).
Use this in `bt_enable` after opening the HCI transport and before
initializing the id module. This makes the setup independent of
hci transport and only depends on a controller that implements the
Zephyr HCI VS commands.
Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
Move the Kconfig template to configure the number of instances in, for
example, functions or class drivers, to a common directory.
This makes it less confusing when used in host support.
Template was not used in CDC ECM function and can be removed.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The static global UUID variable in the GATT shell module was shared across
all concurrent discover and read-by-uuid operations, creating a potential
race condition where one operation could overwrite the UUID before another
completed. Move UUID storage into the per-operation gatt_op_context
structure to isolate UUID state for each operation. This enables safe
concurrent operations without data corruption.
Signed-off-by: Evgenii Kosenko <Evgenii.Kosenko@silabs.com>
for checking the first two chars of a string
we don't need to get the full lenght, we can simply
just check the 2 chars, especially as we already check
the first one already.
in `fs_opendir` we only need to check the first char.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The friendly name buffer sizes used the URI length, but since
the friendly name is specifically not an URI that did not make
sense. Added a new Kconfig option to configure the maximum
supported friendly name, which is shared between both TBS
and the TBS client, similar to the other max Kconfig options.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>