This commit implements simple rate-limiting for Neighbor Reachability
Hints in TCP module to prevent the potentially costly process of
frequent neighbor searches in the table, enhancing system performance.
Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no>
When running it in a multicore and with incoherent cache environment it
is possible that the thread allocating dynamic stacks is switched to a
different cpu. In this situation further access to that memory (like
when releasing resources) will be invalid.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
When allowing dynamic thread stack allocation the stack may come from
the heap in coherent memory, trying to use cached memory is over
complicated because of heap meta data and cache line sizes.
Also when userspace is enabled, stacks have to be page aligned and the
address of the stack is used to track kernel objects.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Refactor DMAR structure to allow more tests. Use fake void function
for invalid size tests.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Multiple CDC ACM instances can block each other because there are only
buffers for a single instance. Fix this by configuring the number of
buffers in the pool based on the number of CDC ACM instances.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The reference document says that the formula for negative
temperatures has two minus signs missing.
fixes#68710
Signed-off-by: Tobias Röhmel <tobias.roehmel@rwth-aachen.de>
Changed poll to perform incoming data check with connected
DTLS connections. This allows the CONFIG_NET_SOCKETS_DTLS_TIMEOUT
to timeout the connections to server socket if there is no
incoming data.
Previously, if the remote client closed the DTLS connection without
close notify, the timeout of the ongoing connection only happened
when next connection was taken to the server socket. Depending on
the timeouts, this could prevent the next connection from succeeding.
Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
The point of this commit is to allow users to request specific
channels. The following code snippet shows how this may now be
achieved:
int requested_channel = 5;
int ret = dma_request_channel(dev, &requested_channel);
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
After #63289, multi-level interrupts are now encoded using
macro magic. This means that using the generic DT_INST_IRQ_BY_IDX()
to fetch the INTID is no longer an option as the queried INTID
will be the one specified through the node's `interrupts`
properties. To fix this, switch to using DT_INST_IRQN_BY_IDX()
which will return the correctly encoded INTID.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Currently, the number of channels supported by the controlled
is computed based on the size of the channel array. This
works well only if there's no gaps (i.e: "dma-channels" property
is used or "valid-channels" property is used with contiguous
channels) but will break if there are any gaps. For instance,
if the user wants to use channels 16 and 17 and specifies them
through the "valid-channels" property, they won't be allowed
to do so because dma_request_channels() will stop at channel 1.
As such, to fix this, simply use the number of channels from
the HAL configuration which is the maximum number of channels.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Once an ISO channel has connected, the sequence number
always starts at 0. This reset was missing in the implementation,
and the _prev_seq_num from a previous connection may have
been kept.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Before a LL_FEATURE_REQ is sent, verify that the Data Length Update
procedure is still supported as it could have been unmasked as the result
of a previously completed Feature Exchange procedure.
Add unit test to verify the case of enqueuing both a
Feature Exchange procedure and Data Length Update procedure, where the
Feature Exchange procedure would result in the unmasking of the Data
Length Update procedure.
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Resume the TX Data Q when a LL_UNKNOWN_RSP is recieved instead of a
LL_PHY_RSP.
Update PHY Update unit test with more coverage of the TX Data Q pause
state.
Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
Updated the instance with the device id to have it in the summary
report also when using pytest harness.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Update outdated links. This includes a new repository address for the
Golioth OTA sample and an updated path for the OTA documentation.
Signed-off-by: Mike Szczys <mike@golioth.io>
LTO cannot be really used with the native simulator based
targets neither today.
When doing a partial link as we do for these targets
the linker will complain if we are mixing LTO and non LTO
built code, and fall back to only produce non-LTO output.
(The link warning will cause twister to fail the test)
Today not all inputs to this partial link are built
with LTO enabled (offsets.c and the app library are not).
Even if they were, the native targets are mostly
a test and debugging facility, so optimizations like
these are not beneficial in general.
Let's just prevent selecting LTO for these targets.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Update MIPI DBI display migration note to match the correct display
configuration settings for reset and MIPI DBI command pins after ILI9xxx
display was transitioned to this API.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Change reset pin polarity for MIPI DBI SPI controller, so that the board
devicetree is responsible for setting the GPIO to active low, and the
driver always sets the pin to a logic 1 to reset the display.
Fixes#68562
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
If the channel suspend with draining fails on stop because of reasons
outside of the scope of the DMA driver (the peripheral is powered off
before trying to drain for example) we must continue and disable the
channel.
The channel can be released by the client despite of it remained enabled.
A new DMA channel request can pick the channel (as it is released) but
re-configuration is going to be skipped and the use of the channel is going
to fail. Then we will see the same drain timeout on channel stop again
since the channel retained the configuration which resulted the first
timeout.
The drain timeout was made fatal by an earlier commit which fixed the
WAIT_FOR return value handling.
Fixes: 6226f9e6e4 ("dma: dw: fix the return value check")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Documentation does not describe how to run QEMU on Windows.
Add description of steps needed to run QEMU and use QEMU
with Twister on Windows in Beyond the Getting Started
Guide. Add a reference to it in Aplication Development
section.
Tested using Windows 11 and QEMU installer from
https://qemu.weilnetz.de/w64/
Signed-off-by: Michal Smola <michal.smola@nxp.com>
The driver masked the return value of a pin read operation before
checking the error.
Thus not detecting a potential error and leading to logically
dead code, which was detected by coverity in CID 340853.
Anther instance XORs 1 before returning, resulting in an unexpected
return value;
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
Add a test that checks that both advertisers, the legacy and the
extended behaves identically when the stack is suspended, in particular:
- `bt_mesh_send_cb.end` callback is called with error code `0` for the
advertisement that the advertiser already pushed to the ble host
(called `bt_mesh_send_cb.start`),
- `bt_mesh_send_cb.start` callback with error `-ENODEV` is called for
every advertisement that was pushed to the mesh advertiser using
`bt_mesh_adv_send` function before the stack was suspended,
- `bt_mesh_adv_create` returns NULL when attempting to create a new
advertisement while the stack is suspended.
The `bt_mesh_adv_disable` is called from the work because calling it
from the `bt_mesh_send_cb.start` callback will cause a deadlock.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This will warn if any of the mesh module will try to send anything while
the stack is suspended. Not clear what to do here as both advertisers
(legacy and ext) behaves differently. The legacy advertiser has a
thread which is stopped after the `bt_mesh_adv_disable` call and any
sent advs after suspending the stack will stay in the pool until the
advertiser is resumed. The extended advertiser will schedule its work,
but then fail because `ext_adv->instance` value is NULL, but will call
`bt_mesh_send_cb.start` with error `-ENODEV`. What to do with these 2
behaviors is unclear at the moment. Ideally none of the mesh stack
modules should call `bt_mesh_adv_send` after the stack was suspended, so
if this warning appears, the faulty module wasn't stopped properly and
this should be fixed. If not to add the adv to the pool, then it kind
of gets lost as the implementation probably expects one
of `bt_mesh_send_cb` callbacks which will never be called. Leaving the
warning until clear customer request comes.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit changes error code returned by `k_sem_take` when it times
out from `-EAGAIN` to `-ETIMEDOUT` because `bt_le_scan_start` also
returns `-EAGAIN` if bt device is not ready, which may lead to invalid
test behavior.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
By default, the DFU sample uses 0x0005 as PID in the Run-Time descriptors,
and when detached to the "proper" DFU mode, it uses 0xFFFF (one of the
values suggested by the DFU 1.1 spec).
So, 0xFFFF added to the table as well as indications of Run-Time and
DFU mode on both DFU entries.
Signed-off-by: Diego Herranz <diegoherranz@diegoherranz.com>
WIFI scan result shows junk character in SSID because of
the length of ssid is maximum(32 character) which leads
to buffer overflow. It required one character for null
terminator ‘\0’.
Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
During local testing with UBSAN enabled, warning was reported:
bluetooth/host/l2cap.c:980:25: runtime error: member access
within null pointer of type 'struct k_work_q'
It turned out that le_chan->rtx_work.queue can be NULL.
Since null-pointer dereference is a UB, additional check
was added to ensure we don't access
`le_chan->rtx_work.queue->thread` when
`le_chan->rtx_work.queue == NULL`
The same changes applied to l2cap_br.c
Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
During local testing with UBSAN enabled, warning was reported:
bluetooth/host/iso.c:237:2: runtime error: null pointer passed
as argument 2, which is declared to never be null
It turned out that when datapath doesn't contain
codec information, cc_len is 0 and cc is NULL
In order to avoid UB,
now we call memcpy only when cp->codec_config_len > 0
Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
during local testling, UBSAN reported the following warnings:
- bluetooth/host/adv.c:2067:19: runtime error: shift exponent
255 is too large for 32-bit type 'long unsigned int'
- bluetooth/host/scan.c:828:18: runtime error: shift exponent
255 is too large for 32-bit type 'long unsigned int'
It turned out that we can't use BIT() macro directly on
bt_hci_evt_le_per_advertising_report::cte_type field.
According to Core Spec, `cte_type = 0xFF` corresponds
to `No contstant tone extension`.
Added separate function to convert CTE bit field from
HCI format to bt_df_cte_type
Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
Use _current_cpu->id instead of CURR_CPU since that works
with/without multicore and contains additional checks.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
If `CONFIG_BT_MESH_GATT_SERVER` is disabled or the advertising set
doesn't support proxy adv, the solicitation PDU will not be sent.
However, solicitation PDU transmission doesn't depend on the proxy
feature of the device it sends. Therefore, solicatation PDU should be
sent regradless of `CONFIG_BT_MESH_GATT_SERVER` option and advertiser
tag.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Extend timeout to perform coverage analysis when testing on HW.
Coverage mode makes execution slower.
Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
Used to perform coverage analysis when testing on HW.
Gathering coverage data require more stack,
so its needs to configurable.
There is used CONFIG_TEST_EXTRA_STACK_SIZE for that.
(with value depending on used HW).
Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
The res param in offload_freeaddrinfo is not used.
Mark it as unused, to avoid static analysis complaining about
Parse warning (PW.PARAM_SET_BUT_NOT_USED)
Fixes CID 316235
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
Where advertisement, connection and disconnection is iterated over 5
times, to verify the reestablishment of extended advertisements when
iterating over multiple times. Additionally, the connection
unreferencing has been decoupled from the disconnect event on both
sides, to demonstrate the dependency of the recycle event.
Signed-off-by: Luis Ubieda <luisf@croxel.com>