Commit graph

45781 commits

Author SHA1 Message Date
Emil Gydesen
d911f99bfc Bluetooth: controller: guard NODE_RX_TYPE_USER with range value
Instead of guarding the NODE_RX_TYPE_USER cases with
CONFIG_BT_CTLR_USER_EXT we guard them with
CONFIG_BT_CTLR_USER_EVT_RANGE > 0 as that is the actual value that
enables/disables the NODE_RX_TYPE_USER values.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-11-11 13:25:20 +01:00
Emil Gydesen
58eb76e06d Bluetooth: Controller: Change node_rx_type to auto incrementing enum
Instead of having explicit values for each entry in the enum that
has to be updated for each new entry (thus requiring manual work
which can also be error-prone), the enum will now be
self-incrementing, to make it easier and safer to add new
entries.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-11-11 13:25:20 +01:00
Emil Gydesen
8af767e28c Bluetooth: controller: Remove #ifdef for node_rx_type enum
Removed the #ifdef's for the node_rx_type enum. Since the
savings, they just make the enum harder to read.

Furthermore it will also ensure that all the enum values
will have the same value once the enum entries are no
longer manually defined.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-11-11 13:25:20 +01:00
Rubin Gerritsen
f93559c87b nrf52_bsim: Fix cmsis irq locking logical bug
True means IRQs are disabled.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2020-11-11 13:24:47 +01:00
Erik Brockhoff
b67233c6a4 bluetooth: controller: don't assert on rl disabled
Simply return 0 to indicate the deferred resolve was not accepted when
address resolve is not enabled

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2020-11-11 13:24:14 +01:00
Thomas Ebert Hansen
28a8582a49 Bluetooth: host: Fix endianness in conn. handle
Fix the endianness of the connection handle in the handler for
BT_HCI_EVT_REMOTE_VERSION_INFO.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2020-11-11 13:23:49 +01:00
Andrzej Kaczmarek
04a48d9ec2 Bluetooth: controller: Fix build without BT_CENTRAL
lll->conn is only defined valid when BT_CENTRAL is enabled.
Also ull_sched_mfy_after_mstr_offset_get is only used when BT_CENTRAL
is enabled.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-11-11 13:23:33 +01:00
Lingao Meng
7e302979f3 Bluetooth: Mesh: Fix DST field check when send
Add check for dst field in transport layer tx function.

Fixes: #29868

Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
2020-11-11 13:23:14 +01:00
Trond Einar Snekvik
a2aad2b3f8 Bluetooth: Mesh: Check TTL max value on transport TX
Adds check for TTL max in the transport send functions, and moves
setting of default TTL to transport.

Fixes #29855.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-11-11 13:22:34 +01:00
Joakim Andersson
f24a725d84 doc: release-notes: Add note about directed advertising address option
Added note about change in the option for advertising directed
towards a privacy enabled peer.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-11-11 13:22:02 +01:00
Joakim Andersson
d81197ff77 Bluetooth: shell: Fix shell scan option duplicate filtering options
Fix the shell always setting the filter duplicates option for active
scan.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-11-11 13:22:02 +01:00
Joakim Andersson
bd7a2fc395 Bluetooth: host: Change directed advertising to privacy-enabled peer
Change the advertising option that controls if the directed advertiser
will use an RPA or the identity address of the peer for the initiator
address.
This option currently has two issues:
 - It behaves differently if the privacy feature has been enabled,
   which can be confusing for application to use.
 - It cannot start a directed advertiser towards a peer that is not
   privacy-enabled and has distributed an IRK.

This commit includes the following changes:
 - When privacy has been enabled in order to advertise towards a
   privacy-enabled peer the BT_LE_ADV_OPT_DIR_ADDR_RPA option must now
   be set (same as when privacy has been disabled).
 - It is now possible to start a directed advertiser using the identity
   address of the peer when privacy-enabled.
 - When privacy has been enabled the advertising option combination
   of using the local identity address and an RPA as the initiator
   address is now disallowed and will return an error code.
   This is done because this combination did not actually work and would
   have used the identity address of the peer instead.
 - If the controller does not support controller-based privacy then
   using the option BT_LE_ADV_OPT_DIR_ADDR_RPA will return ENOTSUP
   because this behavior cannot be done with host-based privacy.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-11-11 13:22:02 +01:00
