Fix the leak of node rx buffer used to generate the
connection complete and CSA#2 event introduced in the
commit 4a5f263e5a ("Bluetooth: controller: split: Validate
chan map and hop value") and the
commit 94d5f0854e ("Bluetooth: controller: fixing error
re. all zero chmap in conn-ind").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This is a follow-up to commit 763e73d7da.
Switch to the new properties for specifying SDA and SCL pins,
as the old ones (sda-pin and scl-pin) are now deprecated.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This is a follow up to commit 2aab687270.
Since device_is_ready() is no longer a system call, there is no need
to keep z_impl_device_is_ready().
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Switch to the new API for delayed work related to DNS queries.
In the previous solution it was assumed that the work item could be
immediately cancelled at the point the query slot was released. This
is not true. We need a secondary condition to record the fact that
the query was completed while the work item was still pending, and an
additional check to detect when the work item completed and the slot
reclaimed.
Also annotate functions to indicate when they require the lock on
query content to be held, add some helpers that abstract core
operations like invoking a callback or releasing a query slot, and fix
some more cases where query slot content was accessed outside of the
new lock infrastructure.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Instead of silently closing the link we should send a Link Close message
three times before resetting provisioning state.
From Mesh Profile Specification v1.0.1.:
```
5.3.1.4.3 Link Close message
The Link Close message is used to close a link.
```
```
5.3.2 Link Establishment procedure
The device shall start the link timer, set to 60 seconds, when the link
is open. When the link timer expires, then the device shall close the
link.
```
```
5.3.3 Generic Provisioning behavior
If the sender does not receive a Transaction Acknowledgment message
within 30 seconds after sending the first message in a transaction,
the sender shall cancel the transaction, cancel the provisioning
process and close the link.
```
From Mesh Profile Test Specification p6:
```
MESH/PVNR/PBADV/BV-01-C
Test Procedure:
[...]
6. The IUT is induced to send a Link Close message with the Reason field
set to 0x02 to terminate the link. The message is sent at least three
times to ensure the message is received by the Lower Tester.
```
Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
Refactor out the BR/EDR handling from hci_core.c to its own source file
in br.c.
BR/EDR consists of inquiry and discovery roles in addition to
initialization. SSP is still kept separate.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Align the SSP HCI event handlers with the rest of the functions in using
the bt_ prefix. In order to avoid name conflict with the HCI struct
definitions the infix _evt_ has been dropped.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix compilation error with BR/EDR is enabled but the feature
CONFIG_BT_KEYS_OVERWRITE_OLDEST is disabled.
This caused compilation error because the field aging_counter is not
defined in the keys struct.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Refactor out the advertiser roles handling from hci_core.c to its own
source file in adv.c.
Advertising roles consists of legacy and extended advertiser, and
periodic advertiser.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Refactor out the scan roles handling from hci_core.c to its own source
file in scan.c.
Scan roles consists of regular scanning and synchronization to
periodic advertiser.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Don't include checks for advertiser is enabled when the broadcaster role
is not enabled. This makes it possible to have bt_le_ext_adv_foreach
be excluded from the compilation.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Refactor out the identity handling from hci_core to its own source file
in id.c
Identity consistes of managing the identities of the device, the privacy
feature which hides the identities. And handling of the identity
resolving list in the controller, needed to support privacy-enabled
remote devices.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Refactor the code so that bt_adv_lookup_legacy is always called after
the IS_ENABLED(CONFIG_BT_BROADCASTER) configuration has been checked and
the code path will be excluded.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Refactor command state state handling to one function.
When setting state outside of hci_core the cmd macro is not available,
so in order to assign the buf pointer to state the function is needed.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
The function returns true if the node with the referenced
node label is compatible and enabled.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The script gen_handles.py was introduce in #32127 but relies on
ZEPHYR_BASE being set in environment.
However, it is not a requirement to set Zephyr base in the users
environment, therefore this is changed to an argument `-z` or
`--zephyr-base` which will be passed from the build system to the
script.
If `-z` or `--zephyr-base` is not provided, the environment will be
checked for a ZEPHYR_BASE setting there.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
There was no close method implemented for AF_PACKET type
sockets. This meant that calling close() on packet socket
caused NULL pointer access.
This will allow #32949 issue to work properly.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The sentry symbols that mark the ends of the newlib heap area were
being placed in cached memory, which violates the coherence rules.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
OpenThread UART tx callback has been processed even if it was not
triggered by OpenThread otPlatUartSend function.
Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
This new subsystem can be used to supervise individual threads. It
is based on a regularly updated kernel timer, whose ISR is never
actually called in regular system operation.
An existing hardware watchdog can be used as an optional fallback if
the task watchdog itself gets stuck.
Signed-off-by: Martin Jäger <martin@libre.solar>
Improve the readability of the LMP90100-EVB RTD sample by adding
comments and further definitions instead of magic values within the
code.
This furthermore fixes an off-by-one error for the maximum ADC value
used in the formula for calculating the resistance of the RTD (8388607
vs. 8388608).
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Ported commit 49a3ce5881
Transfer locking is required if multiple devices use the same i2c bus.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
When CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS=y, we also
need to add -Xunaligned option for mdb to enable unaligned
memory access feature for nsim.
Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
Some devices may use different reference than cpu clock. Add
support for using swo-ref-frequency property when present.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Added file with common properties for cortex-m cores.
Added optional swo-ref-frequency property.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The twister integration on this board is problematic:
+ It assumes that it will be building on the device's linux
installation, which is often a somewhat slow Apollo Lake board (Up
Squared) with extremely limited storage space (mine has only 5G left
on the internal eMMC after Zephyr installation and can't fit a full
twister build tree).
+ Reading the trace output before the firmware load will emit output
from a previous test run. Twister isn't consistent about the order
in which the --west-flash and --device-serial-pty scripts are
started, which means that tests show spurious failures when the
order changes or if the device started with a test in its trace
buffer.
This is an elaboration on the scripting I've been using. It's a
single script that works as both the west-flash and device-serial-pty
handlers (or as an all-in-one standalone if you pass it the path to
the zephyr.elf file instead of running it under twister). It reaches
the device host over ssh and runs the tools with sudo, minimizing
administration overhead (the device does need a checked-out Zephyr
tree and a built diag_driver kernel module though).
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Change fixes an issue related to data access out of array bounds and
suppresses compiler warning.
Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
Fix compilation issue in direction finding tests, undefined references
to radio_df_ant_switching_gpios_cfg and
radio_df_ant_switching_pin_sel_cfg
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
The internal function z_smp_reacquire_global_lock() has not used by
anywhere inside zephyr code, so remove it.
Fixes#33273.
Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
This "else" clause was dead code, in a valid
tree it's not possible to have a node and
its child both be red.
Fix issue #33239.
Signed-off-by: Ningx Zhao <ningx.zhao@intel.com>
We don't use xcheck (we disable it by passing '-Hnoxcheck' to
linker) so let's avoid xcheck object linkage as well by
passing '-Hnoxcheck_obj' option.
'-Hnoxcheck_obj' option implies the '-Hnoxcheck' option.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
As of today during the Zephyr start we
- invalidate I$
- disable I$
- enable I$
Given that we don't need to have I$ disabled during any
initialization period and ARC processors have caches enabled
after reset the I$ disabling/enabling is excessive, so we can
drop it.
By that we also aligh the I$ initialization on ARC with other
projects like U-boot and Linux kernel.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>