Commit Graph

51989 Commits

Author SHA1 Message Date
Piotr Pryga 6518621805 Bluetooth: host: Add CTE receive and sample enable API
Add functions that give possibility to enable or disable
CTE receive and sample in connectionless mode.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga b48fe0a7db Bluetooth: host: Add option to enable connectionless CTE RX
Add Kconfig option that will enable supprot for connectionless
CTE reception. Thanks to that it will be possible to conditionally
enable or disable support of the feature and decrease code size
if the feature is not required.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga ca87766bd7 Bluetooth: controller: df: Set BT_CTLR_DF_ANT_SWITCH_RX enable
Set BT_CTLR_DF_ANT_SWITCH_RX enabled by default.
There is already added implementation that supports
this feature in controller, so it may be enabled by
default.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 4009692fcf Bluetooth: controller: Add connectionless CTE RX feat. in supp. feat. list
Add connectionless CTE RX feature to list of features supported
by controller. Add direction finding initialization in hci_core
if the feature is enabled.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga bf7bf0bec9 tests: Bluetooth: df: Add connectionless IQ sampling enable unit tests
Add unit tests for connectionless IQ sampling functionality in
controller.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga c02be507fb tests: Bluetooth: df: Move UT code into connectionless_cte_tx sub dir
Before thic commit the bluetooth/df unit tests subdirectory contained
connectionless CTE TX verification. Due to the implementation of
connectionless CTE RX new set of tests will be provided.
The new functionality requires different: configuration and common
setup code. Because of that, current test code was moved to
connectionless_cte_tx subdirectory.
Code shared by all DF tests is moved to common subdirectory.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga f74a0b294c Bluetooth: controller: Dropp IQ sampl report if CTE disabled after evt end
Disable of CTE sampling for periodic advertising sync PDUs may be
interrupted by radio event. In such situation, TX thread will be
handled before RX thread delivers IQ samples report to host. In
this case RX thread would deliver IQ samples report after CTE
sampling was disabled.

To avoid such situation RX thread has to check if:
- CTE sampling is not disabled,
- CTE sampling was not requested to be disabled after start of radio
  event.

CTE sampling configuration is double buffered. Updated configuration is
swapped at the beginning of radio event.