Andrzej Kaczmarek
904a421915 Bluetooth: controller: Disallow starting scannable adv w/o scan rsp
Scannable advertising set cannot be started without scan response data.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-11-11 13:20:40 +01:00
Andrzej Kaczmarek
7195ce6970 Bluetooth: controller: Allow to discard scan response data
Host can discard scan response data by setting empty data. We simply
set PDU length to 0 to indicate this, it will make future check easier.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-11-11 13:20:40 +01:00
Andrzej Kaczmarek
b08a0bd8a7 Bluetooth: controller: Fix LE Set Ext Scan Rsp Data restrictions
This fixes restrictions for setting/discarding scan response data to
mach spec.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-11-11 13:20:40 +01:00
Vinayak Kariappa Chettimada
701d524143 Bluetooth: controller: Fix memory alignment of PDU buffer reference
Align the PDU buffer reference in struct node_rx_pdu so that
node rx type specific parameters, like, terminate and sync
lost reason can be accessed without any memory alignment
issues.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 13:20:33 +01:00
Vinayak Kariappa Chettimada
d7d8ae7894 Bluetooth: controller: Use connection complete variable naming
Use the connection complete varaible naming to access
connection complete parameters.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 13:20:33 +01:00
Vinayak Kariappa Chettimada
a5b489e2fa Bluetooth: controller: Make conn cancel and sync cancel impl. consistent
Make the connection cancel and periodic advertising sync
create cancel implementation consistent.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 13:20:33 +01:00
Vinayak Kariappa Chettimada
92b2591558 Bluetooth: controller: Fix missing storage for sync cancel reason
Fix missing storage allocation in ll_sync_set structure for
storing the sync cancel reason.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 13:20:33 +01:00
Peter Bigot
ae6b236d26 dts: nordic: add CC count to RTC and TIMER nodes
The number of capture/compare registers available on a peripheral
should be exposed in devicetree.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-11-11 13:20:25 +01:00
Yuguo Zou
ba2413f544 arch: arc: change to CONFIG_INIT_ARCH_HW_AT_BOOT
align kconfig option CONFIG_ARC_CUSTOM_INIT to
CONFIG_INIT_ARCH_HW_AT_BOOT. Remove unused CONFIG_ARC_CUSTOM_INIT in
kconfig.

Signed-off-by: Yuguo Zou <yuguo.zou@synopsys.com>
2020-11-11 13:20:14 +01:00
Flavio Ceolin
c609528dc2 pm: Add power management states definition
Add definition power management states, these states were inspired by
ACPI specification. This commit is part of the following pr
https://github.com/zephyrproject-rtos/zephyr/pull/27315 from Wentong.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-11-11 13:20:05 +01:00
Krzysztof Chruscinski
9703a78bb3 tests: lib: ringbuffer: Add performance test
Added test which can be used to verify performance of ring
buffer algorithm.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-11-11 13:17:49 +01:00
Krzysztof Chruscinski
243a470810 lib: os: ring_buffer: Cleaning checkpatch warnings
Removing line exceeding warnings which appeared after u32_t -> uint32_t
converstion.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-11-11 13:17:49 +01:00
Krzysztof Chruscinski
1e46bb3bb5 lib: os: ring_buffer: Allow using full buffer capacity
Previously, ring buffer had capacity of provided buffer size - 1. This
trick was used to distinguish between empty and full states. It had one
drawback: ring buffer could not be used as a pool of equal sized buffers
(using ring_buf_put_claim and ring_buf_get_claim).
Reworked internals to use non wrapping head and tail. Since they are
non wrapping, there is no issue with distinguishing between empty and
full. Since this appraoch would be vulnerable to wrapping on 32 bit
boundary, added a mechanism which periodically reduces all indexes to
avoid 32 bit wrapping.

