This log message does not need to be repeated 10 times at the INFO level
when the same information is provided after all the retries are done:
```
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Card does not support CMD8, assuming legacy card
```
to
```
<inf> sd: Card does not support CMD8, assuming legacy card
```
Signed-off-by: Jordan Yates <jordan@embeint.com>
Clean up documentation pages for the new perf tool
as they contained several typos, grammar errors, and
duplicated content between main doc page and sample
page
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Trigger the TX processor on connection teardown.
When a disconnection happens before the controller has acknowledged some
ACL fragments the host has sent, we run `process_unack_tx()` to free
those unacknowledged buffers and their associated TX contexts.
The problem is that the TX processor still holds a reference to the conn
object. That reference is not released until the TX processor is
triggered again and figures out that the connection is invalid.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Fix missing invalid aux offset check that was being caught
in a development assertion check. If aux offset where less
than the PDU time of the primary channel PDU, radio was
redundantly being setup delayed for reception that was
being caught in an assertion check.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Notify only if the device configuration has changed. Pass only the
configuration value as the message status, the actual device speed can
be obtained with usbd_bus_speed().
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This test create a setup where an ISO broadcaster will send fragmented
data and get stopped after sending the first fragment and repeating that
operation multiple time to verify that buffers are not leaked.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
When sending data using ISO and the data is fragmented, if the
connection is cut before all the fragments are sent, the data buffer
will be leaked.
Fix the issue by unref'ing the buffer when ISO is not in a connected
state.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
When disconnected while sending data, if ISO doesn't get the number of
completed packets it will not call `process_unack_tx` and thus will leak
TX context.
Fix that by setting the connection state in ISO disconnection which will
trigger a call to `process_unack_tx`.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
It should have reffered to the architecture,
not one of its board's name.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Convert users of net_buf_put() and net_buf_get() functions to use
non-wrapped putters and getters k_fifo_put() and k_fifo_get().
Special handling of net_bufs in k_fifos is no longer needed after commit
3d306c181f, since these actions are now
atomic regardless of any net_buf fragments.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Replace `shell_fprintf(sh, SHELL_ERROR, ...)` with
`shell_error(sh, ...)` since it brings the same underlying
action with less typing.
Note: `shell_error` already concatenates `\n` to format strings,
so we remove `\n` from the original code.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in `subsys/testsuite/ztest/src/ztest.c` file.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
It's usual to show debug logs as blue.
Showing dbg and info with different colors are good,
but it's preferable to keep info logs with default
color.
Signed-off-by: Félix Piédallu <felix@piedallu.me>
LwM2M SEND functionality is defined in LwM2M v1.1
So quard the condition with protocol version, not
server object version.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
The Host Interface Type in the DEVCNT register sets the HIF type
(either eSPI or LPC).
Currently, it is configured in the host-interface-related drivers like
eSPI or SHI. However, some I/O pads sourced from VHIF in the other
modules such as GPIO and I3C also rely on this field. It might be
problematic when using those I/Os without enabling eSPI or SHI drivers.
This commit moves the setting from the specific drivers to the global
system initialization function scfg_init().
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Introduce Controller dependent EVENT_MAFS_MIN_US value to
use as the value when populating the aux offset between
Extended Advertising primary and auxiliary channel PDUs.
This can be used as workaround for peers having difficulty
receiving Extended Advertising PDUs with near 300 us MAFS
values used in aux offset calculations.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Relax the radio packet pointer assignment deadline assertion
until access address being transmitted. The PDU buffer is
probably only needed just after access address is being
transmitted or received by the radio. This will give some
more breathing room for slow CPUs like in nRF51x SoCs.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix regression using speed optimization introduced in
commit 1b7fe792e0 ("Bluetooth: Controller: Support Link
Time Optimizations (LTO)").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix regression in encrypted connection introduced in
commit f3deccda91 ("Bluetooth: Controller: CCM read data
to early when DF enabled on PHY 1M").
Due to this nRF51x SoC hang waiting to encrypt and/or
check MIC.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
In case of ISR latencies, if packet pointer has not been
set on time then we do not want to check uninitialized
length in rx buffer that did not get used by Radio DMA.
This would help us in detecting radio ready event being
set? We can not detect radio ready if it happens twice
before Radio ISR executes after latency.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Only 3 bytes (PDU_EM_LL_SIZE_MAX) is required for empty PDU
transmission, but in case of Radio ISR latency if rx packet
pointer is not setup then Radio DMA will use previously
assigned buffer which can be this empty PDU buffer. Radio
DMA will overrun this buffer and cause memory corruption.
Any detection of ISR latency will not happen if the ISR
function pointer in RAM is corrupted by this overrun.
Increasing ISR latencies in OS and CPU usage in the
ULL_HIGH priority if it is same as LLL priority in
Controller implementation then it is making it tight to
execute Controller code in the tIFS between Tx-Rx PDU's
Radio ISRs.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix ISR profiling when using single timer for tIFS radio
switching wherein in the timer is cleared on every radio
end. Hence, the captured timer value is the latency and
does not required the radio end timestamp to be subtracted.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Use uint16_t to store ISR profiling value to avoid overflow
in case of higher latencies.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix in-system ISR profiling for advertiser and connection
role for the missing implementation when there is CRC error.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The interval and latency for a CIG are set for each direction now,
allowing applications to use e.g. 10ms for sink ASEs and 7.5ms for
source ASEs.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add name to choice symbol, so that default value can be changed
downstream.
Developed-by: Andreas Rudolf <andreas.rudolf@husqvarnagroup.com>
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
- Remove the `strlen`, as it is unnecessary for safe copying.
- Limit the `strncpy` to `sizeof(fsm->terminate_reason) - 1`
to ensure the last byte is reserved for null-termination.
- Add an explicit null terminator to guarantee correct string termination.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Cloning a packet for a capture may fail due to insufficient memory.
In such a case, the networking statistics should be updated
to reflect this processing error. This commit updates the processing
error count on the capture tunnel network interface because this is
the interface that the captured packet would have been assigned to.
Signed-off-by: Tom Finet <tomfinet@outlook.com>
Add profiling subsystem.
Add perf util based on periodic stack unwinding. Perf from Linux
was taken as a reference.
The operation of module is based on frame pointer usage and saving
registers during interruption handling.
The unwinding function stay in timer as expiry functioin so is called
during interruption handling. Thus the function have access to saved
registers (program counter and frame pointer in particular) of the current
thread and use it to unwind the thread stack.
Timer starting and results printing function are made as shell commands
for conveniency.
Originally-by: Yonatan Goldschmidt <yon.goldschmidt@gmail.com>
Signed-off-by: Mikhail Kushnerov <m.kushnerov@yadro.com>
Refactor (1 << xyz) to use the BIT(xyz) macro.
The change aims to enhance code readability.
Signed-off-by: Muhammad Haziq <muhammad.haziq@zintechnologies.com>
gcc 13 thinks max_adv_duration may be used unitialized
and warns accordingly (see below)
It seems the reason is the goto, which confuses it.
In any case, pacifying this warning is trivial,
so let's just do so.
The warning:
```
In function ‘gatt_proxy_advertise’,
inlined from ‘bt_mesh_proxy_adv_start’ at
subsys/bluetooth/mesh/proxy_srv.c:1214:9:
subsys/bluetooth/mesh/proxy_srv.c:842:44: error: ‘max_adv_duration’ may
be used uninitialized [-Werror=maybe-uninitialized]
subsys/bluetooth/mesh/proxy_srv.c: In function ‘bt_mesh_proxy_adv_start’
zephyr/subsys/bluetooth/mesh/proxy_srv.c:786:17: note:
‘max_adv_duration’ was declared here
786 | int32_t max_adv_duration;
| ^~~~~~~~~~~~~~~~
```
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
On ARM64 the build will fail with coverage and GCOV enabled:
CONFIG_COVERAGE=y
CONFIG_COVERAGE_GCOV=y
CONFIG_FORCE_COVERAGE=y
west build -b rpi_5 -p always samples/hello_world -- \
-DCONFIG_COVERAGE=y -DCONFIG_FORCE_COVERAGE=y
Failure:
"linker_zephyr_pre0.cmd:181: undefined symbol `__gcov_bss_end' referenced
in expression"
Fix build of ARM64 platforms with coverage and GCOV enabled by adding for
ARM64 the same gcov linker sections as it is done for ARM.
Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
90ab94f61d added a change that source name pointers were not stored
in the const data structure associated with a logging source. That was
done because those string pointers were invalid (on purpose pointing to
non-existing memory) and reading those strings could lead to a fault.
However, those pointers are used by scripts which are building the
dictionary database and after this change script was no longer
able to retrieve source names from elf file and database was incomplete.
This patch brings back storing of source name string pointers but in
API for reading those source names guards are added to not return
invalid addresses.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Undefine _POSIX_C_SOURCE before defining it to avoid double
definition
The previous version, changed in this PR
https://github.com/zephyrproject-rtos/zephyr/pull/70363, did the undef.
Make sure to do the same for all files in the current dir.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
- Made CCC_STORE_MAX configurable under the BT_SETTINGS
- Added a buffer overflow check on ccc_save
Fixes: #76838
Signed-off-by: Yago Fontoura do Rosario <yafo@demant.com>
Using DEVICE_DEFINE, a device without a corresponding DT node can be
defined (for example CRYPTO_MTLS), Z_DEVICE_INIT() does not initialize
dt_meta for such devices, leaving the field as NULL.
device_get_dt_nodelabels() and functions calling it have to handle
dev->dt_meta == NULL to prevent fatal errors.
Signed-off-by: Jan Peters <peters@kt-elektronik.de>
http1_headers_sent flag has to be cleared when entering
HTTP_SERVER_REQUEST_STATE and not only on the client init. Otherwise,
serving multiple HTTP1 POST requests over the same connection does not
work as intended (headers were not sent for the second and further
requests).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Make appending to the newest log file in the fs logging backend optional.
By default, if there is still free space in the latest log file,
the fs logging backend appends to it on startup. This is useful for saving
space and avoiding the removal of older log files, if the maximum number
of log files has been reached. The drawback of this behavior is,
that log files that got appended can not be decoded, if the firmware
has changed between startups, for instance by an update,
since the log_dictionary.json used for decoding has also changed.
Therefore, it may be desirable to deactivate appending to log files.
Signed-off-by: Niklas Fabian <niklas.fabian@lemonbeat.com>
This function call frees the buffer kept by the host for reassembling L2CAP
PDUs into.
Without this call, the current buffer will eventually be
leaked, leading to a non-functional host due to lack of RX buffers.
The effect is worse when host flow control is not enabled, as the RX
buffer pool is shared with events, which means communication with the
controller is essentially dead.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
`net_buf_alloc(K_FOREVER)` can now return NULL if running in the system
workqueue. `bt_hci_evt_create()` is called in that context in a few cases.
Since we can't really do anything about it, add a (default-on) assert.
This should ideally never fail. I saw it fail because of a leak in the ACL
buffer pool, which is also shared with events when host flow control is not
enabled.
In that particular case, the host is rendered non-functional, so trying to
recover using error handling is futile.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>