If CTE sampling is diabled or requested to disable (next radio event
didn't start), the IQ samples report should be dropped by RX thread
and should not be delivered to host.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 6652b18d19 Bluetooth: controller: LLL: Add CTE report for per. adv. PDU with bad CRC
Add reporing of IQ samples collected for CTE attached to periodic
advertising PDUs with bad CRC.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga e884c02d92 Bluetooth: controller: Add opt. to enable CTE samplig for PDUs with bad CRC
Add Kconfig option that will enable possiblity to sample CTE attached to
PDUs that have bard CRC. Sampling is based on CTEInfo field available
in received PDU. If radio is able to parse the field correclty then
it will start sampling even the CRC is wrong.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 17d9df1c7a Bluetooth: controller: hci: Add connectionless IQ report event handler
Add handler for HCI_LE_Connection_IQ_Report event.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 582ca85e29 Bluetooth: controller: hci: Add connectionelss IQ samplig enable handler
Add handler for HCI_LE_Set_Connectionless_IQ_Sampling_Enable HCI
command.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga ff24092bdd Bluetooth: controller: ULL: Add function to enable or disable CTE sampling
Add function that enables or disables CTE sampling attached to received
periodic advertising PDUs.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga b7c1c4575d Bluetooth: controller: LLL: Add CTE sampling and reporting
ULL may request LLL to start receiving and sampling CTE attached to
end of periodic advertising PDUs. When the CTE is successfully sampled,
LLL should report collected samples to ULL.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga edfb85736e Bluetooth: controller: radio: Add function to get CTEInfo from Radio reg
Nordic Radio perihperal provides possiblity to get value of CTEInfo
field parsed from received PDU. It is faster to get the information
from Radio register than parse a PDU content.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 646303834c Bluetooth: controller: LLL: DF: Add function to enable CTE receive
Add function to enable CTE receive and sampling. The function
is aimed to be used by code in lll_sync.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga d182b7169a Bluetooth: controller: Add function to update per sync event slot duration
To enable or disable CTE sampling during periodic advertising sync evnet
it is requireq to change the event duration. To make it possible new
function was added that handles the operation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 871359d934 Bluetooth: controller: ULL: Add init of DF sync configuration
lll_sync object is used to store information for LLL to enable
or disable CTE sampling. The commit adds initialization of
lll_df_sync member of lll_sync.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 37dd38c988 Bluetooth: controller: LLL: Add DF configuration to lll_sync structure.
To enable or disable CTE sampling in periodic advertising scanner LLL
implementation lll_sync is extended by lll_df_sync member.
The lll_df_sync is a double buffer for lll_df_sync_cfg.
It will be used by LL thread to enable or disable CTE sampling and
provide configuration for sampling CTE in AoA mode.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 2f4e014f14 Bluetooth: controller: ULL: Add node_rx_iq_report handling in ULL RX path
Add handling of Direction Finding node_rx_iq_report type in ULL.
This is required to correctly deliver IQ samples collected by
LLL during receive of PDU including CTE.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga ff94b9f676 Bluetooth: controller: Add double buffer for DF sync configuration
CTE sampling enable or disable requests should be provided to LLL.
Double buffer of lll_df_sync_cfg is added to lll_sync for that purpose
Thanks to that:
- there is no need to synchronize LLL with LL thread
- LLL has always access to valid configuration (new or former)

The configuration is stored in double buffer as instances
of lll_df_sync_cfg, not as pointers. This is the only
difference between double buffer pattern used to store adverising PDU.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga aa51f0a0dc Bluetooth: controller: Add DF per. adv. sync. configuration stucture
Add new structure lll_df_sync_cfg to store DF configuration
for periodic advertising synchronization.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 4d706bb6fb Bluetooth: controller: Add IQ report mem pool management
Add functions that will allow to mangage IQ reports memory pool
e.g. allocate or relase new IQ report nodes.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga bdaf4eed9a Bluetooth: controller: New node_rx type for IQ sample report
Add new kind of node_rx type that will store IQ samples report.
The structure includes node_rx_hdr and may be used by the same
queues that are used to forward regular node_rx_pdu objects
between LLL and ULL.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 2aa8431c87 include: Bluetooth: hci: Add LE connectionelss IQ samples report event
Add HCI_LE_Connectionless_IQ_Report event that will allow controller
to report received CTE and provide collected IQ samples to host.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga ddece2501d include: Bluetooth: hci: Add LE set connectionless IQ sampling enabled
Add new command HCI_LE_Set_Connectionless_IQ_Sampling_Enable that
will allow host to enable CTE sampling in controller.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 8ceaea179c include: Bluetooth: hci: move command to appropriate position in file
All commands are put in the file according to OpCode Command Field
increasing order. bt_hci_cp_le_set_cl_cte_tx_enable was written in
wrong position. This commit moves it to correct one.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 68704c8cb1 Bluetooth: controller: Add Kconfig option to enable conn-less CTE sampling
Direction Finding support requires possibility to receive and sample CTE
attached to periodic advertising PDUs. New option will be used to enable
or disable the functionality. New option is introduced to avoid using
double statements checking if BT_CTLR_DF_CTE_RX and BT_CTLR_SYNC_-
-PERIODIC are enabled.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 2e1e8aff8d Bluetooth: controller: Add Kconfig option to enable debugging code in DF
To avid enabling HCI drived debugging, like in other controller source
files, Direction Finding has its own option BT_CTLR_DF_DEBUG_ENABLE.
This gives fine grained control deubgging output.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 2f7b0b7392 Bluetooth: controller: Disable not implemented DF features
Set to disabled not yet implemented Direction Finding features.
The features will be enabled by default when they are implemented.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 5779a2d7f2 Bluetooth: controller: radio: Add function to get PDU ant. switch pattern
IQ samples report requires information about antenna switch pattern
that was used to measure RSSI. RSSI is measured during PDU receive.
For Nordic Radio peripheral the PDU antenna is selected by first antenna
switch pattern set in SWITCHPATTERN register. That pattern is providded
by device tree. This information is already available in radio_df.c.
The information is required by LLL, that has access to functions
provided in radio_df.c. New function was provided to return PDU antenna
switch pattern.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Jedrzej Ciupis 0923e32fe7 drivers: ieee802154: Udpate nRF IEEE 802.15.4 radio driver
This commit updates the revision of hal_nordic component
and introduces necessary changes to the IEEE 802.15.4 driver
to match latest nRF IEEE 802.15.4 radio driver API.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2021-05-06 08:46:47 -05:00
Krzysztof Chruscinski de6e1864cb tests: logging: log_core: Remove cases moved to log_api suite
Cleanup in the test suite since some tests were moved to log_api suite.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-06 15:40:05 +02:00
Krzysztof Chruscinski ef856385e7 tests: logging: Add log_api test suite
Add test suite which validates logging behavior in various
configurations.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-06 15:40:05 +02:00
Krzysztof Chruscinski d3b246464c scripts: ci: check_compliance: Extend UNDEF_KCONFIG_WHITELIST
Added SAMPLE_MODULE_LOG_LEVEL_DBG as an exception. Define is used
in the log_api test suite.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-06 15:40:05 +02:00
Krzysztof Chruscinski 4c971d2c21 logging: Add panic flag reset to core initialization
Add panic_mode flag reset to log_core_init(). It allows full logging
reinitialization which is useful for testing.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-06 15:40:05 +02:00
Krzysztof Chruscinski d58ff39879 logging: Fix runtime filtering in immediate mode
Fixed immediate mode where runtime filter was not applied.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-06 15:40:05 +02:00
Krzysztof Chruscinski d9518ce4cc logging: Add optional context argument to LOG_BACKEND_DEFINE
Extended LOG_BACKEND_DEFINE to support optional context argument.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-06 15:40:05 +02:00
Krzysztof Chruscinski edc3c87c72 lib: os: mpsc_buf: Allow dropping of skip packets in no overwrite
Previously, when no overwrite mode was used and there was no space
no packet was dropped. However, it should be allowed to drop skip
packet that may be added as padding at the end of the buffer.
Extended dropping scheme to drop skip packets in no overwrite mode.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-06 15:40:05 +02:00
Krzysztof Chruscinski 7825487334 lib: os: mpsc_pbuf: Add guard for oversized allocation
Added early return from mpsc_pbuf_alloc when requested size
exceed the buffer capacity. Previously, in that case buffer
was falling into endless loop.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-06 15:40:05 +02:00
Vinayak Kariappa Chettimada 737cab2614 Bluetooth: controller: openisa: Check preempt event on timeout
Check whether the preempt event matches with the head of the
pipeline before aborting the currently active event.

This is required to avoid preemption of events that became
active due to done event and there has been a race in
stopping the preempt ticker.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-05-06 15:39:16 +02:00
Vinayak Kariappa Chettimada 5b75bdf589 Bluetooth: controller: nRF5: Check preempt event on timeout
Check whether the preempt event matches with the head of the
pipeline before aborting the currently active event.

This is required to avoid preemption of events that became
active due to done event and there has been a race in
stopping the preempt ticker.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-05-06 15:39:16 +02:00
Vinayak Kariappa Chettimada 6916eb97ac Bluetooth: controller: openisa: Preempt timeout for next in pipeline
Start new preempt timeout for the next in pipeline when a
new event gets active.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-05-06 15:39:16 +02:00
Vinayak Kariappa Chettimada 8edc998332 Bluetooth: controller: nRF5: Preempt timeout for next in pipeline
Start new preempt timeout for the next in pipeline when a
new event gets active.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-05-06 15:39:16 +02:00
Vinayak Kariappa Chettimada aeafc9ede5 Bluetooth: controller: openisa: Sync up LLL changes
Sync up with missing LLL changes done related to moving the
handling of pipeline handling into LLL.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-05-06 15:39:16 +02:00
Andrzej Puzdrowski df726f5afe drivers/flash/nrf_qspi_nor: fixed bad type casting
nrf_qspi_write_t was used instead of nrf_qspi_readoc_t in casting.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-05-06 08:32:19 -05:00
Kim Bøndergaard 5a54cae7ce boards: stm32f412g_disco: Add arduino headers
Added arduino gpios, and the typically used aliases for
arduino_spi, arduino serial and arduino_i2c

Signed-off-by: Kim Bøndergaard <kim.boendergaard@escoglobal.com>
Signed-off-by: Kim Bøndergaard <kim@fam-boendergaard.dk>
2021-05-06 08:17:07 -05:00
Mulin Chao f7f93d2207 driver: uart: npcx: Support APB clock of uart module up to 20MHz.
Suport npcx UART module's APB clock up to 20MHz.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-05-06 08:15:39 -05:00
Mulin Chao 2a86c3ba9d driver: i2c: npcx: support APB clock of i2c modules up to 20MHz.
Support APB clock of npcx i2c modules up to 20MHz and add releted timing
settings.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-05-06 08:15:39 -05:00
Piotr Pryga 6432a56ae9 clang-format: Change lines length limit from 80 to 100
Change line length limit from former 80 characters to current 100.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 08:13:32 -05:00
Alex Tsamakos a637f0a718 boards: actinius_icarus: remove unused pwm nodes and add bootloader LED
Also update the name of sram0_bsd to sram0_modem

Signed-off-by: Alex Tsamakos <alex@actinius.com>
2021-05-06 15:03:32 +02:00