After this rework, buffer has one byte more capacity. Simple test shows
slight performance improvement.

Updated tests to reflect increased capacity and added test to check if
it is possible to continuesly allocated 2 buffers of half ring buffer
size.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-11-11 13:17:49 +01:00
Armando Visconti
c380142920 drivers/sensor: iis2iclx: add multi-instance
Make this driver multi-instance and use the new API.

Notes for sensorhub mode:
In case of multiples devices it is possible that some of them
has i2c slaves attached to it (sensorhub mode) but not the
others. Since the driver is configured in the same way for
all the instances (CONFIG_SENSORHUB=y), the routine that initialize
the sensorhub part does not fail anymore in case no slaves
are found for a particular instance. Instead, those non-sensorhub
driver instances will set the shub_inited flag to false and
will totally ignore the feature.

Notes for triggers:
In case of multiples devices the device pin the interrupt wire is
attached to can be different (INT1 or INT2 pin). So, this
information has been moved in DTS and then stored in the
specific instance config structure.
Currently the driver is able to handle a sngle interrupt line
at a time attached to either INT1 or INT2.
MOreover, the interrupt initialization for a driver instance proceed
only if the drdy has been configured in its DT, else it returns ok.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-11-11 13:17:18 +01:00
Brian Bradley
a9c7cd7ed6 doc: document support of shell management for mcumgr
This is documented similarly to how other command
handlers are documented. This documents that shell
management is supported, but relies on the example
project for implementation details.

Signed-off-by: Brian Bradley <brian.bradley.p@gmail.com>
2020-11-11 13:17:02 +01:00
Brian Bradley
71f3f83c2d west: update revision for mcumgr library
The updated revision includes the ability to use shell management

Signed-off-by: Brian Bradley <brian.bradley.p@gmail.com>
2020-11-11 13:17:02 +01:00
Brian Bradley
77be47c2fc samples: add support for shell management in mcumgr sample
The shell management feature must be enabled using the provided overlay

Signed-off-by: Brian Bradley <brian.bradley.p@gmail.com>
2020-11-11 13:17:02 +01:00
Brian Bradley
313f1713ac mgmt: mcumgr: add configuration option to enable shell management
This configuration is be required to enable the shell management
command handler supported by the core mcumgr library

Signed-off-by: Brian Bradley <brian.bradley.p@gmail.com>
2020-11-11 13:17:02 +01:00
Vinayak Kariappa Chettimada
be090f7b33 Bluetooth: controller: Fix maximum AC PDU payload size calcuation
Fix maximum Advertising Channel PDU payload size calculation
by including the Common Extended Advertising Payload Format
overload alongwith the AD data maximum size supported.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 12:28:05 +01:00
Vinayak Kariappa Chettimada
f677144f30 Bluetooth: controller: Remove unused defined in pdu.h file
Remove used constant macro defined in pdu.h file.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 12:28:05 +01:00
Vinayak Kariappa Chettimada
09c5035359 Bluetooth: controller: Added comments related to AD data double buffering
Added inline comments explaining the implementation of AD
data PDU double buffering.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 12:28:05 +01:00
Vinayak Kariappa Chettimada
b1d087f643 tests: Bluetooth: bsim: Enable 251 byte AD data PDU
Enable the test procedure that requires greater than 31 byte
PDU when AD data and Sync Info structure be present in the
Advertising channel PDU.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 12:28:05 +01:00
Vinayak Kariappa Chettimada
22ec1acacc Bluetooth: controller: Minor move code closer to locality of reference
Minor change to move code closer to locality of reference.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 12:28:05 +01:00
Vinayak Kariappa Chettimada
c842eef3ae Bluetooth: controller: Add semaphore to indicate free AD data buffers
Add semaphore implementation to indicate and wait for free
AD data buffers.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 12:28:05 +01:00
Vinayak Kariappa Chettimada
dc02ebf5ed Bluetooth: controller: Release AD data on advertising set remove
Add implementation to release AD data PDU buffers on
advertising set remove.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 12:28:05 +01:00
Vinayak Kariappa Chettimada
5b396aaafb Bluetooth: controller: Use mfifo to return stale AD data PDU
Added implementation using mfifo to return stale AD data PDU
from LLL to Thread context.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 12:28:05 +01:00
Vinayak Kariappa Chettimada
2be0d07543 Bluetooth: controller: Add Max. AD data buffers Kconfig option
Add Kconfig option to configure maximum number of buffered
AD data PDUs across enabled advertising sets.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 12:28:05 +01:00
Vinayak Kariappa Chettimada
c2fc629dd2 Bluetooth: controller: 255 byte AD payload support
Add 255 byte AD payload support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-11 12:28:05 +01:00
Daniel Leung
7d16ab50d7 cmake: fix xcc not supporting -Wno-unsed-but-set-variable
XCC does not support the compiler flag -Wno-unused-but-set-variable
so check for flag support before setting it in cmake.

Fixes #29707

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-11-10 21:51:36 -05:00
Ying ming
5829fd88a5 test: workqueue: add code description
Add testcase descriptions for test_work_item_supplied_with_func(),
test_sched_delayed_work_item(), test_workqueue_max_number(),
test_workq_start_before_submit(), test_work_submit_handler()

Signed-off-by: Ying ming <mingx.ying@intel.com>
2020-11-10 21:47:03 -05:00
Ying ming
255c4df04b test: workqueue: modify testcase
The thread name is used to judge whether the thread of
user-defined workqueue is created successfully.

Signed-off-by: Ying ming <mingx.ying@intel.com>
2020-11-10 21:47:03 -05:00
Gerard Marull-Paretas
d79b003758 boards: shields: add support for buydisplay 3.5" TFT
Add support for the BuyDisplay 3.5" TFT + touch shield based on ILI9488
controller and FT6236 touch.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-11-10 15:52:12 -06:00
Gerard Marull-Paretas
4812bb5175 drivers: display: ili9xxx: add support for ILI9488 controller
Add support for the ILI9488 display controller.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-11-10 15:52:12 -06:00
Gerard Marull-Paretas
acb0cd65ca drivers: display: ili9xxx: generalize ILI display driver
Make driver generic for multiple ILI displays. The adopted strategy is
to share all driver code except register initialization, which has been
found to have some specific registers/values depending on the
controller.

The driver has been adjusted to support multiple compatibles.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-11-10 15:52:12 -06:00
Henrik Brix Andersen
df51a8a5c7 samples: canbus: canopen: add configuration for devices with no storage
Add CANopen sample configuration file for devices with no
storage/settings support.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-11-10 15:44:25 -06:00
Eugeniy Paltsev
499b4c9069 ARC: nSIM: DTS: switch UART clock-frequency to 50MHz
UART IP is clocked with 50MHz on HAPS by default. So switch
UART clock-frequency from 100MHz to 50MHz for nsim_* boards
so the binaries can be run on HAPS as well.

This property is dummy in case run in simulator (nSIM) so we
don't need to change anything in nSIM configuration files.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2020-11-10 14:02:11 -06:00
Andrzej Głąbek
be02edb050 drivers/flash/nrf_qspi_nor: Add support for nRF53 Series SoCs
Improve the way the nrf_qspi_nor driver configures the SCK frequency,
to properly support QSPI also on nRF53 Series SoCs that use a different
base clock frequency (96 MHz).
Add also a relevant configuration in the spi_flash sample so that it
can run on the nRF5340 DK.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-11-10 21:01:37 +02:00
Andrzej Głąbek
6207300dc3 boards: nrf5340dk_nrf5340: Add dts node for MX25R64 flash on QSPI
The nRF5340 (P)DK is equipped with the MX25R64 flash memory. Add a dts
node for that chip in the board definition as well as the missing QSPI
node in the nRF5340 SoC definition.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-11-10 21:01:37 +02:00